Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
sk_app::Window_android Class Reference

#include <Window_android.h>

Inheritance diagram for sk_app::Window_android:
sk_app::Window

Public Member Functions

 Window_android ()
 
 ~Window_android () override
 
bool init (SkiaAndroidApp *skiaAndroidApp)
 
void initDisplay (ANativeWindow *window)
 
void onDisplayDestroyed ()
 
void setTitle (const char *) override
 
void show () override
 
bool attach (BackendType) override
 
void onInval () override
 
void setUIState (const char *state) override
 
void paintIfNeeded ()
 
bool scaleContentToFit () const override
 
- Public Member Functions inherited from sk_app::Window
virtual ~Window ()
 
virtual void setTitle (const char *)=0
 
virtual void show ()=0
 
virtual void setUIState (const char *)
 
virtual const char * getClipboardText ()
 
virtual void setClipboardText (const char *)
 
void inval ()
 
virtual bool scaleContentToFit () const
 
virtual bool attach (BackendType)=0
 
void detach ()
 
void pushLayer (Layer *layer)
 
void onBackendCreated ()
 
bool onChar (SkUnichar c, skui::ModifierKey modifiers)
 
bool onKey (skui::Key key, skui::InputState state, skui::ModifierKey modifiers)
 
bool onMouse (int x, int y, skui::InputState state, skui::ModifierKey modifiers)
 
bool onMouseWheel (float delta, int x, int y, skui::ModifierKey modifiers)
 
bool onTouch (intptr_t owner, skui::InputState state, float x, float y)
 
bool onFling (skui::InputState state)
 
bool onPinch (skui::InputState state, float scale, float x, float y)
 
void onUIStateChanged (const SkString &stateName, const SkString &stateValue)
 
void onPaint ()
 
void onResize (int width, int height)
 
void onActivate (bool isActive)
 
int width () const
 
int height () const
 
virtual float scaleFactor () const
 
virtual const DisplayParamsgetRequestedDisplayParams ()
 
virtual void setRequestedDisplayParams (const DisplayParams &, bool allowReattach=true)
 
int sampleCount () const
 
int stencilBits () const
 
GrDirectContextdirectContext () const
 
skgpu::graphite::ContextgraphiteContext () const
 
skgpu::graphite::RecordergraphiteRecorder () const
 

Additional Inherited Members

- Public Types inherited from sk_app::Window
enum  BackendType { kRaster_BackendType , kLast_BackendType = kRaster_BackendType }
 
enum  { kBackendTypeCount = kLast_BackendType + 1 }
 
- Static Public Member Functions inherited from sk_app::Window
static WindowCreateNativeWindow (void *platformData)
 
- Protected Member Functions inherited from sk_app::Window
 Window ()
 
virtual void onInval ()=0
 
void markInvalProcessed ()
 
void visitLayers (const std::function< void(Layer *)> &visitor)
 
bool signalLayers (const std::function< bool(Layer *)> &visitor)
 
- Protected Attributes inherited from sk_app::Window
SkTDArray< Layer * > fLayers
 
DisplayParams fRequestedDisplayParams
 
bool fIsActive = true
 
std::unique_ptr< skwindow::WindowContextfWindowContext
 
bool fIsContentInvalidated = false
 

Detailed Description

Definition at line 16 of file Window_android.h.

Constructor & Destructor Documentation

◆ Window_android()

sk_app::Window_android::Window_android ( )
inline

Definition at line 18 of file Window_android.h.

18: Window() {}

◆ ~Window_android()

sk_app::Window_android::~Window_android ( )
inlineoverride

Definition at line 19 of file Window_android.h.

19{}

Member Function Documentation

◆ attach()

bool sk_app::Window_android::attach ( BackendType  attachType)
overridevirtual

Implements sk_app::Window.

Definition at line 38 of file Window_android.cpp.

