diff options
author | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 18:59:22 +0000 |
---|---|---|
committer | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 18:59:22 +0000 |
commit | b9471f847796ea07f4a5b3464502c51c2d48cc3f (patch) | |
tree | 6ebf50edea23f931fe0582fcef04c77061e685d3 /chrome/browser/extensions/extension_tabs_module.cc | |
parent | 76b3af422d58822e17523064aca0a3de116a3457 (diff) | |
download | chromium_src-b9471f847796ea07f4a5b3464502c51c2d48cc3f.zip chromium_src-b9471f847796ea07f4a5b3464502c51c2d48cc3f.tar.gz chromium_src-b9471f847796ea07f4a5b3464502c51c2d48cc3f.tar.bz2 |
Re-implement BackingStore on the Mac as a CGLayer instead of a Skia canvas,
to get better performance. As a side effect, remove the ugly stopgap scrolling code. Do not close 14823 with this fix, but it should help (primary motivation was improving the plugin drawing path).
Paul: review
rafael: please check the change to extension_tabs_module.cc
John, Rohit: FYI, comments welcome
BUG=14823,
TEST=scrolling and plugin performance should improve
Review URL: http://codereview.chromium.org/171054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_tabs_module.cc')
-rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 4d96a4f..73154ac 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -667,8 +667,23 @@ bool CaptureVisibleTabFunction::RunImpl() { screen_capture = temp_canvas.getTopPlatformDevice().accessBitmap(false); #elif defined(OS_MACOSX) - screen_capture = backing_store->canvas()->getTopPlatformDevice() - .accessBitmap(false); + skia::PlatformCanvas temp_canvas; + if (!temp_canvas.initialize(backing_store->size().width(), + backing_store->size().height(), true)) { + error_ = ExtensionErrorUtils::FormatErrorMessage( + keys::kInternalVisibleTabCaptureError, ""); + return false; + } + CGContextRef temp_context = temp_canvas.beginPlatformPaint(); + CGContextSaveGState(temp_context); + CGContextTranslateCTM(temp_context, 0.0, backing_store->size().height()); + CGContextScaleCTM(temp_context, 1.0, -1.0); + CGContextDrawLayerAtPoint(temp_context, CGPointMake(0.0, 0.0), + backing_store->cg_layer()); + CGContextRestoreGState(temp_context); + temp_canvas.endPlatformPaint(); + + screen_capture = temp_canvas.getTopPlatformDevice().accessBitmap(false); #elif defined(OS_LINUX) screen_capture = backing_store->PaintRectToBitmap( gfx::Rect(0, 0, backing_store->size().width(), |