summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 09:29:36 +0000
committermazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 09:29:36 +0000
commitca2fd075cf4eaeb2ee650affff606bbb3120772c (patch)
tree4cb40434aa433d9e30bba39e103b4ec8b59c4f59 /chrome
parent0c652b8e854aad1f44751449e7029f432f4502fe (diff)
downloadchromium_src-ca2fd075cf4eaeb2ee650affff606bbb3120772c.zip
chromium_src-ca2fd075cf4eaeb2ee650affff606bbb3120772c.tar.gz
chromium_src-ca2fd075cf4eaeb2ee650affff606bbb3120772c.tar.bz2
Support browser side thumbnailing for GPU-composited pages on Windows.
Benchmark results of copying a 1280 x 800 pixels using CopyFromCompositingSurface or CopyFromBackingSurface are as follows. FromCompositingSurface: 40.00 ms FromBackingStore: 2.12 ms I'm prepareing the following CLs and these will come soon, - Support Mac and Chrome OS (Aura) - Reduce the number of pixels to copy from the compositing surface for performance improvement BUG=96351 TEST=Manual Review URL: http://codereview.chromium.org/9582003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/aeropeek_manager.cc2
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc2
-rw-r--r--chrome/browser/tab_contents/thumbnail_generator.cc3
3 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc
index 77360cf..8c65ecb 100644
--- a/chrome/browser/aeropeek_manager.cc
+++ b/chrome/browser/aeropeek_manager.cc
@@ -998,7 +998,7 @@ bool AeroPeekManager::GetTabPreview(int tab_id, SkBitmap* preview) {
// Create a copy of this BackingStore image.
// This code is just copied from "thumbnail_generator.cc".
skia::PlatformCanvas canvas;
- if (!render_view_host->CopyFromBackingStore(&canvas))
+ if (!render_view_host->CopyFromBackingStore(gfx::Size(), &canvas))
return false;
const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false);
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index dbf198b..67d5916 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -1653,7 +1653,7 @@ bool CaptureVisibleTabFunction::RunImpl() {
// For example, some uncommon X11 visual modes are not supported by
// CopyFromBackingStore().
skia::PlatformCanvas temp_canvas;
- if (render_view_host->CopyFromBackingStore(&temp_canvas)) {
+ if (render_view_host->CopyFromBackingStore(gfx::Size(), &temp_canvas)) {
VLOG(1) << "captureVisibleTab() got image from backing store.";
SendResultFromBitmap(skia::GetTopDevice(temp_canvas)->accessBitmap(false));
return true;
diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc
index 79d8f10..398c2af 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -77,8 +77,9 @@ SkBitmap GetBitmapForRenderWidgetHost(
// Get the bitmap as a Skia object so we can resample it. This is a large
// allocation and we can tolerate failure here, so give up if the allocation
// fails.
+ // TODO(mazda): Copy a shrinked size of image instead of the whole view size.
skia::PlatformCanvas temp_canvas;
- if (!render_widget_host->CopyFromBackingStore(&temp_canvas))
+ if (!render_widget_host->CopyFromBackingStore(gfx::Size(), &temp_canvas))
return result;
const SkBitmap& bmp_with_scrollbars =
skia::GetTopDevice(temp_canvas)->accessBitmap(false);