OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
8 #include "mojo/common/binding_set.h" | 8 #include "mojo/common/binding_set.h" |
9 #include "mojo/gpu/gl_texture.h" | 9 #include "mojo/gpu/gl_texture.h" |
10 #include "mojo/gpu/texture_cache.h" | 10 #include "mojo/gpu/texture_cache.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 paint.setFlags(SkPaint::kAntiAlias_Flag); | 197 paint.setFlags(SkPaint::kAntiAlias_Flag); |
198 canvas->drawCircle(circle.point.x(), circle.point.y(), 50, paint); | 198 canvas->drawCircle(circle.point.x(), circle.point.y(), 50, paint); |
199 } | 199 } |
200 | 200 |
201 canvas->flush(); | 201 canvas->flush(); |
202 } | 202 } |
203 | 203 |
204 // mojo::ViewObserver | 204 // mojo::ViewObserver |
205 void OnViewInputEvent(mojo::View* view, | 205 void OnViewInputEvent(mojo::View* view, |
206 const mojo::EventPtr& event) override { | 206 const mojo::EventPtr& event) override { |
207 if (event->action == mojo::EVENT_TYPE_POINTER_DOWN || | 207 if (event->action == mojo::EventType::POINTER_DOWN || |
208 event->action == mojo::EVENT_TYPE_POINTER_MOVE) { | 208 event->action == mojo::EventType::POINTER_MOVE) { |
209 if (event->pointer_data) { | 209 if (event->pointer_data) { |
210 gfx::Point point(event->pointer_data->x, event->pointer_data->y); | 210 gfx::Point point(event->pointer_data->x, event->pointer_data->y); |
211 | 211 |
212 int r = rand() % 256; | 212 int r = rand() % 256; |
213 int g = rand() % 256; | 213 int g = rand() % 256; |
214 int b = rand() % 256; | 214 int b = rand() % 256; |
215 CircleData circle_data; | 215 CircleData circle_data; |
216 circle_data.point = point; | 216 circle_data.point = point; |
217 circle_data.color = SkColorSetARGB(0xFF, r, g, b); | 217 circle_data.color = SkColorSetARGB(0xFF, r, g, b); |
218 circles_.push_back(circle_data); | 218 circles_.push_back(circle_data); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 DISALLOW_COPY_AND_ASSIGN(NfcSenderDelegate); | 315 DISALLOW_COPY_AND_ASSIGN(NfcSenderDelegate); |
316 }; | 316 }; |
317 | 317 |
318 } // namespace examples | 318 } // namespace examples |
319 | 319 |
320 MojoResult MojoMain(MojoHandle application_request) { | 320 MojoResult MojoMain(MojoHandle application_request) { |
321 mojo::ApplicationRunnerChromium runner(new examples::NfcSenderDelegate); | 321 mojo::ApplicationRunnerChromium runner(new examples::NfcSenderDelegate); |
322 return runner.Run(application_request); | 322 return runner.Run(application_request); |
323 } | 323 } |
OLD | NEW |