HelloWorld.h 770 B

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef HelloWorld_DEFINED
  8. #define HelloWorld_DEFINED
  9. #include "tools/sk_app/Application.h"
  10. #include "tools/sk_app/Window.h"
  11. class SkCanvas;
  12. class HelloWorld : public sk_app::Application, sk_app::Window::Layer {
  13. public:
  14. HelloWorld(int argc, char** argv, void* platformData);
  15. ~HelloWorld() override;
  16. void onIdle() override;
  17. void onBackendCreated() override;
  18. void onPaint(SkSurface*) override;
  19. bool onChar(SkUnichar c, ModifierKey modifiers) override;
  20. private:
  21. void updateTitle();
  22. sk_app::Window* fWindow;
  23. sk_app::Window::BackendType fBackendType;
  24. SkScalar fRotationAngle;
  25. };
  26. #endif