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

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

Issue 2728173004: HDR: Do nonlinear blending in the compositor (Closed)
Patch Set: Fix windows build Created 3 years, 9 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') | cc/surfaces/display_unittest.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 <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/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (swapped_since_resize_ && output_surface_ && 152 if (swapped_since_resize_ && output_surface_ &&
153 output_surface_->context_provider()) 153 output_surface_->context_provider())
154 output_surface_->context_provider()->ContextGL()->ShallowFinishCHROMIUM(); 154 output_surface_->context_provider()->ContextGL()->ShallowFinishCHROMIUM();
155 } 155 }
156 swapped_since_resize_ = false; 156 swapped_since_resize_ = false;
157 current_surface_size_ = size; 157 current_surface_size_ = size;
158 if (scheduler_) 158 if (scheduler_)
159 scheduler_->DisplayResized(); 159 scheduler_->DisplayResized();
160 } 160 }
161 161
162 void Display::SetColorSpace(const gfx::ColorSpace& color_space) { 162 void Display::SetColorSpace(const gfx::ColorSpace& blending_color_space,
163 device_color_space_ = color_space; 163 const gfx::ColorSpace& device_color_space) {
164 if (aggregator_) 164 blending_color_space_ = blending_color_space;
165 aggregator_->SetOutputColorSpace(device_color_space_); 165 device_color_space_ = device_color_space;
166 if (aggregator_) {
167 aggregator_->SetOutputColorSpace(blending_color_space, device_color_space_);
168 }
166 } 169 }
167 170
168 void Display::SetOutputIsSecure(bool secure) { 171 void Display::SetOutputIsSecure(bool secure) {
169 if (secure == output_is_secure_) 172 if (secure == output_is_secure_)
170 return; 173 return;
171 output_is_secure_ = secure; 174 output_is_secure_ = secure;
172 175
173 if (aggregator_) { 176 if (aggregator_) {
174 aggregator_->set_output_is_secure(secure); 177 aggregator_->set_output_is_secure(secure);
175 // Force a redraw. 178 // Force a redraw.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 renderer_->Initialize(); 215 renderer_->Initialize();
213 renderer_->SetVisible(visible_); 216 renderer_->SetVisible(visible_);
214 217
215 // TODO(jbauman): Outputting an incomplete quad list doesn't work when using 218 // TODO(jbauman): Outputting an incomplete quad list doesn't work when using
216 // overlays. 219 // overlays.
217 bool output_partial_list = renderer_->use_partial_swap() && 220 bool output_partial_list = renderer_->use_partial_swap() &&
218 !output_surface_->GetOverlayCandidateValidator(); 221 !output_surface_->GetOverlayCandidateValidator();
219 aggregator_.reset(new SurfaceAggregator( 222 aggregator_.reset(new SurfaceAggregator(
220 surface_manager_, resource_provider_.get(), output_partial_list)); 223 surface_manager_, resource_provider_.get(), output_partial_list));
221 aggregator_->set_output_is_secure(output_is_secure_); 224 aggregator_->set_output_is_secure(output_is_secure_);
222 aggregator_->SetOutputColorSpace(device_color_space_); 225 aggregator_->SetOutputColorSpace(blending_color_space_, device_color_space_);
223 } 226 }
224 227
225 void Display::UpdateRootSurfaceResourcesLocked() { 228 void Display::UpdateRootSurfaceResourcesLocked() {
226 Surface* surface = surface_manager_->GetSurfaceForId(current_surface_id_); 229 Surface* surface = surface_manager_->GetSurfaceForId(current_surface_id_);
227 bool root_surface_resources_locked = !surface || !surface->HasActiveFrame(); 230 bool root_surface_resources_locked = !surface || !surface->HasActiveFrame();
228 if (scheduler_) 231 if (scheduler_)
229 scheduler_->SetRootSurfaceResourcesLocked(root_surface_resources_locked); 232 scheduler_->SetRootSurfaceResourcesLocked(root_surface_resources_locked);
230 } 233 }
231 234
232 void Display::DidLoseContextProvider() { 235 void Display::DidLoseContextProvider() {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 const SurfaceId& Display::CurrentSurfaceId() { 416 const SurfaceId& Display::CurrentSurfaceId() {
414 return current_surface_id_; 417 return current_surface_id_;
415 } 418 }
416 419
417 void Display::ForceImmediateDrawAndSwapIfPossible() { 420 void Display::ForceImmediateDrawAndSwapIfPossible() {
418 if (scheduler_) 421 if (scheduler_)
419 scheduler_->ForceImmediateSwapIfPossible(); 422 scheduler_->ForceImmediateSwapIfPossible();
420 } 423 }
421 424
422 } // namespace cc 425 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698