| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (root_layer_) | 269 if (root_layer_) |
| 270 root_layer_->OnDeviceScaleFactorChanged(scale); | 270 root_layer_->OnDeviceScaleFactorChanged(scale); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 void Compositor::SetBackgroundColor(SkColor color) { | 274 void Compositor::SetBackgroundColor(SkColor color) { |
| 275 host_->set_background_color(color); | 275 host_->set_background_color(color); |
| 276 ScheduleDraw(); | 276 ScheduleDraw(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void Compositor::SetVisible(bool visible) { | |
| 280 host_->SetVisible(visible); | |
| 281 } | |
| 282 | |
| 283 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { | 279 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { |
| 284 return vsync_manager_; | 280 return vsync_manager_; |
| 285 } | 281 } |
| 286 | 282 |
| 287 void Compositor::AddObserver(CompositorObserver* observer) { | 283 void Compositor::AddObserver(CompositorObserver* observer) { |
| 288 #if defined(OS_MACOSX) | 284 #if defined(OS_MACOSX) |
| 289 // Debugging instrumentation for crbug.com/401630. | 285 // Debugging instrumentation for crbug.com/401630. |
| 290 // TODO(ccameron): remove this. | 286 // TODO(ccameron): remove this. |
| 291 CHECK(observer); | 287 CHECK(observer); |
| 292 if (!observer_list_.HasObserver(observer)) | 288 if (!observer_list_.HasObserver(observer)) |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 // Call ScheduleDraw() instead of Draw() in order to allow other | 440 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 445 // CompositorObservers to be notified before starting another | 441 // CompositorObservers to be notified before starting another |
| 446 // draw cycle. | 442 // draw cycle. |
| 447 ScheduleDraw(); | 443 ScheduleDraw(); |
| 448 } | 444 } |
| 449 FOR_EACH_OBSERVER( | 445 FOR_EACH_OBSERVER( |
| 450 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 446 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 451 } | 447 } |
| 452 | 448 |
| 453 } // namespace ui | 449 } // namespace ui |
| OLD | NEW |