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

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
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_tab_helper.h ('k') | content/browser/renderer_host/backing_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/thumbnails/thumbnail_tab_helper.cc
===================================================================
--- chrome/browser/thumbnails/thumbnail_tab_helper.cc (revision 161107)
+++ chrome/browser/thumbnails/thumbnail_tab_helper.cc (working copy)
@@ -406,7 +406,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,
@@ -414,8 +414,8 @@
weak_factory_.GetWeakPtr(),
web_contents,
clip_result,
- base::Owned(temp_canvas)),
- temp_canvas);
+ base::Owned(temp_bitmap)),
+ temp_bitmap);
}
void ThumbnailTabHelper::UpdateThumbnailWithBitmap(
@@ -435,13 +435,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);
}
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_tab_helper.h ('k') | content/browser/renderer_host/backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698