| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void CompositorHost::DidBeginMainFrame() {} | 96 void CompositorHost::DidBeginMainFrame() {} |
| 97 | 97 |
| 98 void CompositorHost::Animate(double frame_begin_time) { | 98 void CompositorHost::Animate(double frame_begin_time) { |
| 99 // TODO(jamesr): Should use cc's animation system. | 99 // TODO(jamesr): Should use cc's animation system. |
| 100 static const double kDegreesPerSecond = 70.0; | 100 static const double kDegreesPerSecond = 70.0; |
| 101 double child_rotation_degrees = kDegreesPerSecond * frame_begin_time; | 101 double child_rotation_degrees = kDegreesPerSecond * frame_begin_time; |
| 102 gfx::Transform child_transform; | 102 gfx::Transform child_transform; |
| 103 child_transform.Translate(200, 200); | 103 child_transform.Translate(200, 200); |
| 104 child_transform.Rotate(child_rotation_degrees); | 104 child_transform.Rotate(child_rotation_degrees); |
| 105 child_layer_->SetTransform(child_transform); | 105 child_layer_->SetTransform(child_transform); |
| 106 tree_->SetNeedsAnimate(); | 106 tree_->SetNeedsUpdateLayers(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void CompositorHost::Layout() {} | 109 void CompositorHost::Layout() {} |
| 110 void CompositorHost::ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 110 void CompositorHost::ApplyScrollAndScale(gfx::Vector2d scroll_delta, |
| 111 float page_scale) {} | 111 float page_scale) {} |
| 112 | 112 |
| 113 scoped_ptr<cc::OutputSurface> CompositorHost::CreateOutputSurface( | 113 scoped_ptr<cc::OutputSurface> CompositorHost::CreateOutputSurface( |
| 114 bool fallback) { | 114 bool fallback) { |
| 115 return make_scoped_ptr( | 115 return make_scoped_ptr( |
| 116 new cc::OutputSurface(new MojoContextProvider(gles2_client_impl_))); | 116 new cc::OutputSurface(new MojoContextProvider(gles2_client_impl_))); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CompositorHost::DidInitializeOutputSurface(bool success) {} | 119 void CompositorHost::DidInitializeOutputSurface(bool success) {} |
| 120 | 120 |
| 121 void CompositorHost::WillCommit() {} | 121 void CompositorHost::WillCommit() {} |
| 122 void CompositorHost::DidCommit() {} | 122 void CompositorHost::DidCommit() {} |
| 123 void CompositorHost::DidCommitAndDrawFrame() {} | 123 void CompositorHost::DidCommitAndDrawFrame() {} |
| 124 void CompositorHost::DidCompleteSwapBuffers() {} | 124 void CompositorHost::DidCompleteSwapBuffers() {} |
| 125 | 125 |
| 126 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { | 126 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { |
| 127 return NULL; | 127 return NULL; |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace examples | 130 } // namespace examples |
| 131 } // namespace mojo | 131 } // namespace mojo |
| OLD | NEW |