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

Unified Diff: content/shell/renderer/webkit_test_runner.cc

Issue 272683003: Make compositing mode sticky when RenderView is reused in LayoutTests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sticky: rebase Created 6 years, 7 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 | « content/shell/renderer/test_runner/WebTestProxy.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/webkit_test_runner.cc
diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc
index 67596c0350725830a25eb7209f23aa3edddb12cd..8ef19674007a890bb9e447cb30666fdb8a06cbe5 100644
--- a/content/shell/renderer/webkit_test_runner.cc
+++ b/content/shell/renderer/webkit_test_runner.cc
@@ -648,8 +648,15 @@ void WebKitTestRunner::CaptureDump() {
if (test_config_.enable_pixel_dumping &&
interfaces->testRunner()->shouldGeneratePixelResults()) {
- proxy()->CapturePixelsAsync(base::Bind(
- &WebKitTestRunner::CaptureDumpPixels, base::Unretained(this)));
+ // TODO(danakj): Remove when kForceCompositingMode is everywhere.
+ if (!render_view()->GetWebView()->isAcceleratedCompositingActive()) {
+ SkBitmap snapshot;
+ CopyCanvasToBitmap(proxy()->capturePixels(), &snapshot);
+ CaptureDumpPixels(snapshot);
+ } else {
+ proxy()->CapturePixelsAsync(base::Bind(
+ &WebKitTestRunner::CaptureDumpPixels, base::Unretained(this)));
+ }
return;
}
}
@@ -657,19 +664,7 @@ void WebKitTestRunner::CaptureDump() {
CaptureDumpComplete();
}
-void WebKitTestRunner::CaptureDumpPixels(const SkBitmap& compositor_snapshot) {
- SkBitmap snapshot = compositor_snapshot;
-
- CommandLine* cmd = CommandLine::ForCurrentProcess();
- if (!cmd->HasSwitch(switches::kForceCompositingMode) &&
- !cmd->HasSwitch(switches::kEnableThreadedCompositing)) {
- // If the readback fails because we're not in compositing mode, do a
- // synchronous software readback here. This can go away when we have FCM
- // always.
- if (!snapshot.info().fWidth || !snapshot.info().fHeight)
- CopyCanvasToBitmap(proxy()->capturePixels(), &snapshot);
- }
-
+void WebKitTestRunner::CaptureDumpPixels(const SkBitmap& snapshot) {
DCHECK_NE(0, snapshot.info().fWidth);
DCHECK_NE(0, snapshot.info().fHeight);
« no previous file with comments | « content/shell/renderer/test_runner/WebTestProxy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698