| Index: ui/gfx/android/java_bitmap.cc
|
| diff --git a/ui/gfx/android/java_bitmap.cc b/ui/gfx/android/java_bitmap.cc
|
| index 37da9d98aaf67e231d739460038564a29f317a09..ea0a50fe6a927e133d71336bbcfbe2274cda9d3a 100644
|
| --- a/ui/gfx/android/java_bitmap.cc
|
| +++ b/ui/gfx/android/java_bitmap.cc
|
| @@ -29,6 +29,7 @@ JavaBitmap::JavaBitmap(jobject bitmap)
|
| size_ = gfx::Size(info.width, info.height);
|
| format_ = info.format;
|
| stride_ = info.stride;
|
| + byte_count_ = Java_BitmapHelper_getByteCount(AttachCurrentThread(), bitmap_);
|
| }
|
|
|
| JavaBitmap::~JavaBitmap() {
|
| @@ -108,6 +109,7 @@ SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap) {
|
| CHECK(false) << "Invalid Java bitmap format: " << jbitmap.format();
|
| break;
|
| }
|
| + CHECK_EQ(jbitmap.byte_count(), static_cast<int>(skbitmap.getSize()));
|
| const void* src_pixels = jbitmap.pixels();
|
| void* dst_pixels = skbitmap.getPixels();
|
| memcpy(dst_pixels, src_pixels, skbitmap.getSize());
|
|
|