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

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp

Issue 10377150: Merge 116587 - [chromium] Don't draw when canDraw() is false (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 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
Index: Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (revision 117086)
+++ Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (working copy)
@@ -325,8 +325,14 @@
DebugScopedSetImplThread impl;
double monotonicTime = monotonicallyIncreasingTime();
double wallClockTime = currentTime();
+ m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
- m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
+ // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
+ // be used when such a frame is possible. Since drawLayers() depends on the result of
+ // prepareToDraw(), it is guarded on canDraw() as well.
+ if (!m_layerTreeHostImpl->canDraw())
+ return false;
+
CCLayerTreeHostImpl::FrameData frame;
m_layerTreeHostImpl->prepareToDraw(frame);
m_layerTreeHostImpl->drawLayers(frame);

Powered by Google App Engine
This is Rietveld 408576698