| Index: tools/vulkan/android/Window_android.h
|
| diff --git a/tools/vulkan/android/Window_android.h b/tools/vulkan/android/Window_android.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a4805bd74c065827a0efced8b63dcb6493efe8c8
|
| --- /dev/null
|
| +++ b/tools/vulkan/android/Window_android.h
|
| @@ -0,0 +1,48 @@
|
| +/*
|
| +* 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
|
| +
|
| +#include "../Window.h"
|
| +#include <android_native_app_glue.h>
|
| +
|
| +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);
|
| + void initDisplay(ANativeWindow* window);
|
| +
|
| + void setTitle(const char*) override;
|
| + void show() override {}
|
| +
|
| + bool attach(BackEndType attachType, int msaaSampleCount, AttachmentInfo*) 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); }
|
| +
|
| +private:
|
| + android_app* mApp = nullptr;
|
| + SkRect mContentRect;
|
| + int mSampleCount = 0;
|
| +};
|
| +
|
| +#endif
|
|
|