2015-02-02 20:55:14 +00:00
|
|
|
/*
|
2017-11-21 18:18:02 +00:00
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2015-02-02 20:55:14 +00:00
|
|
|
|
|
|
|
#ifndef HelloWorld_DEFINED
|
|
|
|
#define HelloWorld_DEFINED
|
|
|
|
|
2017-11-21 18:18:02 +00:00
|
|
|
#include "sk_app/Application.h"
|
|
|
|
#include "sk_app/Window.h"
|
2015-02-02 20:55:14 +00:00
|
|
|
|
|
|
|
class SkCanvas;
|
|
|
|
|
2017-12-08 21:45:43 +00:00
|
|
|
class HelloWorld : public sk_app::Application, sk_app::Window::Layer {
|
2015-02-02 20:55:14 +00:00
|
|
|
public:
|
2017-11-21 18:18:02 +00:00
|
|
|
HelloWorld(int argc, char** argv, void* platformData);
|
|
|
|
~HelloWorld() override;
|
2015-02-02 20:55:14 +00:00
|
|
|
|
2017-11-21 18:18:02 +00:00
|
|
|
void onIdle() override;
|
2017-12-08 21:45:43 +00:00
|
|
|
|
|
|
|
void onBackendCreated() override;
|
|
|
|
void onPaint(SkCanvas* canvas) override;
|
|
|
|
bool onChar(SkUnichar c, uint32_t modifiers) override;
|
2015-02-02 20:55:14 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-21 18:18:02 +00:00
|
|
|
void updateTitle();
|
2015-02-02 20:55:14 +00:00
|
|
|
|
2017-11-21 18:18:02 +00:00
|
|
|
sk_app::Window* fWindow;
|
|
|
|
sk_app::Window::BackendType fBackendType;
|
2015-02-02 20:55:14 +00:00
|
|
|
|
2017-11-21 18:18:02 +00:00
|
|
|
SkScalar fRotationAngle;
|
2015-02-02 20:55:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|