| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef Window_android_DEFINED | 8 #ifndef Window_android_DEFINED |
| 9 #define Window_android_DEFINED | 9 #define Window_android_DEFINED |
| 10 | 10 |
| 11 #include "../Window.h" | 11 #include "../Window.h" |
| 12 #include "surface_glue_android.h" | 12 #include "surface_glue_android.h" |
| 13 | 13 |
| 14 namespace sk_app { | 14 namespace sk_app { |
| 15 | 15 |
| 16 class Window_android : public Window { | 16 class Window_android : public Window { |
| 17 public: | 17 public: |
| 18 Window_android() : Window() {} | 18 Window_android() : Window() {} |
| 19 ~Window_android() override {} | 19 ~Window_android() override {} |
| 20 | 20 |
| 21 bool init(SkiaAndroidApp* skiaAndroidApp); | 21 bool init(SkiaAndroidApp* skiaAndroidApp); |
| 22 void initDisplay(ANativeWindow* window); | 22 void initDisplay(ANativeWindow* window); |
| 23 void onDisplayDestroyed(); | 23 void onDisplayDestroyed(); |
| 24 | 24 |
| 25 const DisplayParams& getDisplayParams() override; |
| 25 void setTitle(const char*) override; | 26 void setTitle(const char*) override; |
| 26 void show() override {} | 27 void show() override {} |
| 27 | 28 |
| 28 bool attach(BackEndType attachType, const DisplayParams& params) override; | 29 bool attach(BackEndType attachType, const DisplayParams& params) override; |
| 29 void inval() override; | 30 void inval() override; |
| 30 | 31 |
| 31 bool scaleContentToFit() const override { return true; } | 32 bool scaleContentToFit() const override { return true; } |
| 32 bool supportsContentRect() const override { return true; } | 33 bool supportsContentRect() const override { return true; } |
| 33 SkRect getContentRect() override { return fContentRect; } | 34 SkRect getContentRect() override { return fContentRect; } |
| 34 void setContentRect(int l, int t, int r, int b) { fContentRect.set(l,t,r,b);
} | 35 void setContentRect(int l, int t, int r, int b) { fContentRect.set(l,t,r,b);
} |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 SkiaAndroidApp* fSkiaAndroidApp = nullptr; | 38 SkiaAndroidApp* fSkiaAndroidApp = nullptr; |
| 38 SkRect fContentRect; | 39 SkRect fContentRect; |
| 39 DisplayParams fDisplayParams; | 40 DisplayParams fDisplayParams; |
| 40 bool fNativeWindowInitialized = false; | |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace sk_app | 43 } // namespace sk_app |
| 44 | 44 |
| 45 #endif | 45 #endif |
| OLD | NEW |