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

Side by Side Diff: examples/ui/spinning_cube/spinning_cube_view.cc

Issue 1782733002: Mozart: The great RectF-ication. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase Created 4 years, 9 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
« no previous file with comments | « examples/ui/shapes/shapes_view.cc ('k') | examples/ui/tile/tile_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "examples/ui/spinning_cube/spinning_cube_view.h" 5 #include "examples/ui/spinning_cube/spinning_cube_view.h"
6 6
7 #ifndef GL_GLEXT_PROTOTYPES 7 #ifndef GL_GLEXT_PROTOTYPES
8 #define GL_GLEXT_PROTOTYPES 8 #define GL_GLEXT_PROTOTYPES
9 #endif 9 #endif
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 callback.Run(true); 142 callback.Run(true);
143 } 143 }
144 144
145 void SpinningCubeView::OnDraw( 145 void SpinningCubeView::OnDraw(
146 const mojo::gfx::composition::FrameInfo& frame_info, 146 const mojo::gfx::composition::FrameInfo& frame_info,
147 const base::TimeDelta& time_delta) { 147 const base::TimeDelta& time_delta) {
148 // Update the state of the cube. 148 // Update the state of the cube.
149 cube_.UpdateForTimeDelta(time_delta.InSecondsF()); 149 cube_.UpdateForTimeDelta(time_delta.InSecondsF());
150 150
151 // Update the contents of the scene. 151 // Update the contents of the scene.
152 mojo::Rect bounds; 152 mojo::RectF bounds;
153 bounds.width = size_.width; 153 bounds.width = size_.width;
154 bounds.height = size_.height; 154 bounds.height = size_.height;
155 155
156 auto update = mojo::gfx::composition::SceneUpdate::New(); 156 auto update = mojo::gfx::composition::SceneUpdate::New();
157 mojo::gfx::composition::ResourcePtr cube_resource = gl_renderer()->DrawGL( 157 mojo::gfx::composition::ResourcePtr cube_resource = gl_renderer()->DrawGL(
158 size_, true, 158 size_, true,
159 base::Bind(&SpinningCubeView::DrawCubeWithGL, base::Unretained(this))); 159 base::Bind(&SpinningCubeView::DrawCubeWithGL, base::Unretained(this)));
160 DCHECK(cube_resource); 160 DCHECK(cube_resource);
161 update->resources.insert(kCubeImageResourceId, cube_resource.Pass()); 161 update->resources.insert(kCubeImageResourceId, cube_resource.Pass());
162 162
(...skipping 17 matching lines...) Expand all
180 // Loop! 180 // Loop!
181 choreographer_.ScheduleDraw(); 181 choreographer_.ScheduleDraw();
182 } 182 }
183 183
184 void SpinningCubeView::DrawCubeWithGL() { 184 void SpinningCubeView::DrawCubeWithGL() {
185 cube_.set_size(size_.width, size_.height); 185 cube_.set_size(size_.width, size_.height);
186 cube_.Draw(); 186 cube_.Draw();
187 } 187 }
188 188
189 } // namespace examples 189 } // namespace examples
OLDNEW
« no previous file with comments | « examples/ui/shapes/shapes_view.cc ('k') | examples/ui/tile/tile_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698