Index: include/views/SkOSWindow_SDL.h |
diff --git a/include/views/SkOSWindow_SDL.h b/include/views/SkOSWindow_SDL.h |
index e6b59e6511f9be88c89297ad5b1cd17c33996df2..532cf747283c9841df2ae8a96c355d54c972a212 100644 |
--- a/include/views/SkOSWindow_SDL.h |
+++ b/include/views/SkOSWindow_SDL.h |
@@ -11,32 +11,51 @@ |
#define SkOSWindow_SDL_DEFINED |
#include "SDL.h" |
+#include "SDL_opengl.h" |
#include "SkWindow.h" |
-class SkGLCanvas; |
class SkOSWindow : public SkWindow { |
public: |
SkOSWindow(void* screen); |
virtual ~SkOSWindow(); |
- static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); |
- |
- void handleSDLEvent(const SDL_Event& event); |
+ static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay) { SkFAIL("not implemented\n"); |
+ return false; |
+ } |
+ |
+ enum SkBackEndTypes { |
+ kNone_BackEndType, |
+ kNativeGL_BackEndType, |
+#if SK_ANGLE |
+ kANGLE_BackEndType, |
+#endif // SK_ANGLE |
+#if SK_COMMAND_BUFFER |
+ kCommandBuffer_BackEndType, |
+#endif // SK_COMMAND_BUFFER |
+ }; |
+ |
+ void detach(); |
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*); |
+ void present(); |
+ bool makeFullscreen(); |
+ void setVsync(bool); |
+ void closeWindow(); |
+ void loop() { |
+ while (!fQuit) { |
+ this->handleEvents(); |
+ this->update(nullptr); |
+ } |
+ } |
protected: |
- // overrides from SkWindow |
- virtual void onHandleInval(const SkIRect&); |
- // overrides from SkView |
- virtual void onAddMenu(const SkOSMenu*); |
- virtual void onSetTitle(const char[]); |
+ void onSetTitle(const char title[]) override; |
private: |
- SDL_Surface* fScreen; |
- SDL_Surface* fSurface; |
- SkGLCanvas* fGLCanvas; |
- |
- void doDraw(); |
+ void handleEvents(); |
+ bool fQuit; |
+ SDL_Window* fWindow; |
+ SDL_GLContext fGLContext; |
typedef SkWindow INHERITED; |
}; |