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 10 matching lines...) Expand all Loading... |
21 DCHECK(started); | 21 DCHECK(started); |
22 | 22 |
23 cc::LayerTreeSettings settings; | 23 cc::LayerTreeSettings settings; |
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(const gfx::Size& viewport_size) { |
32 tree_->SetViewportSize(viewport_size); | 32 tree_->SetViewportSize(viewport_size); |
33 tree_->SetLayerTreeHostClientReady(); | 33 tree_->SetLayerTreeHostClientReady(); |
34 } | 34 } |
35 | 35 |
36 void CompositorHost::SetupScene() { | 36 void CompositorHost::SetupScene() { |
37 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create(); | 37 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create(); |
38 root_layer->SetBounds(gfx::Size(500, 500)); | 38 root_layer->SetBounds(gfx::Size(500, 500)); |
39 root_layer->SetBackgroundColor(SK_ColorBLUE); | 39 root_layer->SetBackgroundColor(SK_ColorBLUE); |
40 root_layer->SetIsDrawable(true); | 40 root_layer->SetIsDrawable(true); |
41 tree_->SetRootLayer(root_layer); | 41 tree_->SetRootLayer(root_layer); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void CompositorHost::DidInitializeOutputSurface() { | 78 void CompositorHost::DidInitializeOutputSurface() { |
79 } | 79 } |
80 | 80 |
81 void CompositorHost::WillCommit() {} | 81 void CompositorHost::WillCommit() {} |
82 void CompositorHost::DidCommit() {} | 82 void CompositorHost::DidCommit() {} |
83 void CompositorHost::DidCommitAndDrawFrame() {} | 83 void CompositorHost::DidCommitAndDrawFrame() {} |
84 void CompositorHost::DidCompleteSwapBuffers() {} | 84 void CompositorHost::DidCompleteSwapBuffers() {} |
85 | 85 |
86 } // namespace examples | 86 } // namespace examples |
87 } // namespace mojo | 87 } // namespace mojo |
OLD | NEW |