Adjust all in-tree applications after BBitmap::ImportBits API changes.
Change-Id: If3a06f35c01089cdbb696de479984f2b59fce7a0
This commit is contained in:
@@ -1293,8 +1293,7 @@ RemoteView::_DrawThread()
|
|||||||
// TODO: support the drawCursor flag
|
// TODO: support the drawCursor flag
|
||||||
BBitmap bitmap(bounds, B_BITMAP_NO_SERVER_LINK, B_RGB32);
|
BBitmap bitmap(bounds, B_BITMAP_NO_SERVER_LINK, B_RGB32);
|
||||||
bitmap.ImportBits(fOffscreenBitmap, bounds.LeftTop(),
|
bitmap.ImportBits(fOffscreenBitmap, bounds.LeftTop(),
|
||||||
BPoint(0, 0), bounds.IntegerWidth() + 1,
|
BPoint(0, 0), bounds.Size());
|
||||||
bounds.IntegerHeight() + 1);
|
|
||||||
|
|
||||||
reply.Start(RP_READ_BITMAP_RESULT);
|
reply.Start(RP_READ_BITMAP_RESULT);
|
||||||
reply.Add(token);
|
reply.Add(token);
|
||||||
|
|||||||
@@ -224,20 +224,16 @@ Screenshot::_New(bigtime_t delay)
|
|||||||
|
|
||||||
// Put the mouse area in a bitmap
|
// Put the mouse area in a bitmap
|
||||||
BRect bounds = fUtility->cursorBitmap->Bounds();
|
BRect bounds = fUtility->cursorBitmap->Bounds();
|
||||||
int cursorWidth = bounds.IntegerWidth() + 1;
|
|
||||||
int cursorHeight = bounds.IntegerHeight() + 1;
|
|
||||||
fUtility->cursorAreaBitmap = new BBitmap(bounds, B_RGBA32);
|
fUtility->cursorAreaBitmap = new BBitmap(bounds, B_RGBA32);
|
||||||
|
|
||||||
fUtility->cursorAreaBitmap->ImportBits(fUtility->wholeScreen->Bits(),
|
fUtility->cursorAreaBitmap->ImportBits(fUtility->wholeScreen,
|
||||||
fUtility->wholeScreen->BitsLength(),
|
fUtility->cursorPosition, BPoint(0, 0), bounds.Size());
|
||||||
fUtility->wholeScreen->BytesPerRow(),
|
|
||||||
fUtility->wholeScreen->ColorSpace(),
|
|
||||||
fUtility->cursorPosition, BPoint(0, 0),
|
|
||||||
cursorWidth, cursorHeight);
|
|
||||||
|
|
||||||
// Fill in the background of the mouse bitmap
|
// Fill in the background of the mouse bitmap
|
||||||
uint8* bits = (uint8*)fUtility->cursorBitmap->Bits();
|
uint8* bits = (uint8*)fUtility->cursorBitmap->Bits();
|
||||||
uint8* areaBits = (uint8*)fUtility->cursorAreaBitmap->Bits();
|
uint8* areaBits = (uint8*)fUtility->cursorAreaBitmap->Bits();
|
||||||
|
int cursorWidth = bounds.IntegerWidth() + 1;
|
||||||
|
int cursorHeight = bounds.IntegerHeight() + 1;
|
||||||
for (int32 i = 0; i < cursorHeight; i++) {
|
for (int32 i = 0; i < cursorHeight; i++) {
|
||||||
for (int32 j = 0; j < cursorWidth; j++) {
|
for (int32 j = 0; j < cursorWidth; j++) {
|
||||||
uint8 alpha = 255 - bits[3];
|
uint8 alpha = 255 - bits[3];
|
||||||
|
|||||||
@@ -139,28 +139,14 @@ Utility::MakeScreenshot(bool includeMouse, bool activeWindow,
|
|||||||
if (wholeScreen == NULL)
|
if (wholeScreen == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int cursorWidth = 0;
|
|
||||||
int cursorHeight = 0;
|
|
||||||
|
|
||||||
if (cursorBitmap != NULL) {
|
|
||||||
BRect bounds = cursorBitmap->Bounds();
|
|
||||||
cursorWidth = bounds.IntegerWidth() + 1;
|
|
||||||
cursorHeight = bounds.IntegerHeight() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (includeMouse && cursorBitmap != NULL) {
|
if (includeMouse && cursorBitmap != NULL) {
|
||||||
// Import the cursor bitmap into wholeScreen
|
// Import the cursor bitmap into wholeScreen
|
||||||
wholeScreen->ImportBits(cursorBitmap->Bits(),
|
wholeScreen->ImportBits(cursorBitmap,
|
||||||
cursorBitmap->BitsLength(), cursorBitmap->BytesPerRow(),
|
B_ORIGIN, cursorPosition, cursorBitmap->Bounds().Size());
|
||||||
cursorBitmap->ColorSpace(), BPoint(0, 0), cursorPosition,
|
|
||||||
cursorWidth, cursorHeight);
|
|
||||||
|
|
||||||
} else if (cursorAreaBitmap != NULL) {
|
} else if (cursorAreaBitmap != NULL) {
|
||||||
// Import the cursor area bitmap into wholeScreen
|
// Import the cursor area bitmap into wholeScreen
|
||||||
wholeScreen->ImportBits(cursorAreaBitmap->Bits(),
|
wholeScreen->ImportBits(cursorAreaBitmap,
|
||||||
cursorAreaBitmap->BitsLength(), cursorAreaBitmap->BytesPerRow(),
|
B_ORIGIN, cursorPosition, cursorAreaBitmap->Bounds().Size());
|
||||||
cursorAreaBitmap->ColorSpace(), BPoint(0, 0), cursorPosition,
|
|
||||||
cursorWidth, cursorHeight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BBitmap* screenshot = NULL;
|
BBitmap* screenshot = NULL;
|
||||||
@@ -175,11 +161,8 @@ Utility::MakeScreenshot(bool includeMouse, bool activeWindow,
|
|||||||
screenshot = new BBitmap(frame.OffsetToCopy(B_ORIGIN),
|
screenshot = new BBitmap(frame.OffsetToCopy(B_ORIGIN),
|
||||||
includeBorder ? B_RGBA32 : B_RGB32, true);
|
includeBorder ? B_RGBA32 : B_RGB32, true);
|
||||||
|
|
||||||
if (screenshot->ImportBits(wholeScreen->Bits(),
|
if (screenshot->ImportBits(wholeScreen, frame.LeftTop(),
|
||||||
wholeScreen->BitsLength(), wholeScreen->BytesPerRow(),
|
B_ORIGIN, frame.Size()) != B_OK) {
|
||||||
wholeScreen->ColorSpace(), frame.LeftTop(),
|
|
||||||
BPoint(0, 0), frame.IntegerWidth() + 1,
|
|
||||||
frame.IntegerHeight() + 1) != B_OK) {
|
|
||||||
delete screenshot;
|
delete screenshot;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ BImageResources::GetIconResource(int32 id, icon_size size,
|
|||||||
float x = roundf((dest->Bounds().Width() - size) / 2);
|
float x = roundf((dest->Bounds().Width() - size) / 2);
|
||||||
float y = roundf((dest->Bounds().Height() - size) / 2);
|
float y = roundf((dest->Bounds().Height() - size) / 2);
|
||||||
return dest->ImportBits(data, (int32)length, size, B_CMAP8,
|
return dest->ImportBits(data, (int32)length, size, B_CMAP8,
|
||||||
BPoint(0, 0), BPoint(x, y), size, size);
|
BPoint(0, 0), BPoint(x, y), BSize(size - 1, size - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1505,7 +1505,7 @@ DrawingEngine::ReadBitmap(ServerBitmap* bitmap, bool drawCursor, BRect bounds)
|
|||||||
cursorArea.ImportBits(bitmap->Bits(), bitmap->BitsLength(),
|
cursorArea.ImportBits(bitmap->Bits(), bitmap->BitsLength(),
|
||||||
bitmap->BytesPerRow(), bitmap->ColorSpace(),
|
bitmap->BytesPerRow(), bitmap->ColorSpace(),
|
||||||
cursorPosition, BPoint(0, 0),
|
cursorPosition, BPoint(0, 0),
|
||||||
cursorWidth, cursorHeight);
|
cursorArea.Bounds().Size());
|
||||||
|
|
||||||
uint8* bits = (uint8*)cursorArea.Bits();
|
uint8* bits = (uint8*)cursorArea.Bits();
|
||||||
uint8* cursorBits = (uint8*)cursor->Bits();
|
uint8* cursorBits = (uint8*)cursor->Bits();
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ private:
|
|||||||
fCurrentIconBitmap->ImportBits(sourceBitmap,
|
fCurrentIconBitmap->ImportBits(sourceBitmap,
|
||||||
BPoint(0, fCurrentAnimationRow),
|
BPoint(0, fCurrentAnimationRow),
|
||||||
BPoint(0, fCurrentAnimationRow),
|
BPoint(0, fCurrentAnimationRow),
|
||||||
sourceBitmap->Bounds().IntegerWidth(), 1);
|
BSize(sourceBitmap->Bounds().IntegerWidth() - 1, 0));
|
||||||
|
|
||||||
fCurrentAnimationRow--;
|
fCurrentAnimationRow--;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user