BBitmap: Introduce ImportBits variants that take BSizes.

The old versions used pixel-count dimensions, not pixel-span dimensions
as the entire rest of the API does, which was probably a mistake
in the first place. The new APIs using BSize always use pixel-span
dimensions.

The old versions will shortly be deprecated.

Discovered while working on Xlibe.

Change-Id: I604a5ac6e0588420ff0b667d9193d60ac27b92c6
This commit is contained in:
Augustin Cavalier
2022-01-07 22:03:01 -05:00
parent d66430ec52
commit edd3417172
2 changed files with 39 additions and 18 deletions
+15 -7
View File
@@ -79,20 +79,15 @@ public:
status_t SetDrawingFlags(uint32 flags);
uint32 Flags() const;
void SetBits(const void* data, int32 length,
int32 offset, color_space colorSpace);
// not part of the R5 API
status_t ImportBits(const void* data, int32 length,
int32 bpr, int32 offset,
color_space colorSpace);
status_t ImportBits(const void* data, int32 length,
int32 bpr, color_space colorSpace,
BPoint from, BPoint to, int32 width,
int32 height);
BPoint from, BPoint to, BSize size);
status_t ImportBits(const BBitmap* bitmap);
status_t ImportBits(const BBitmap* bitmap, BPoint from,
BPoint to, int32 width, int32 height);
BPoint to, BSize size);
status_t GetOverlayRestrictions(
overlay_restrictions* restrictions) const;
@@ -111,6 +106,19 @@ public:
BBitmap& operator=(const BBitmap& source);
class Private;
public:
// deprecated
void SetBits(const void* data, int32 length,
int32 offset, color_space colorSpace);
public:
status_t ImportBits(const void* data, int32 length,
int32 bpr, color_space colorSpace,
BPoint from, BPoint to, int32 width, int32 height);
status_t ImportBits(const BBitmap* bitmap, BPoint from,
BPoint to, int32 width, int32 height);
private:
friend class BView;
friend class BApplication;