2016-04-21 14:59:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Window_android_DEFINED
|
|
|
|
#define Window_android_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tools/sk_app/Window.h"
|
|
|
|
#include "tools/sk_app/android/surface_glue_android.h"
|
2016-04-21 14:59:44 +00:00
|
|
|
|
2016-05-04 20:49:13 +00:00
|
|
|
namespace sk_app {
|
|
|
|
|
2016-04-21 14:59:44 +00:00
|
|
|
class Window_android : public Window {
|
|
|
|
public:
|
2016-05-05 19:24:31 +00:00
|
|
|
Window_android() : Window() {}
|
2016-04-21 14:59:44 +00:00
|
|
|
~Window_android() override {}
|
|
|
|
|
2016-05-09 15:49:29 +00:00
|
|
|
bool init(SkiaAndroidApp* skiaAndroidApp);
|
2016-04-21 14:59:44 +00:00
|
|
|
void initDisplay(ANativeWindow* window);
|
2016-05-09 15:49:29 +00:00
|
|
|
void onDisplayDestroyed();
|
2016-04-21 14:59:44 +00:00
|
|
|
|
|
|
|
void setTitle(const char*) override;
|
|
|
|
void show() override {}
|
|
|
|
|
2017-02-24 23:04:47 +00:00
|
|
|
bool attach(BackendType) override;
|
2016-05-23 17:52:34 +00:00
|
|
|
void onInval() override;
|
2017-11-21 18:18:02 +00:00
|
|
|
void setUIState(const char* state) override;
|
2016-05-23 17:52:34 +00:00
|
|
|
|
|
|
|
void paintIfNeeded();
|
2016-04-21 14:59:44 +00:00
|
|
|
|
|
|
|
bool scaleContentToFit() const override { return true; }
|
|
|
|
|
|
|
|
private:
|
2016-05-09 15:49:29 +00:00
|
|
|
SkiaAndroidApp* fSkiaAndroidApp = nullptr;
|
2016-06-02 19:16:25 +00:00
|
|
|
BackendType fBackendType;
|
2016-04-21 14:59:44 +00:00
|
|
|
};
|
|
|
|
|
2016-05-04 20:49:13 +00:00
|
|
|
} // namespace sk_app
|
|
|
|
|
2016-04-21 14:59:44 +00:00
|
|
|
#endif
|