Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: include/views/SkOSWindow_SDL.h

Issue 1413593007: Create SDL backed SkOSWindow (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/gl/SkGLContext.h ('k') | src/views/sdl/SkOSWindow_SDL.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « include/gpu/gl/SkGLContext.h ('k') | src/views/sdl/SkOSWindow_SDL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698