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

Unified Diff: chrome/browser/prerender/prerender_tab_helper.cc

Issue 11031055: Introduce PlatformBitmap, which is a minimal helper class that wraps an SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
Index: chrome/browser/prerender/prerender_tab_helper.cc
===================================================================
--- chrome/browser/prerender/prerender_tab_helper.cc (revision 160846)
+++ chrome/browser/prerender/prerender_tab_helper.cc (working copy)
@@ -55,7 +55,7 @@
return;
}
- skia::PlatformCanvas* temp_canvas = new skia::PlatformCanvas;
+ skia::PlatformBitmap* temp_bitmap = new skia::PlatformBitmap;
web_contents->GetRenderViewHost()->CopyFromBackingStore(
gfx::Rect(),
gfx::Size(),
@@ -63,19 +63,18 @@
weak_factory_.GetWeakPtr(),
bitmap_type,
web_contents,
- base::Owned(temp_canvas)),
- temp_canvas);
+ base::Owned(temp_bitmap)),
+ temp_bitmap);
}
private:
void HandleBitmapResult(BitmapType bitmap_type,
WebContents* web_contents,
- skia::PlatformCanvas* temp_canvas,
+ skia::PlatformBitmap* temp_bitmap,
bool succeeded) {
scoped_ptr<SkBitmap> bitmap;
if (succeeded) {
- const SkBitmap& canvas_bitmap =
- skia::GetTopDevice(*temp_canvas)->accessBitmap(false);
+ const SkBitmap& canvas_bitmap = temp_bitmap->GetBitmap();
bitmap.reset(new SkBitmap());
canvas_bitmap.copyTo(bitmap.get(), SkBitmap::kARGB_8888_Config);
}

Powered by Google App Engine
This is Rietveld 408576698