| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 settings.initial_debug_state.show_non_occluding_rects = | 285 settings.initial_debug_state.show_non_occluding_rects = |
| 286 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); | 286 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); |
| 287 | 287 |
| 288 if (!!g_compositor_thread) { | 288 if (!!g_compositor_thread) { |
| 289 host_ = cc::LayerTreeHost::CreateThreaded( | 289 host_ = cc::LayerTreeHost::CreateThreaded( |
| 290 this, NULL, settings, g_compositor_thread->message_loop_proxy()); | 290 this, NULL, settings, g_compositor_thread->message_loop_proxy()); |
| 291 } else { | 291 } else { |
| 292 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings); | 292 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings); |
| 293 } | 293 } |
| 294 host_->SetRootLayer(root_web_layer_); | 294 host_->SetRootLayer(root_web_layer_); |
| 295 host_->SetLayerTreeHostClientReady(); | 295 host_->SetLayerTreeHostClientReady(CreateOutputSurface(false)); |
| 296 } | 296 } |
| 297 | 297 |
| 298 Compositor::~Compositor() { | 298 Compositor::~Compositor() { |
| 299 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 299 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 300 | 300 |
| 301 DCHECK(g_compositor_initialized); | 301 DCHECK(g_compositor_initialized); |
| 302 | 302 |
| 303 CancelCompositorLock(); | 303 CancelCompositorLock(); |
| 304 DCHECK(!compositor_lock_); | 304 DCHECK(!compositor_lock_); |
| 305 | 305 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 // CompositorObservers to be notified before starting another | 616 // CompositorObservers to be notified before starting another |
| 617 // draw cycle. | 617 // draw cycle. |
| 618 ScheduleDraw(); | 618 ScheduleDraw(); |
| 619 } | 619 } |
| 620 FOR_EACH_OBSERVER(CompositorObserver, | 620 FOR_EACH_OBSERVER(CompositorObserver, |
| 621 observer_list_, | 621 observer_list_, |
| 622 OnCompositingEnded(this)); | 622 OnCompositingEnded(this)); |
| 623 } | 623 } |
| 624 | 624 |
| 625 } // namespace ui | 625 } // namespace ui |
| OLD | NEW |