Chromium Code Reviews| 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..32d3d0ee6b0d6442bfad89f19465b893a6ece68d 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(), (int) skbitmap.getSize()); |
|
jdduke (slow)
2015/05/11 22:14:49
nit: static_cast<int>
Jaekyun Seok (inactive)
2015/05/11 23:07:24
Done.
|
| const void* src_pixels = jbitmap.pixels(); |
| void* dst_pixels = skbitmap.getPixels(); |
| memcpy(dst_pixels, src_pixels, skbitmap.getSize()); |