mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 802491 - Always transfer ownership of direct-allocation buffers to BufferedCairoImage. r=Cwiiis
This commit is contained in:
parent
73311b7efb
commit
e7c0764df4
@ -16,7 +16,6 @@ public class BufferedCairoImage extends CairoImage {
|
||||
private ByteBuffer mBuffer;
|
||||
private IntSize mSize;
|
||||
private int mFormat;
|
||||
private boolean mNeedToFreeBuffer;
|
||||
|
||||
/** Creates a buffered Cairo image from a byte buffer. */
|
||||
public BufferedCairoImage(ByteBuffer inBuffer, int inWidth, int inHeight, int inFormat) {
|
||||
@ -29,9 +28,7 @@ public class BufferedCairoImage extends CairoImage {
|
||||
}
|
||||
|
||||
private void freeBuffer() {
|
||||
if (mNeedToFreeBuffer)
|
||||
DirectBufferAllocator.free(mBuffer);
|
||||
mNeedToFreeBuffer = false;
|
||||
DirectBufferAllocator.free(mBuffer);
|
||||
mBuffer = null;
|
||||
}
|
||||
|
||||
@ -61,7 +58,6 @@ public class BufferedCairoImage extends CairoImage {
|
||||
public void setBitmap(Bitmap bitmap) {
|
||||
mFormat = CairoUtils.bitmapConfigToCairoFormat(bitmap.getConfig());
|
||||
mSize = new IntSize(bitmap.getWidth(), bitmap.getHeight());
|
||||
mNeedToFreeBuffer = true;
|
||||
|
||||
int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat);
|
||||
mBuffer = DirectBufferAllocator.allocate(mSize.getArea() * bpp);
|
||||
|
Loading…
Reference in New Issue
Block a user