Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: mojo/examples/compositor_app/compositor_host.cc

Issue 133263004: Unifies LayerTreeHost::SetNeedsUpdateLayers and SetNeedsAnimate -- V2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mojo build Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/web_layer_tree_view_impl_for_testing.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/test/web_layer_tree_view_impl_for_testing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698