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

Unified Diff: chrome/browser/thumbnails/thumbnail_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/thumbnails/thumbnail_tab_helper.cc
===================================================================
--- chrome/browser/thumbnails/thumbnail_tab_helper.cc (revision 160846)
+++ chrome/browser/thumbnails/thumbnail_tab_helper.cc (working copy)
@@ -404,7 +404,7 @@
gfx::Size(kThumbnailWidth, kThumbnailHeight),
&clip_result);
gfx::Size copy_size = GetCopySizeForThumbnail(view);
- skia::PlatformCanvas* temp_canvas = new skia::PlatformCanvas;
+ skia::PlatformBitmap* temp_bitmap = new skia::PlatformBitmap;
render_widget_host->CopyFromBackingStore(
copy_rect,
copy_size,
@@ -412,8 +412,8 @@
weak_factory_.GetWeakPtr(),
web_contents,
clip_result,
- base::Owned(temp_canvas)),
- temp_canvas);
+ base::Owned(temp_bitmap)),
+ temp_bitmap);
}
void ThumbnailTabHelper::UpdateThumbnailWithBitmap(
@@ -433,13 +433,13 @@
void ThumbnailTabHelper::UpdateThumbnailWithCanvas(
WebContents* web_contents,
ClipResult clip_result,
- skia::PlatformCanvas* temp_canvas,
+ skia::PlatformBitmap* temp_bitmap,
bool succeeded) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (!succeeded)
return;
- SkBitmap bitmap = skia::GetTopDevice(*temp_canvas)->accessBitmap(false);
+ SkBitmap bitmap = temp_bitmap->GetBitmap();
UpdateThumbnailWithBitmap(web_contents, clip_result, bitmap);
}

Powered by Google App Engine
This is Rietveld 408576698