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

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

Issue 270463003: Don't use return value of compositeAndReadbackAsync so it can be void. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: void: 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 e35e4de06d4f779f23635754135f0334d8ee69cd..8a30f274bf10374b0f32cc2b27bb2f27ec9f7007 100644
--- a/content/shell/renderer/test_runner/WebTestProxy.cpp
+++ b/content/shell/renderer/test_runner/WebTestProxy.cpp
@@ -488,24 +488,30 @@ void WebTestProxyBase::didCompositeAndReadback(const SkBitmap& bitmap) {
bitmap.info().fHeight);
SkCanvas canvas(bitmap);
DrawSelectionRect(&canvas);
+ DCHECK(!m_compositeAndReadbackCallback.is_null());
base::ResetAndReturn(&m_compositeAndReadbackCallback).Run(bitmap);
}
void WebTestProxyBase::CapturePixelsAsync(
base::Callback<void(const SkBitmap&)> callback) {
- m_compositeAndReadbackCallback = callback;
TRACE_EVENT0("shell", "WebTestProxyBase::CapturePixelsAsync");
// Do a layout here because it might leave compositing mode! x.x
// TODO(danakj): Remove this when we have kForceCompositingMode everywhere.
webWidget()->layout();
- if (!webWidget()->compositeAndReadbackAsync(this)) {
+ if (!webWidget()->isAcceleratedCompositingActive()) {
TRACE_EVENT0("shell",
"WebTestProxyBase::CapturePixelsAsync "
- "compositeAndReadbackAsync failed");
- didCompositeAndReadback(SkBitmap());
+ "isAcceleratedCompositingActive false");
+ callback.Run(SkBitmap());
+ return;
}
+
+ DCHECK(!callback.is_null());
+ DCHECK(m_compositeAndReadbackCallback.is_null());
+ m_compositeAndReadbackCallback = callback;
+ webWidget()->compositeAndReadbackAsync(this);
}
void WebTestProxyBase::setLogConsoleOutput(bool enabled)
« 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