Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 size_ = size_in_pixel; | 316 size_ = size_in_pixel; |
| 317 host_->SetViewportSize(size_in_pixel); | 317 host_->SetViewportSize(size_in_pixel); |
| 318 root_web_layer_->SetBounds(size_in_pixel); | 318 root_web_layer_->SetBounds(size_in_pixel); |
| 319 // TODO(fsamuel): Get rid of ContextFactoryPrivate. | 319 // TODO(fsamuel): Get rid of ContextFactoryPrivate. |
| 320 if (context_factory_private_) | 320 if (context_factory_private_) |
| 321 context_factory_private_->ResizeDisplay(this, size_in_pixel); | 321 context_factory_private_->ResizeDisplay(this, size_in_pixel); |
| 322 } | 322 } |
| 323 if (device_scale_factor_ != scale) { | 323 if (device_scale_factor_ != scale) { |
| 324 device_scale_factor_ = scale; | 324 device_scale_factor_ = scale; |
| 325 host_->SetDeviceScaleFactor(scale); | 325 host_->SetDeviceScaleFactor(scale); |
| 326 if (IsPixelCanvasRecordingEnabled()) | |
|
danakj
2017/07/21 17:29:39
Can this be passed to the Constructor instead so u
malaykeshav
2017/07/21 23:30:17
Done
| |
| 327 host_->SetRecordingScaleFactor(scale); | |
| 326 if (root_layer_) | 328 if (root_layer_) |
| 327 root_layer_->OnDeviceScaleFactorChanged(scale); | 329 root_layer_->OnDeviceScaleFactorChanged(scale); |
| 328 } | 330 } |
| 329 } | 331 } |
| 330 | 332 |
| 331 void Compositor::SetDisplayColorSpace(const gfx::ColorSpace& color_space) { | 333 void Compositor::SetDisplayColorSpace(const gfx::ColorSpace& color_space) { |
| 332 blending_color_space_ = color_space; | 334 blending_color_space_ = color_space; |
| 333 output_color_space_ = blending_color_space_; | 335 output_color_space_ = blending_color_space_; |
| 334 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { | 336 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { |
| 335 blending_color_space_ = gfx::ColorSpace::CreateExtendedSRGB(); | 337 blending_color_space_ = gfx::ColorSpace::CreateExtendedSRGB(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 void Compositor::TimeoutLocks() { | 587 void Compositor::TimeoutLocks() { |
| 586 // Make a copy, we're going to cause |active_locks_| to become | 588 // Make a copy, we're going to cause |active_locks_| to become |
| 587 // empty. | 589 // empty. |
| 588 std::vector<CompositorLock*> locks = active_locks_; | 590 std::vector<CompositorLock*> locks = active_locks_; |
| 589 for (auto* lock : locks) | 591 for (auto* lock : locks) |
| 590 lock->TimeoutLock(); | 592 lock->TimeoutLock(); |
| 591 DCHECK(active_locks_.empty()); | 593 DCHECK(active_locks_.empty()); |
| 592 } | 594 } |
| 593 | 595 |
| 594 } // namespace ui | 596 } // namespace ui |
| OLD | NEW |