| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 void Compositor::SetBackgroundColor(SkColor color) { | 226 void Compositor::SetBackgroundColor(SkColor color) { |
| 227 host_->set_background_color(color); | 227 host_->set_background_color(color); |
| 228 ScheduleDraw(); | 228 ScheduleDraw(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { | 231 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { |
| 232 return vsync_manager_; | 232 return vsync_manager_; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void Compositor::AddObserver(CompositorObserver* observer) { | 235 void Compositor::AddObserver(CompositorObserver* observer) { |
| 236 #if DCHECK_IS_ON | 236 #if defined(OS_MACOSX) |
| 237 DCHECK(observer); | 237 // Debugging instrumentation for crbug.com/401630. |
| 238 // TODO(ccameron): remove this. |
| 239 CHECK(observer); |
| 238 if (!observer_list_.HasObserver(observer)) | 240 if (!observer_list_.HasObserver(observer)) |
| 239 observer->observing_count_ += 1; | 241 observer->observing_count_ += 1; |
| 240 #endif | 242 #endif |
| 241 | 243 |
| 242 observer_list_.AddObserver(observer); | 244 observer_list_.AddObserver(observer); |
| 243 } | 245 } |
| 244 | 246 |
| 245 void Compositor::RemoveObserver(CompositorObserver* observer) { | 247 void Compositor::RemoveObserver(CompositorObserver* observer) { |
| 246 #if DCHECK_IS_ON | 248 #if defined(OS_MACOSX) |
| 249 // Debugging instrumentation for crbug.com/401630. |
| 250 // TODO(ccameron): remove this. |
| 247 if (observer_list_.HasObserver(observer)) | 251 if (observer_list_.HasObserver(observer)) |
| 248 observer->observing_count_ -= 1; | 252 observer->observing_count_ -= 1; |
| 249 #endif | 253 #endif |
| 250 | 254 |
| 251 observer_list_.RemoveObserver(observer); | 255 observer_list_.RemoveObserver(observer); |
| 252 } | 256 } |
| 253 | 257 |
| 254 bool Compositor::HasObserver(CompositorObserver* observer) { | 258 bool Compositor::HasObserver(CompositorObserver* observer) { |
| 255 return observer_list_.HasObserver(observer); | 259 return observer_list_.HasObserver(observer); |
| 256 } | 260 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 observer_list_, | 359 observer_list_, |
| 356 OnCompositingLockStateChanged(this)); | 360 OnCompositingLockStateChanged(this)); |
| 357 } | 361 } |
| 358 | 362 |
| 359 void Compositor::CancelCompositorLock() { | 363 void Compositor::CancelCompositorLock() { |
| 360 if (compositor_lock_) | 364 if (compositor_lock_) |
| 361 compositor_lock_->CancelLock(); | 365 compositor_lock_->CancelLock(); |
| 362 } | 366 } |
| 363 | 367 |
| 364 } // namespace ui | 368 } // namespace ui |
| OLD | NEW |