summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi
diff options
context:
space:
mode:
authorelijahtaylor@google.com <elijahtaylor@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 18:11:44 +0000
committerelijahtaylor@google.com <elijahtaylor@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 18:11:44 +0000
commit330e4c4144a830919165a02b3c371ccc2e9dd26e (patch)
treefff6b0a3a7a3e5489dc577ff68eb0882d02b2f2c /webkit/plugins/ppapi
parentc279e5e3524f8f052a5285338d8fdfedecaa89c4 (diff)
downloadchromium_src-330e4c4144a830919165a02b3c371ccc2e9dd26e.zip
chromium_src-330e4c4144a830919165a02b3c371ccc2e9dd26e.tar.gz
chromium_src-330e4c4144a830919165a02b3c371ccc2e9dd26e.tar.bz2
Fix resource icons not writing to shared memory correctly.
BUG=none TEST=manual Review URL: http://codereview.chromium.org/6975063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi')
-rw-r--r--webkit/plugins/ppapi/ppb_pdf_impl.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/webkit/plugins/ppapi/ppb_pdf_impl.cc b/webkit/plugins/ppapi/ppb_pdf_impl.cc
index 3453a43..07ddc7d 100644
--- a/webkit/plugins/ppapi/ppb_pdf_impl.cc
+++ b/webkit/plugins/ppapi/ppb_pdf_impl.cc
@@ -157,11 +157,9 @@ PP_Resource GetResourceImage(PP_Instance instance_id,
return 0;
skia::PlatformCanvas* canvas = image_data->mapped_canvas();
- SkBitmap& ret_bitmap =
- const_cast<SkBitmap&>(skia::GetTopDevice(*canvas)->accessBitmap(true));
- if (!res_bitmap->copyTo(&ret_bitmap, SkBitmap::kARGB_8888_Config, NULL)) {
- return 0;
- }
+ // Note: Do not grab the bitmap directly using accessBitmap, many operations
+ // that write to skBitmaps overwrite the allocated pixels in shared memory.
+ skia::GetTopDevice(*canvas)->writePixels(*res_bitmap, 0, 0);
return image_data->GetReference();
}