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

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

Issue 1044093005: Preliminary compositor disabling patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove renderpass calculation Created 5 years, 8 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
« no previous file with comments | « cc/quads/render_pass.cc ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 stored_latency_info_.clear(); 140 stored_latency_info_.clear();
141 bool have_copy_requests = false; 141 bool have_copy_requests = false;
142 for (const auto* pass : frame_data->render_pass_list) { 142 for (const auto* pass : frame_data->render_pass_list) {
143 have_copy_requests |= !pass->copy_requests.empty(); 143 have_copy_requests |= !pass->copy_requests.empty();
144 } 144 }
145 145
146 gfx::Size surface_size; 146 gfx::Size surface_size;
147 bool have_damage = false; 147 bool have_damage = false;
148 if (!frame_data->render_pass_list.empty()) { 148 if (!frame_data->render_pass_list.empty()) {
149 surface_size = frame_data->render_pass_list.back()->output_rect.size(); 149 surface_size = frame_data->render_pass_list.back()->output_rect.size();
150 have_damage = 150 have_damage = !frame_data->render_pass_list.back()->damage_rect.IsEmpty() ||
151 !frame_data->render_pass_list.back()->damage_rect.size().IsEmpty(); 151 !frame_data->render_pass_list.back()->overlay_rect.IsEmpty();
152 } 152 }
153 bool avoid_swap = surface_size != current_surface_size_; 153 bool avoid_swap = surface_size != current_surface_size_;
154 bool should_draw = !frame->metadata.latency_info.empty() || 154 bool should_draw = !frame->metadata.latency_info.empty() ||
155 have_copy_requests || (have_damage && !avoid_swap); 155 have_copy_requests || (have_damage && !avoid_swap);
156 156
157 if (should_draw) { 157 if (should_draw) {
158 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); 158 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_);
159 gfx::Rect device_clip_rect = device_viewport_rect; 159 gfx::Rect device_clip_rect = device_viewport_rect;
160 bool disable_picture_quad_image_filtering = false; 160 bool disable_picture_quad_image_filtering = false;
161 161
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 int Display::GetMaxFramesPending() { 221 int Display::GetMaxFramesPending() {
222 int max_frames_pending = 222 int max_frames_pending =
223 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0; 223 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0;
224 if (max_frames_pending <= 0) 224 if (max_frames_pending <= 0)
225 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; 225 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
226 return max_frames_pending; 226 return max_frames_pending;
227 } 227 }
228 228
229 } // namespace cc 229 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/render_pass.cc ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698