| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2016 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef Window_android_DEFINED | |
| 9 #define Window_android_DEFINED | |
| 10 | |
| 11 #include "../Window.h" | |
| 12 #include <android_native_app_glue.h> | |
| 13 | |
| 14 enum { | |
| 15 /** | |
| 16 * Leave plenty of space between this item and the ones defined in the glue
layer | |
| 17 */ | |
| 18 APP_CMD_INVAL_WINDOW = 64, | |
| 19 }; | |
| 20 | |
| 21 class Window_android : public Window { | |
| 22 public: | |
| 23 Window_android() : Window() {} | |
| 24 ~Window_android() override {} | |
| 25 | |
| 26 bool init(android_app* app_state); | |
| 27 void initDisplay(ANativeWindow* window); | |
| 28 | |
| 29 void setTitle(const char*) override; | |
| 30 void show() override {} | |
| 31 | |
| 32 bool attach(BackEndType attachType, int msaaSampleCount) override; | |
| 33 void inval() override; | |
| 34 | |
| 35 void paintIfNeeded(); | |
| 36 | |
| 37 bool scaleContentToFit() const override { return true; } | |
| 38 bool supportsContentRect() const override { return true; } | |
| 39 SkRect getContentRect() override { return mContentRect; } | |
| 40 void setContentRect(int l, int t, int r, int b) { mContentRect.set(l,t,r,b);
} | |
| 41 | |
| 42 private: | |
| 43 android_app* mApp = nullptr; | |
| 44 SkRect mContentRect; | |
| 45 int mSampleCount = 0; | |
| 46 }; | |
| 47 | |
| 48 #endif | |
| OLD | NEW |