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

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

Issue 141833002: Revert 245445 "Unifies LayerTreeHost::SetNeedsUpdateLayers and S..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | « trunk/src/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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void CompositorHost::DidBeginMainFrame() {} 94 void CompositorHost::DidBeginMainFrame() {}
95 95
96 void CompositorHost::Animate(double frame_begin_time) { 96 void CompositorHost::Animate(double frame_begin_time) {
97 // TODO(jamesr): Should use cc's animation system. 97 // TODO(jamesr): Should use cc's animation system.
98 static const double kDegreesPerSecond = 70.0; 98 static const double kDegreesPerSecond = 70.0;
99 double child_rotation_degrees = kDegreesPerSecond * frame_begin_time; 99 double child_rotation_degrees = kDegreesPerSecond * frame_begin_time;
100 gfx::Transform child_transform; 100 gfx::Transform child_transform;
101 child_transform.Translate(200, 200); 101 child_transform.Translate(200, 200);
102 child_transform.Rotate(child_rotation_degrees); 102 child_transform.Rotate(child_rotation_degrees);
103 child_layer_->SetTransform(child_transform); 103 child_layer_->SetTransform(child_transform);
104 tree_->SetNeedsUpdateLayers(); 104 tree_->SetNeedsAnimate();
105 } 105 }
106 106
107 void CompositorHost::Layout() {} 107 void CompositorHost::Layout() {}
108 void CompositorHost::ApplyScrollAndScale(gfx::Vector2d scroll_delta, 108 void CompositorHost::ApplyScrollAndScale(gfx::Vector2d scroll_delta,
109 float page_scale) {} 109 float page_scale) {}
110 110
111 scoped_ptr<cc::OutputSurface> CompositorHost::CreateOutputSurface( 111 scoped_ptr<cc::OutputSurface> CompositorHost::CreateOutputSurface(
112 bool fallback) { 112 bool fallback) {
113 return make_scoped_ptr( 113 return make_scoped_ptr(
114 new cc::OutputSurface(new MojoContextProvider(gles2_client_impl_))); 114 new cc::OutputSurface(new MojoContextProvider(gles2_client_impl_)));
115 } 115 }
116 116
117 void CompositorHost::DidInitializeOutputSurface(bool success) {} 117 void CompositorHost::DidInitializeOutputSurface(bool success) {}
118 118
119 void CompositorHost::WillCommit() {} 119 void CompositorHost::WillCommit() {}
120 void CompositorHost::DidCommit() {} 120 void CompositorHost::DidCommit() {}
121 void CompositorHost::DidCommitAndDrawFrame() {} 121 void CompositorHost::DidCommitAndDrawFrame() {}
122 void CompositorHost::DidCompleteSwapBuffers() {} 122 void CompositorHost::DidCompleteSwapBuffers() {}
123 123
124 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { 124 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() {
125 return NULL; 125 return NULL;
126 } 126 }
127 127
128 } // namespace examples 128 } // namespace examples
129 } // namespace mojo 129 } // namespace mojo
OLDNEW
« no previous file with comments | « trunk/src/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