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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2961633002: cc: HUD handle context lost in Gpu raster.
Patch Set: update comments. Created 3 years, 5 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/layers/heads_up_display_layer_impl.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63d133c3dd69c015a3479480068f48a8c8dfd139..e320a2c64c187ca46026ef6846fb015c3d740081 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1720,15 +1720,20 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
}
const DrawMode draw_mode = GetDrawMode();
+ ResourceId evict_resource_id = 0U;
// 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_resource_id = active_tree_->hud_layer()->UpdateHudTexture(
draw_mode, resource_provider_.get(),
layer_tree_frame_sink_->context_provider());
+ if (evict_resource_id != 0)
+ active_tree_->hud_layer()->EvictHudQuad(frame->render_passes);
}
CompositorFrameMetadata metadata = MakeCompositorFrameMetadata();
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698