Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: tools/viewer/sk_app/android/Window_android.h

Issue 1952323004: Initial commit of our new Android app to demo Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Merge Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/android/Window_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/android/Window_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698