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

Side by Side Diff: cc/surfaces/display.cc

Issue 1227233002: Mac: Don't draw a cc::Surface while suspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix other platform compile Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "cc/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 bool Display::DrawAndSwap() { 143 bool Display::DrawAndSwap() {
144 if (current_surface_id_.is_null()) 144 if (current_surface_id_.is_null())
145 return false; 145 return false;
146 146
147 InitializeRenderer(); 147 InitializeRenderer();
148 if (!output_surface_) 148 if (!output_surface_)
149 return false; 149 return false;
150 150
151 if (output_surface_->SurfaceIsSuspendForRecycle())
152 return false;
153
151 scoped_ptr<CompositorFrame> frame = 154 scoped_ptr<CompositorFrame> frame =
152 aggregator_->Aggregate(current_surface_id_); 155 aggregator_->Aggregate(current_surface_id_);
153 if (!frame) 156 if (!frame)
154 return false; 157 return false;
155 158
156 TRACE_EVENT0("cc", "Display::DrawAndSwap"); 159 TRACE_EVENT0("cc", "Display::DrawAndSwap");
157 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); 160 benchmark_instrumentation::IssueDisplayRenderingStatsEvent();
158 161
159 // Run callbacks early to allow pipelining. 162 // Run callbacks early to allow pipelining.
160 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { 163 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 286
284 if (surface_id == current_surface_id_) 287 if (surface_id == current_surface_id_)
285 UpdateRootSurfaceResourcesLocked(); 288 UpdateRootSurfaceResourcesLocked();
286 } 289 }
287 290
288 SurfaceId Display::CurrentSurfaceId() { 291 SurfaceId Display::CurrentSurfaceId() {
289 return current_surface_id_; 292 return current_surface_id_;
290 } 293 }
291 294
292 } // namespace cc 295 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.cc ('k') | content/browser/compositor/gpu_browser_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698