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

Unified Diff: cc/trees/thread_proxy.cc

Issue 131683005: cc: Make PrepareToDraw return an enum for why it aborts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wrapping... Created 6 years, 11 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 | « cc/trees/layer_tree_host_unittest_video.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 15a15216e532f947691364dadd0baebf9e092421..5aa35337664b8d96a0291d7e212f479ee83f0a65 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -1110,17 +1110,9 @@ DrawSwapReadbackResult ThreadProxy::DrawSwapReadbackInternal(
bool readback_requested) {
TRACE_EVENT_SYNTHETIC_DELAY("cc.DrawAndSwap");
DrawSwapReadbackResult result;
- result.did_draw = false;
- result.did_swap = false;
- result.did_readback = false;
+
DCHECK(IsImplThread());
DCHECK(impl().layer_tree_host_impl.get());
- if (!impl().layer_tree_host_impl)
- return result;
-
- DCHECK(impl().layer_tree_host_impl->renderer());
- if (!impl().layer_tree_host_impl->renderer())
- return result;
base::TimeTicks start_time = base::TimeTicks::HighResNow();
base::TimeDelta draw_duration_estimate = DrawDurationEstimate();
@@ -1161,15 +1153,18 @@ DrawSwapReadbackResult ThreadProxy::DrawSwapReadbackInternal(
if (drawing_for_readback)
readback_rect = impl().readback_request->rect;
- if (impl().layer_tree_host_impl->PrepareToDraw(&frame, readback_rect) ||
- forced_draw)
- draw_frame = true;
+ result.draw_result =
+ impl().layer_tree_host_impl->PrepareToDraw(&frame, readback_rect);
+ draw_frame = forced_draw ||
+ result.draw_result == DrawSwapReadbackResult::DRAW_SUCCESS;
}
if (draw_frame) {
impl().layer_tree_host_impl->DrawLayers(
&frame, impl().scheduler->LastBeginImplFrameTime());
- result.did_draw = true;
+ result.draw_result = DrawSwapReadbackResult::DRAW_SUCCESS;
+ } else {
+ DCHECK_NE(DrawSwapReadbackResult::DRAW_SUCCESS, result.draw_result);
}
impl().layer_tree_host_impl->DidDrawAllLayers(frame);
« no previous file with comments | « cc/trees/layer_tree_host_unittest_video.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698