Home | History | Annotate | Download | only in example
      1 /*
      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 */
      7 
      8 #ifndef HelloWorld_DEFINED
      9 #define HelloWorld_DEFINED
     10 
     11 #include "sk_app/Application.h"
     12 #include "sk_app/Window.h"
     13 
     14 class SkCanvas;
     15 
     16 class HelloWorld : public sk_app::Application, sk_app::Window::Layer {
     17 public:
     18     HelloWorld(int argc, char** argv, void* platformData);
     19     ~HelloWorld() override;
     20 
     21     void onIdle() override;
     22 
     23     void onBackendCreated() override;
     24     void onPaint(SkCanvas* canvas) override;
     25     bool onChar(SkUnichar c, uint32_t modifiers) override;
     26 
     27 private:
     28     void updateTitle();
     29 
     30     sk_app::Window* fWindow;
     31     sk_app::Window::BackendType fBackendType;
     32 
     33     SkScalar fRotationAngle;
     34 };
     35 
     36 #endif
     37