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

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

Issue 2187563006: sync compositor: Set display viewport for software draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SkISizeToSize 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/display.h ('k') | content/renderer/android/synchronous_compositor_output_surface.h » ('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 <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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 127
128 void Display::SetColorSpace(const gfx::ColorSpace& color_space) { 128 void Display::SetColorSpace(const gfx::ColorSpace& color_space) {
129 device_color_space_ = color_space; 129 device_color_space_ = color_space;
130 } 130 }
131 131
132 void Display::SetExternalClip(const gfx::Rect& clip) { 132 void Display::SetExternalClip(const gfx::Rect& clip) {
133 external_clip_ = clip; 133 external_clip_ = clip;
134 } 134 }
135 135
136 void Display::SetExternalViewport(const gfx::Rect& viewport) {
137 external_viewport_ = viewport;
138 }
139
136 void Display::SetOutputIsSecure(bool secure) { 140 void Display::SetOutputIsSecure(bool secure) {
137 if (secure == output_is_secure_) 141 if (secure == output_is_secure_)
138 return; 142 return;
139 output_is_secure_ = secure; 143 output_is_secure_ = secure;
140 144
141 if (aggregator_) { 145 if (aggregator_) {
142 aggregator_->set_output_is_secure(secure); 146 aggregator_->set_output_is_secure(secure);
143 // Force a redraw. 147 // Force a redraw.
144 if (!current_surface_id_.is_null()) 148 if (!current_surface_id_.is_null())
145 aggregator_->SetFullDamageForSurface(current_surface_id_); 149 aggregator_->SetFullDamageForSurface(current_surface_id_);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 282
279 // If the surface is suspended then the resources to be used by the draw are 283 // If the surface is suspended then the resources to be used by the draw are
280 // likely destroyed. 284 // likely destroyed.
281 if (output_surface_->SurfaceIsSuspendForRecycle()) { 285 if (output_surface_->SurfaceIsSuspendForRecycle()) {
282 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.", 286 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.",
283 TRACE_EVENT_SCOPE_THREAD); 287 TRACE_EVENT_SCOPE_THREAD);
284 should_draw = false; 288 should_draw = false;
285 } 289 }
286 290
287 if (should_draw) { 291 if (should_draw) {
288 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); 292 gfx::Rect device_viewport_rect = external_viewport_.IsEmpty()
293 ? gfx::Rect(current_surface_size_)
294 : external_viewport_;
289 gfx::Rect device_clip_rect = 295 gfx::Rect device_clip_rect =
290 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; 296 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_;
291 297
292 bool disable_image_filtering = 298 bool disable_image_filtering =
293 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation; 299 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation;
294 if (software_renderer_) { 300 if (software_renderer_) {
295 software_renderer_->SetDisablePictureQuadImageFiltering( 301 software_renderer_->SetDisablePictureQuadImageFiltering(
296 disable_image_filtering); 302 disable_image_filtering);
297 } else { 303 } else {
298 // This should only be set for software draws in synchronous compositor. 304 // This should only be set for software draws in synchronous compositor.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 425
420 if (surface_id == current_surface_id_) 426 if (surface_id == current_surface_id_)
421 UpdateRootSurfaceResourcesLocked(); 427 UpdateRootSurfaceResourcesLocked();
422 } 428 }
423 429
424 const SurfaceId& Display::CurrentSurfaceId() { 430 const SurfaceId& Display::CurrentSurfaceId() {
425 return current_surface_id_; 431 return current_surface_id_;
426 } 432 }
427 433
428 } // namespace cc 434 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.h ('k') | content/renderer/android/synchronous_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698