Index: cc/trees/layer_tree_host_unittest.cc |
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc |
index 5737b420e74ed1dbca0da4e773b787bdd67d4b5c..796508184be345b40c04feb0ac5438dfc60d1dba 100644 |
--- a/cc/trees/layer_tree_host_unittest.cc |
+++ b/cc/trees/layer_tree_host_unittest.cc |
@@ -285,10 +285,11 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { |
PostSetNeedsCommitToMainThread(); |
} |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
- EXPECT_TRUE(result); |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result); |
gfx::RectF root_damage_rect; |
if (!frame_data->render_passes.empty()) |
@@ -302,7 +303,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { |
EXPECT_TRUE(root_damage_rect.Contains(invalid_rect_)); |
} |
- return result; |
+ return draw_result; |
} |
virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
@@ -516,9 +517,10 @@ class LayerTreeHostTestCompositeAndReadbackDuringForcedDraw |
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
int sfn = host_impl->active_tree()->source_frame_number(); |
EXPECT_TRUE(sfn == kFirstCommitSourceFrameNumber || |
sfn == kReadbackSourceFrameNumber || |
@@ -533,7 +535,7 @@ class LayerTreeHostTestCompositeAndReadbackDuringForcedDraw |
} |
// Returning false will result in a forced draw. |
danakj
2014/01/29 21:56:29
"false"
enne (OOO)
2014/01/29 23:09:23
Done.
|
- return false; |
+ return DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; |
} |
virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
@@ -576,9 +578,10 @@ class LayerTreeHostTestCompositeAndReadbackAfterForcedDraw |
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
int sfn = host_impl->active_tree()->source_frame_number(); |
EXPECT_TRUE(sfn == kFirstCommitSourceFrameNumber || |
sfn == kForcedDrawSourceFrameNumber || |
@@ -587,7 +590,7 @@ class LayerTreeHostTestCompositeAndReadbackAfterForcedDraw |
<< sfn; |
// Returning false will result in a forced draw. |
danakj
2014/01/29 21:56:29
"false"
enne (OOO)
2014/01/29 23:09:23
Done.
|
- return false; |
+ return DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; |
} |
virtual void DidCommit() OVERRIDE { |
@@ -652,10 +655,11 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { |
host_impl->SetNeedsRedrawRect(invalid_rect_); |
} |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
- EXPECT_TRUE(result); |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result); |
gfx::RectF root_damage_rect; |
if (!frame_data->render_passes.empty()) |
@@ -679,7 +683,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { |
NOTREACHED(); |
} |
- return result; |
+ return draw_result; |
} |
virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
@@ -749,10 +753,11 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { |
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
- EXPECT_TRUE(result); |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result); |
gfx::RectF root_damage_rect; |
if (!frame_data->render_passes.empty()) |
@@ -776,7 +781,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { |
NOTREACHED(); |
} |
- return result; |
+ return draw_result; |
} |
virtual void DidCommitAndDrawFrame() OVERRIDE { |
@@ -2584,11 +2589,12 @@ class LayerTreeHostTestBeginImplFrameNotification : public LayerTreeHostTest { |
PostSetNeedsCommitToMainThread(); |
} |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame, |
- bool result) OVERRIDE { |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
EndTest(); |
- return true; |
+ return DrawSwapReadbackResult::DRAW_SUCCESS; |
danakj
2014/01/29 21:56:29
nit: return draw_result?
(was long-standing wish
enne (OOO)
2014/01/29 23:09:23
Done.
|
} |
virtual void AfterTest() OVERRIDE {} |
@@ -2871,9 +2877,10 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { |
EXPECT_CALL(*mock_context_, bindTexture(_, 0)).Times(AnyNumber()); |
} |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame, |
- bool result) OVERRIDE { |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
Mock::VerifyAndClearExpectations(&mock_context_); |
// The io surface layer's texture is drawn. |
@@ -2883,7 +2890,7 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { |
EXPECT_CALL(*mock_context_, drawElements(GL_TRIANGLES, 6, _, _)) |
.Times(AtLeast(1)); |
- return result; |
+ return draw_result; |
} |
virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
@@ -4127,9 +4134,10 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { |
PostSetNeedsCommitToMainThread(); |
} |
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
- LayerTreeHostImpl::FrameData* frame_data, |
- bool result) OVERRIDE { |
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( |
+ LayerTreeHostImpl* host_impl, |
+ LayerTreeHostImpl::FrameData* frame_data, |
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { |
++num_commits_; |
switch (num_commits_) { |
case 1: |
@@ -4155,7 +4163,7 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { |
break; |
} |
return LayerTreeHostTest::PrepareToDrawOnThread( |
- host_impl, frame_data, result); |
+ host_impl, frame_data, draw_result); |
} |
virtual void AfterTest() OVERRIDE { EXPECT_EQ(3, num_commits_); } |