Kaydet (Commit) 5957f5d0 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

LOAndroid3: Allocate buffer of correct size in "BufferedCairoImage"

Change-Id: I7d70a90508d5a77234c670d6938c295321c08296
üst 25ad5279
...@@ -76,7 +76,7 @@ public class BufferedCairoImage extends CairoImage { ...@@ -76,7 +76,7 @@ public class BufferedCairoImage extends CairoImage {
mFormat = CairoUtils.bitmapConfigToCairoFormat(bitmap.getConfig()); mFormat = CairoUtils.bitmapConfigToCairoFormat(bitmap.getConfig());
mSize = new IntSize(bitmap.getWidth(), bitmap.getHeight()); mSize = new IntSize(bitmap.getWidth(), bitmap.getHeight());
int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat); int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat) / 8;
mBuffer = DirectBufferAllocator.allocate(mSize.getArea() * bpp); mBuffer = DirectBufferAllocator.allocate(mSize.getArea() * bpp);
bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer()); bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer());
} }
......
...@@ -81,6 +81,7 @@ public abstract class TileLayer extends Layer { ...@@ -81,6 +81,7 @@ public abstract class TileLayer extends Layer {
if (mTextureIDs != null) { if (mTextureIDs != null) {
TextureReaper.get().add(mTextureIDs); TextureReaper.get().add(mTextureIDs);
} }
mImage.destroy();
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment