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

Unified Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 2961633002: cc: HUD handle context lost in Gpu raster.
Patch Set: update Created 3 years, 6 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
Index: cc/layers/heads_up_display_layer_impl.cc
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 0050c8e67fe8c74a3bee3f1379cd6d7a4d687ee4..a5ee527b65b158d649cad5e871adfa54f3ce7039 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -77,8 +77,7 @@ HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl,
internal_contents_scale_(1.f),
fps_graph_(60.0, 80.0),
paint_time_graph_(16.0, 48.0),
- fade_step_(0) {
-}
+ fade_step_(0) {}
HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {}
@@ -158,12 +157,12 @@ void HeadsUpDisplayLayerImpl::AppendQuads(
ValidateQuadResources(quad);
}
-void HeadsUpDisplayLayerImpl::UpdateHudTexture(
+uint32_t HeadsUpDisplayLayerImpl::UpdateHudTexture(
vmpstr 2017/06/30 23:16:51 The actual return type is ResourceId (even though
sohan 2017/07/04 16:51:13 Done.
DrawMode draw_mode,
ResourceProvider* resource_provider,
ContextProvider* context_provider) {
if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id())
- return;
+ return 0U;
if (context_provider) {
gpu::gles2::GLES2Interface* gl = context_provider->ContextGL();
@@ -180,6 +179,8 @@ void HeadsUpDisplayLayerImpl::UpdateHudTexture(
ResourceProvider::ScopedSkSurfaceProvider scoped_surface(
context_provider, &lock, using_worker_context, use_distance_field_text,
can_use_lcd_text, msaa_sample_count);
+ if (!scoped_surface.sk_surface())
+ return resources_.back()->id();
vmpstr 2017/06/30 23:16:51 Should we be somehow cleaning up resources_ if thi
sohan 2017/07/04 16:51:12 Hmm. we are in ScopedWriteLockGL scope here, so if
SkCanvas* gpu_raster_canvas = scoped_surface.sk_surface()->getCanvas();
TRACE_EVENT_END0("cc", "CreateHudCanvas");
@@ -225,6 +226,8 @@ void HeadsUpDisplayLayerImpl::UpdateHudTexture(
internal_content_bounds_);
resource_provider->GenerateSyncTokenForResource(resources_.back()->id());
}
+
+ return 0U;
}
void HeadsUpDisplayLayerImpl::ReleaseResources() {

Powered by Google App Engine
This is Rietveld 408576698