OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/examples/compositor_app/compositor_host.h" | 5 #include "mojo/examples/compositor_app/compositor_host.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
9 #include "cc/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 tree_ = cc::LayerTreeHost::CreateThreaded( | 24 tree_ = cc::LayerTreeHost::CreateThreaded( |
25 this, NULL, settings, compositor_thread_.message_loop_proxy()); | 25 this, NULL, settings, compositor_thread_.message_loop_proxy()); |
26 SetupScene(); | 26 SetupScene(); |
27 } | 27 } |
28 | 28 |
29 CompositorHost::~CompositorHost() {} | 29 CompositorHost::~CompositorHost() {} |
30 | 30 |
31 void CompositorHost::SetSize(gfx::Size viewport_size) { | 31 void CompositorHost::SetSize(gfx::Size viewport_size) { |
32 tree_->SetViewportSize(viewport_size); | 32 tree_->SetViewportSize(viewport_size); |
33 tree_->SetLayerTreeHostClientReady(); | 33 tree_->SetLayerTreeHostClientReady(); |
34 tree_->InitializeOutputSurfaceIfNeeded(); | |
35 } | 34 } |
36 | 35 |
37 void CompositorHost::SetupScene() { | 36 void CompositorHost::SetupScene() { |
38 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create(); | 37 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create(); |
39 root_layer->SetBounds(gfx::Size(500, 500)); | 38 root_layer->SetBounds(gfx::Size(500, 500)); |
40 root_layer->SetBackgroundColor(SK_ColorBLUE); | 39 root_layer->SetBackgroundColor(SK_ColorBLUE); |
41 root_layer->SetIsDrawable(true); | 40 root_layer->SetIsDrawable(true); |
42 tree_->SetRootLayer(root_layer); | 41 tree_->SetRootLayer(root_layer); |
43 | 42 |
44 child_layer_ = cc::SolidColorLayer::Create(); | 43 child_layer_ = cc::SolidColorLayer::Create(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void CompositorHost::DidInitializeOutputSurface() { | 78 void CompositorHost::DidInitializeOutputSurface() { |
80 } | 79 } |
81 | 80 |
82 void CompositorHost::WillCommit() {} | 81 void CompositorHost::WillCommit() {} |
83 void CompositorHost::DidCommit() {} | 82 void CompositorHost::DidCommit() {} |
84 void CompositorHost::DidCommitAndDrawFrame() {} | 83 void CompositorHost::DidCommitAndDrawFrame() {} |
85 void CompositorHost::DidCompleteSwapBuffers() {} | 84 void CompositorHost::DidCompleteSwapBuffers() {} |
86 | 85 |
87 } // namespace examples | 86 } // namespace examples |
88 } // namespace mojo | 87 } // namespace mojo |
OLD | NEW |