Window_android.h 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef Window_android_DEFINED
  8. #define Window_android_DEFINED
  9. #include "tools/sk_app/Window.h"
  10. #include "tools/sk_app/android/surface_glue_android.h"
  11. namespace sk_app {
  12. class Window_android : public Window {
  13. public:
  14. Window_android() : Window() {}
  15. ~Window_android() override {}
  16. bool init(SkiaAndroidApp* skiaAndroidApp);
  17. void initDisplay(ANativeWindow* window);
  18. void onDisplayDestroyed();
  19. void setTitle(const char*) override;
  20. void show() override {}
  21. bool attach(BackendType) override;
  22. void onInval() override;
  23. void setUIState(const char* state) override;
  24. void paintIfNeeded();
  25. bool scaleContentToFit() const override { return true; }
  26. private:
  27. SkiaAndroidApp* fSkiaAndroidApp = nullptr;
  28. BackendType fBackendType;
  29. };
  30. } // namespace sk_app
  31. #endif