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

Side by Side Diff: apps/moterm/moterm_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 | « no previous file | examples/ui/noodles/rasterizer.cc » ('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 "apps/moterm/moterm_view.h" 5 #include "apps/moterm/moterm_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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } 219 }
220 force_next_draw_ = false; 220 force_next_draw_ = false;
221 choreographer_.ScheduleDraw(); 221 choreographer_.ScheduleDraw();
222 } 222 }
223 223
224 void MotermView::OnDraw(const mojo::gfx::composition::FrameInfo& frame_info, 224 void MotermView::OnDraw(const mojo::gfx::composition::FrameInfo& frame_info,
225 const base::TimeDelta& time_delta) { 225 const base::TimeDelta& time_delta) {
226 // TODO(vtl): Draw only the dirty region(s)? 226 // TODO(vtl): Draw only the dirty region(s)?
227 model_state_changes_.Reset(); 227 model_state_changes_.Reset();
228 228
229 mojo::Rect bounds; 229 mojo::RectF bounds;
230 bounds.width = view_size_.width; 230 bounds.width = view_size_.width;
231 bounds.height = view_size_.height; 231 bounds.height = view_size_.height;
232 232
233 auto update = mojo::gfx::composition::SceneUpdate::New(); 233 auto update = mojo::gfx::composition::SceneUpdate::New();
234 mojo::gfx::composition::ResourcePtr moterm_resource = 234 mojo::gfx::composition::ResourcePtr moterm_resource =
235 ganesh_renderer()->DrawCanvas( 235 ganesh_renderer()->DrawCanvas(
236 view_size_, 236 view_size_,
237 base::Bind(&MotermView::DrawContent, base::Unretained(this))); 237 base::Bind(&MotermView::DrawContent, base::Unretained(this)));
238 DCHECK(moterm_resource); 238 DCHECK(moterm_resource);
239 update->resources.insert(kMotermImageResourceId, moterm_resource.Pass()); 239 update->resources.insert(kMotermImageResourceId, moterm_resource.Pass());
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 void MotermView::OnKeyPressed(mojo::EventPtr key_event) { 320 void MotermView::OnKeyPressed(mojo::EventPtr key_event) {
321 std::string input_sequence = 321 std::string input_sequence =
322 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_); 322 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_);
323 if (input_sequence.empty()) 323 if (input_sequence.empty())
324 return; 324 return;
325 325
326 if (driver_) 326 if (driver_)
327 driver_->SendData(input_sequence.data(), input_sequence.size()); 327 driver_->SendData(input_sequence.data(), input_sequence.size());
328 } 328 }
OLDNEW
« no previous file with comments | « no previous file | examples/ui/noodles/rasterizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698