Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: ui/gfx/android/java_bitmap.cc

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gfx/codec/jpeg_codec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/android/java_bitmap.cc
diff --git a/ui/gfx/android/java_bitmap.cc b/ui/gfx/android/java_bitmap.cc
index a5b891a4af790f97e9702e688b9adf6163d9ea7d..7512b4222b1a103c29bcb65ddc0eb42932d4b860 100644
--- a/ui/gfx/android/java_bitmap.cc
+++ b/ui/gfx/android/java_bitmap.cc
@@ -107,15 +107,12 @@ SkBitmap CreateSkBitmapFromJavaBitmap(const JavaBitmap& jbitmap) {
gfx::Size src_size = jbitmap.size();
SkBitmap skbitmap;
- skbitmap.setConfig(SkBitmap::kARGB_8888_Config,
- src_size.width(),
- src_size.height(),
- jbitmap.stride());
- if (!skbitmap.allocPixels()) {
+ if (!skbitmap.allocPixels(SkImageInfo::MakeN32Premul(src_size.width(),
+ src_size.height()),
+ jbitmap.stride())) {
LOG(FATAL) << " Failed to allocate bitmap of size " << src_size.width()
<< "x" << src_size.height() << " stride=" << jbitmap.stride();
}
- SkAutoLockPixels dst_lock(skbitmap);
const void* src_pixels = jbitmap.pixels();
void* dst_pixels = skbitmap.getPixels();
memcpy(dst_pixels, src_pixels, skbitmap.getSize());
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gfx/codec/jpeg_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698