Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 67f5b43ffdcf902a5bc7130b96263076854c8dfc..5faf88a3b05ff5e0c3490c1295856b3359b92d5b 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1701,13 +1701,16 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) { |
| } |
| const DrawMode draw_mode = GetDrawMode(); |
| + uint32_t evict_res_id = 0U; |
|
vmpstr
2017/06/30 23:16:51
ResourceId? also evict_resource_id.
sohan
2017/07/04 16:51:13
Done.
|
| // Because the contents of the HUD depend on everything else in the frame, the |
| // contents of its texture are updated as the last thing before the frame is |
| // drawn. |
| if (active_tree_->hud_layer()) { |
| TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); |
| - active_tree_->hud_layer()->UpdateHudTexture( |
| + // For Ganesh backed HUD, a context loss may cause the drawing canvas to be |
| + // invalid, return the resource id to evicted from quadlist. |
| + evict_res_id = active_tree_->hud_layer()->UpdateHudTexture( |
| draw_mode, resource_provider_.get(), |
| layer_tree_frame_sink_->context_provider()); |
| } |
| @@ -1734,8 +1737,11 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) { |
| ResourceProvider::ResourceIdArray resources; |
| for (const auto& render_pass : frame->render_passes) { |
| for (auto* quad : render_pass->quad_list) { |
| - for (ResourceId resource_id : quad->resources) |
| - resources.push_back(resource_id); |
| + for (ResourceId resource_id : quad->resources) { |
| + if (resource_id != evict_res_id) { |
|
vmpstr
2017/06/30 23:16:51
This doesn't look right.
The resource should not
sohan
2017/07/04 16:51:13
Yeah this is kinda odd.
The problem is for HUD lay
|
| + resources.push_back(resource_id); |
| + } |
| + } |
| } |
| } |