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
|
|
|
|
|
2022-04-29 14:23:46 +00:00
|
|
|
#include "include/core/SkScalar.h"
|
|
|
|
#include "include/core/SkTypes.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tools/sk_app/Application.h"
|
|
|
|
#include "tools/sk_app/Window.h"
|
2022-04-29 14:23:46 +00:00
|
|
|
#include "tools/skui/ModifierKey.h"
|
2015-02-02 20:55:14 +00:00
|
|
|
|
2022-04-29 14:23:46 +00:00
|
|
|
class SkSurface;
|
2015-02-02 20:55:14 +00:00
|
|
|
|
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;
|
2019-03-04 16:00:10 +00:00
|
|
|
void onPaint(SkSurface*) override;
|
2019-08-29 14:39:22 +00:00
|
|
|
bool onChar(SkUnichar c, skui::ModifierKey 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
|