blob: 28715fe89b940be3ab638eee67871e5d40c3c080 [file] [log] [blame]
caryclark52edc4d2015-02-02 12:55:14 -08001/*
Brian Osmaneff04b52017-11-21 13:18:02 -05002* 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*/
caryclark52edc4d2015-02-02 12:55:14 -08007
8#ifndef HelloWorld_DEFINED
9#define HelloWorld_DEFINED
10
Brian Osmaneff04b52017-11-21 13:18:02 -050011#include "sk_app/Application.h"
12#include "sk_app/Window.h"
caryclark52edc4d2015-02-02 12:55:14 -080013
caryclark52edc4d2015-02-02 12:55:14 -080014class SkCanvas;
15
Brian Osman80fc07e2017-12-08 16:45:43 -050016class HelloWorld : public sk_app::Application, sk_app::Window::Layer {
caryclark52edc4d2015-02-02 12:55:14 -080017public:
Brian Osmaneff04b52017-11-21 13:18:02 -050018 HelloWorld(int argc, char** argv, void* platformData);
19 ~HelloWorld() override;
caryclark52edc4d2015-02-02 12:55:14 -080020
Brian Osmaneff04b52017-11-21 13:18:02 -050021 void onIdle() override;
Brian Osman80fc07e2017-12-08 16:45:43 -050022
23 void onBackendCreated() override;
24 void onPaint(SkCanvas* canvas) override;
25 bool onChar(SkUnichar c, uint32_t modifiers) override;
caryclark52edc4d2015-02-02 12:55:14 -080026
27private:
Brian Osmaneff04b52017-11-21 13:18:02 -050028 void updateTitle();
caryclark52edc4d2015-02-02 12:55:14 -080029
Brian Osmaneff04b52017-11-21 13:18:02 -050030 sk_app::Window* fWindow;
31 sk_app::Window::BackendType fBackendType;
32
caryclark52edc4d2015-02-02 12:55:14 -080033 SkScalar fRotationAngle;
caryclark52edc4d2015-02-02 12:55:14 -080034};
35
36#endif