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

Unified Diff: chrome/browser/thumbnails/thumbnail_tab_helper.cc

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: REBASE Created 3 years, 10 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
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
index bfc5005ee5412ccaaee552edd09b82a2e892d662..b710d4ccf4459fd5096a81deefa6cc8992d38091 100644
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
@@ -150,6 +150,9 @@ void ThumbnailTabHelper::AsyncProcessThumbnail(
return;
}
+ // TODO(miu): This is the wrong size. It's the size of the view on-screen, and
+ // not the rendering size of the view. This will be replaced with the view's
+ // actual rendering size in a later change. http://crbug.com/73362
gfx::Rect copy_rect = gfx::Rect(view->GetViewBounds().size());
// Clip the pixels that will commonly hold a scrollbar, which looks bad in
// thumbnails.
@@ -175,13 +178,10 @@ void ThumbnailTabHelper::AsyncProcessThumbnail(
scale_factor,
&copy_rect,
&thumbnailing_context_->requested_copy_size);
- render_widget_host->CopyFromBackingStore(
- copy_rect,
- thumbnailing_context_->requested_copy_size,
- base::Bind(&ThumbnailTabHelper::ProcessCapturedBitmap,
- weak_factory_.GetWeakPtr(),
- algorithm),
- kN32_SkColorType);
+ view->CopyFromSurface(copy_rect, thumbnailing_context_->requested_copy_size,
+ base::Bind(&ThumbnailTabHelper::ProcessCapturedBitmap,
+ weak_factory_.GetWeakPtr(), algorithm),
+ kN32_SkColorType);
}
void ThumbnailTabHelper::ProcessCapturedBitmap(

Powered by Google App Engine
This is Rietveld 408576698