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

Side by Side Diff: apps/moterm/moterm_view.cc

Issue 1776473005: Mozart: Implement basic input event dispatch with hit testing. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-7
Patch Set: 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
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
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());
240 240
241 auto root_node = mojo::gfx::composition::Node::New(); 241 auto root_node = mojo::gfx::composition::Node::New();
242 root_node->hit_test_behavior = mojo::gfx::composition::HitTestBehavior::New();
242 root_node->op = mojo::gfx::composition::NodeOp::New(); 243 root_node->op = mojo::gfx::composition::NodeOp::New();
243 root_node->op->set_image(mojo::gfx::composition::ImageNodeOp::New()); 244 root_node->op->set_image(mojo::gfx::composition::ImageNodeOp::New());
244 root_node->op->get_image()->content_rect = bounds.Clone(); 245 root_node->op->get_image()->content_rect = bounds.Clone();
245 root_node->op->get_image()->image_resource_id = kMotermImageResourceId; 246 root_node->op->get_image()->image_resource_id = kMotermImageResourceId;
246 update->nodes.insert(kRootNodeId, root_node.Pass()); 247 update->nodes.insert(kRootNodeId, root_node.Pass());
247 248
248 auto metadata = mojo::gfx::composition::SceneMetadata::New(); 249 auto metadata = mojo::gfx::composition::SceneMetadata::New();
249 metadata->presentation_time = frame_info.presentation_time; 250 metadata->presentation_time = frame_info.presentation_time;
250 251
251 scene()->Update(update.Pass()); 252 scene()->Update(update.Pass());
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 319
319 void MotermView::OnKeyPressed(mojo::EventPtr key_event) { 320 void MotermView::OnKeyPressed(mojo::EventPtr key_event) {
320 std::string input_sequence = 321 std::string input_sequence =
321 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_); 322 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_);
322 if (input_sequence.empty()) 323 if (input_sequence.empty())
323 return; 324 return;
324 325
325 if (driver_) 326 if (driver_)
326 driver_->SendData(input_sequence.data(), input_sequence.size()); 327 driver_->SendData(input_sequence.data(), input_sequence.size());
327 } 328 }
OLDNEW
« no previous file with comments | « no previous file | examples/ui/pdf_viewer/pdf_viewer.cc » ('j') | mojo/services/geometry/cpp/geometry_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698