Home | History | Annotate | Download | only in android
      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 "surface_glue_android.h"
     13 
     14 namespace sk_app {
     15 
     16 class Window_android : public Window {
     17 public:
     18     Window_android() : Window() {}
     19     ~Window_android() override {}
     20 
     21     bool init(SkiaAndroidApp* skiaAndroidApp);
     22     void initDisplay(ANativeWindow* window);
     23     void onDisplayDestroyed();
     24 
     25     void setTitle(const char*) override;
     26     void show() override {}
     27 
     28     bool attach(BackendType) override;
     29     void onInval() override;
     30     void setUIState(const char* state) override;
     31 
     32     void paintIfNeeded();
     33 
     34     bool scaleContentToFit() const override { return true; }
     35 
     36 private:
     37     SkiaAndroidApp* fSkiaAndroidApp = nullptr;
     38     BackendType fBackendType;
     39 };
     40 
     41 }   // namespace sk_app
     42 
     43 #endif
     44