diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-08 21:31:56 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-10 11:17:56 +0200 |
commit | 5957f5d02d5b20651e65e8518846082db7f7103c (patch) | |
tree | 65f9a85c8514259077604234e095002d7f7184f7 | |
parent | 25ad527972ce3fcb86b6b5b03789e1b7b5568a45 (diff) |
LOAndroid3: Allocate buffer of correct size in "BufferedCairoImage"
Change-Id: I7d70a90508d5a77234c670d6938c295321c08296
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java | 2 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java index ce836fe07e8f..de431d70d8ab 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java @@ -76,7 +76,7 @@ public class BufferedCairoImage extends CairoImage { mFormat = CairoUtils.bitmapConfigToCairoFormat(bitmap.getConfig()); mSize = new IntSize(bitmap.getWidth(), bitmap.getHeight()); - int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat); + int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat) / 8; mBuffer = DirectBufferAllocator.allocate(mSize.getArea() * bpp); bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer()); } diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java index 31c1b6d992da..ccb50adc69aa 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java @@ -81,6 +81,7 @@ public abstract class TileLayer extends Layer { if (mTextureIDs != null) { TextureReaper.get().add(mTextureIDs); } + mImage.destroy(); } /** |