caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 1 | /* |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 7 | |
| 8 | #ifndef HelloWorld_DEFINED |
| 9 | #define HelloWorld_DEFINED |
| 10 | |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 11 | #include "sk_app/Application.h" |
| 12 | #include "sk_app/Window.h" |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 13 | |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 14 | class SkCanvas; |
| 15 | |
Brian Osman | 80fc07e | 2017-12-08 16:45:43 -0500 | [diff] [blame] | 16 | class HelloWorld : public sk_app::Application, sk_app::Window::Layer { |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 17 | public: |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 18 | HelloWorld(int argc, char** argv, void* platformData); |
| 19 | ~HelloWorld() override; |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 20 | |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 21 | void onIdle() override; |
Brian Osman | 80fc07e | 2017-12-08 16:45:43 -0500 | [diff] [blame] | 22 | |
| 23 | void onBackendCreated() override; |
| 24 | void onPaint(SkCanvas* canvas) override; |
| 25 | bool onChar(SkUnichar c, uint32_t modifiers) override; |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 26 | |
| 27 | private: |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 28 | void updateTitle(); |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 29 | |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 30 | sk_app::Window* fWindow; |
| 31 | sk_app::Window::BackendType fBackendType; |
| 32 | |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 33 | SkScalar fRotationAngle; |
caryclark | 52edc4d | 2015-02-02 12:55:14 -0800 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #endif |