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

Unified Diff: content/shell/renderer/test_runner/WebTestProxy.cpp

Issue 274253002: Make WebTestProxy handle printing + compositing mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/WebTestProxy.cpp
diff --git a/content/shell/renderer/test_runner/WebTestProxy.cpp b/content/shell/renderer/test_runner/WebTestProxy.cpp
index 1a85a23b2410dd473717fe5ffa159fb858939355..1085be8b2bb691fac6f4485df0adb3a421c911eb 100644
--- a/content/shell/renderer/test_runner/WebTestProxy.cpp
+++ b/content/shell/renderer/test_runner/WebTestProxy.cpp
@@ -499,6 +499,18 @@ void WebTestProxyBase::CapturePixelsAsync(
DCHECK(webWidget()->isAcceleratedCompositingActive());
DCHECK(!callback.is_null());
+
+ if (m_testInterfaces->testRunner()->isPrinting()) {
+ // TODO(enne): get rid of stateful canvas().
+ webWidget()->layout();
+ paintPagesWithBoundaries();
+ DrawSelectionRect(canvas());
+ SkBaseDevice* device = skia::GetTopDevice(*canvas());
+ const SkBitmap& bitmap = device->accessBitmap(false);
+ callback.Run(bitmap);
danakj 2014/05/09 21:17:21 do you wanna post-task this to keep it async? othe
enne (OOO) 2014/05/09 21:25:06 It's a nice thought, but it seems awkward to do wi
danakj 2014/05/09 21:37:25 I figured the test harness shouldn't be doing anyt
enne (OOO) 2014/05/09 22:03:20 Done.
+ return;
+ }
+
m_compositeAndReadbackCallbacks.push_back(callback);
webWidget()->compositeAndReadbackAsync(this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698