38 {
39 fBackendType = attachType;
40
41 // We delay the creation of fWindowContext until Android informs us that
42 // the native window is ready to use.
43 // The creation will be done in initDisplay, which is initiated by kSurfaceCreated event.
44 return true;
45}

◆ init()

bool sk_app::Window_android::init ( SkiaAndroidApp skiaAndroidApp)

Definition at line 23 of file Window_android.cpp.

23 {
24 SkASSERT(skiaAndroidApp);
25 fSkiaAndroidApp = skiaAndroidApp;
26 fSkiaAndroidApp->fWindow = this;
27 return true;
28}
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ initDisplay()

void sk_app::Window_android::initDisplay ( ANativeWindow window)

Definition at line 47 of file Window_android.cpp.

47 {
49 switch (fBackendType) {
50#ifdef SK_GL
51 case kNativeGL_BackendType:
52 default:
54 break;
55#else
56 default:
57#endif
60 break;
61#ifdef SK_VULKAN
62 case kVulkan_BackendType:
64 break;
65#if defined(SK_GRAPHITE)
66 case kGraphiteVulkan_BackendType:
69 break;
70#endif
71#endif
72 }
73 this->onBackendCreated();
74}
@ kRaster_BackendType
Definition: Window.h:90
DisplayParams fRequestedDisplayParams
Definition: Window.h:176
std::unique_ptr< skwindow::WindowContext > fWindowContext
Definition: Window.h:179
void onBackendCreated()
Definition: Window.cpp:44
GLFWwindow * window
Definition: main.cc:45
std::unique_ptr< WindowContext > MakeGraphiteVulkanForAndroid(ANativeWindow *window, const DisplayParams &params)
std::unique_ptr< WindowContext > MakeGLForAndroid(ANativeWindow *window, const DisplayParams &params)
std::unique_ptr< WindowContext > MakeRasterForAndroid(ANativeWindow *window, const DisplayParams &params)
std::unique_ptr< WindowContext > MakeVulkanForAndroid(ANativeWindow *window, const DisplayParams &params)

◆ onDisplayDestroyed()

void sk_app::Window_android::onDisplayDestroyed ( )

Definition at line 76 of file Window_android.cpp.

76 {
77 detach();
78}
void detach()
Definition: Window.cpp:25

◆ onInval()

void sk_app::Window_android::onInval ( )
overridevirtual

Implements sk_app::Window.

Definition at line 80 of file Window_android.cpp.

80 {
81 fSkiaAndroidApp->postMessage(Message(kContentInvalidated));
82}
void postMessage(const Message &message) const

◆ paintIfNeeded()

void sk_app::Window_android::paintIfNeeded ( )

Definition at line 84 of file Window_android.cpp.

84 {
85 if (fWindowContext) { // Check if initDisplay has already been called
86 onPaint();
87 } else {
89 }
90}
void markInvalProcessed()
Definition: Window.cpp:205
void onPaint()
Definition: Window.cpp:81

◆ scaleContentToFit()

bool sk_app::Window_android::scaleContentToFit ( ) const
inlineoverridevirtual

Reimplemented from sk_app::Window.

Definition at line 34 of file Window_android.h.

34{ return true; }

◆ setTitle()

void sk_app::Window_android::setTitle ( const char *  title)
overridevirtual

Implements sk_app::Window.

Definition at line 30 of file Window_android.cpp.

30 {
31 fSkiaAndroidApp->setTitle(title);
32}
void setTitle(const char *title) const

◆ setUIState()

void sk_app::Window_android::setUIState ( const char *  state)
overridevirtual

Reimplemented from sk_app::Window.

Definition at line 34 of file Window_android.cpp.

34 {
35 fSkiaAndroidApp->setUIState(state);
36}
AtkStateType state
void setUIState(const char *state) const

◆ show()

void sk_app::Window_android::show ( )
inlineoverridevirtual

Implements sk_app::Window.

Definition at line 26 of file Window_android.h.

26{}

The documentation for this class was generated from the following files: