cc: HUD handle context lost in Gpu raster.
This returns the resource id in case the HUD canvas
is invalid, because of context loss while SkSurface
creation. The resource is subsequently evicted from
quad list.
BUG=736127
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
patch from issue 2961633002 at patchset 160001 (http://crrev.com/2961633002#ps160001)
Change-Id: I8d04dfed24ec9cd7e2b520d20988b7a70efcacc3
Reviewed-on: https://chromium-review.googlesource.com/571821
Reviewed-by: Eric Karl <[email protected]>
Reviewed-by: Vladimir Levin <[email protected]>
Reviewed-by: Sohan Jyoti Ghosh <[email protected]>
Commit-Queue: Sohan Jyoti Ghosh <[email protected]>
Cr-Commit-Position: refs/heads/master@{#488827}
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 6ad84922..bb611ac5 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1003,6 +1003,11 @@
DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
DrawResult draw_result) override {
+ if (host_impl->active_tree()->source_frame_number() == 2) {
+ // Lose the context after draw on the second commit. This will cause
+ // a third commit to recover.
+ context3d_->set_times_bind_texture_succeeds(0);
+ }
return draw_result;
}
@@ -1018,13 +1023,6 @@
void DidCommitAndDrawFrame() override {
ASSERT_TRUE(layer_tree_host()->hud_layer());
-
- if (layer_tree_host()->SourceFrameNumber() == 2) {
- // Lose the context after draw on the second commit. This will cause
- // a third commit to recover.
- context3d_->set_times_bind_texture_succeeds(0);
- }
-
// End the test once we know the 3nd frame drew.
if (layer_tree_host()->SourceFrameNumber() < 5) {
layer_tree_host()->root_layer()->SetNeedsDisplay();