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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2270573002: cc: Get rid of LayerTreeHost::output_surface_lost_ state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-caps
Patch Set: lth-outputsurface-lost: android-build-and-earlyout-sooner Created 4 years, 4 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/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_unittest.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 eb5a67538f6800cac13ef0e5e2d9bab0f0c95b59..f46d3cddfba829d2c71428b1f699eddaea703af4 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2333,6 +2333,9 @@ void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
void LayerTreeHostImpl::ReleaseOutputSurface() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::ReleaseOutputSurface");
+ if (!output_surface_)
+ return;
+
// Since we will create a new resource provider, we cannot continue to use
// the old resources (i.e. render_surfaces and texture IDs). Clear them
// before we destroy the old resource provider.
@@ -2346,10 +2349,8 @@ void LayerTreeHostImpl::ReleaseOutputSurface() {
// Detach from the old output surface and reset |output_surface_| pointer
// as this surface is going to be destroyed independent of if binding the
// new output surface succeeds or not.
- if (output_surface_) {
- output_surface_->DetachFromClient();
- output_surface_ = nullptr;
- }
+ output_surface_->DetachFromClient();
+ output_surface_ = nullptr;
// We don't know if the next OutputSurface will support GPU rasterization.
// Make sure to clear the flag so that we force a re-computation.
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698