OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 void Display::SetColorSpace(const gfx::ColorSpace& color_space) { | 145 void Display::SetColorSpace(const gfx::ColorSpace& color_space) { |
146 device_color_space_ = color_space; | 146 device_color_space_ = color_space; |
147 } | 147 } |
148 | 148 |
149 void Display::SetExternalClip(const gfx::Rect& clip) { | 149 void Display::SetExternalClip(const gfx::Rect& clip) { |
150 external_clip_ = clip; | 150 external_clip_ = clip; |
151 } | 151 } |
152 | 152 |
153 void Display::SetExternalViewport(const gfx::Rect& viewport) { | |
154 external_viewport_ = viewport; | |
155 } | |
156 | |
157 void Display::SetOutputIsSecure(bool secure) { | 153 void Display::SetOutputIsSecure(bool secure) { |
158 if (secure == output_is_secure_) | 154 if (secure == output_is_secure_) |
159 return; | 155 return; |
160 output_is_secure_ = secure; | 156 output_is_secure_ = secure; |
161 | 157 |
162 if (aggregator_) { | 158 if (aggregator_) { |
163 aggregator_->set_output_is_secure(secure); | 159 aggregator_->set_output_is_secure(secure); |
164 // Force a redraw. | 160 // Force a redraw. |
165 if (!current_surface_id_.is_null()) | 161 if (!current_surface_id_.is_null()) |
166 aggregator_->SetFullDamageForSurface(current_surface_id_); | 162 aggregator_->SetFullDamageForSurface(current_surface_id_); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // likely destroyed. | 286 // likely destroyed. |
291 if (output_surface_->SurfaceIsSuspendForRecycle()) { | 287 if (output_surface_->SurfaceIsSuspendForRecycle()) { |
292 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.", | 288 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.", |
293 TRACE_EVENT_SCOPE_THREAD); | 289 TRACE_EVENT_SCOPE_THREAD); |
294 should_draw = false; | 290 should_draw = false; |
295 } | 291 } |
296 | 292 |
297 client_->DisplayWillDrawAndSwap(should_draw, frame_data->render_pass_list); | 293 client_->DisplayWillDrawAndSwap(should_draw, frame_data->render_pass_list); |
298 | 294 |
299 if (should_draw) { | 295 if (should_draw) { |
300 gfx::Rect device_viewport_rect = external_viewport_.IsEmpty() | 296 gfx::Rect device_viewport_rect(current_surface_size_); |
301 ? gfx::Rect(current_surface_size_) | |
302 : external_viewport_; | |
303 gfx::Rect device_clip_rect = | 297 gfx::Rect device_clip_rect = |
304 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; | 298 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; |
305 | 299 |
306 bool disable_image_filtering = | 300 bool disable_image_filtering = |
307 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation; | 301 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation; |
308 if (software_renderer_) { | 302 if (software_renderer_) { |
309 software_renderer_->SetDisablePictureQuadImageFiltering( | 303 software_renderer_->SetDisablePictureQuadImageFiltering( |
310 disable_image_filtering); | 304 disable_image_filtering); |
311 } else { | 305 } else { |
312 // This should only be set for software draws in synchronous compositor. | 306 // This should only be set for software draws in synchronous compositor. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 const SurfaceId& Display::CurrentSurfaceId() { | 423 const SurfaceId& Display::CurrentSurfaceId() { |
430 return current_surface_id_; | 424 return current_surface_id_; |
431 } | 425 } |
432 | 426 |
433 void Display::ForceImmediateDrawAndSwapIfPossible() { | 427 void Display::ForceImmediateDrawAndSwapIfPossible() { |
434 if (scheduler_) | 428 if (scheduler_) |
435 scheduler_->ForceImmediateSwapIfPossible(); | 429 scheduler_->ForceImmediateSwapIfPossible(); |
436 } | 430 } |
437 | 431 |
438 } // namespace cc | 432 } // namespace cc |
OLD | NEW |