Index: tools/viewer/sk_app/android/Window_android.h |
diff --git a/tools/viewer/sk_app/android/Window_android.h b/tools/viewer/sk_app/android/Window_android.h |
index b57061507533b7c50fd52e12eaa83845f3bd47a8..45e5bbe744a634937d6264b39462301c1c11f47d 100644 |
--- a/tools/viewer/sk_app/android/Window_android.h |
+++ b/tools/viewer/sk_app/android/Window_android.h |
@@ -9,24 +9,18 @@ |
#define Window_android_DEFINED |
#include "../Window.h" |
-#include <android_native_app_glue.h> |
+#include "surface_glue_android.h" |
namespace sk_app { |
-enum { |
- /** |
- * Leave plenty of space between this item and the ones defined in the glue layer |
- */ |
- APP_CMD_INVAL_WINDOW = 64, |
-}; |
- |
class Window_android : public Window { |
public: |
Window_android() : Window() {} |
~Window_android() override {} |
- bool init(android_app* app_state); |
+ bool init(SkiaAndroidApp* skiaAndroidApp); |
void initDisplay(ANativeWindow* window); |
+ void onDisplayDestroyed(); |
void setTitle(const char*) override; |
void show() override {} |
@@ -34,17 +28,16 @@ public: |
bool attach(BackEndType attachType, const DisplayParams& params) override; |
void inval() override; |
- void paintIfNeeded(); |
- |
bool scaleContentToFit() const override { return true; } |
bool supportsContentRect() const override { return true; } |
- SkRect getContentRect() override { return mContentRect; } |
- void setContentRect(int l, int t, int r, int b) { mContentRect.set(l,t,r,b); } |
+ SkRect getContentRect() override { return fContentRect; } |
+ void setContentRect(int l, int t, int r, int b) { fContentRect.set(l,t,r,b); } |
private: |
- android_app* mApp = nullptr; |
- SkRect mContentRect; |
+ SkiaAndroidApp* fSkiaAndroidApp = nullptr; |
+ SkRect fContentRect; |
DisplayParams fDisplayParams; |
+ bool fNativeWindowInitialized = false; |
}; |
} // namespace sk_app |