aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2016-01-14 05:37:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-14 05:37:51 -0800
commitabc0c8216b8e162b8de74de005f883cb84bd254b (patch)
tree5e3c7fe818ee655f926373a2711b9c17dc9c6663 /include/views
parent24a22c7de8890642e43d6ae1115ecd59e2f8f0db (diff)
SampleApp: Cleanup SkOSWindow_SDL
Implements: * Event loop event waiting (no busy loop) ** Skia timers * Proper window sizing and resizing * MSAA on X11 (previously it did not use MSAA at all) * Changes requested colorspace from 565 to 8888 to match non-SDL variants * Context creation clearing (color and stencil mask) * Opens the window in 640x480 by default on desktop. Removes dead code. BUG=skia:4733 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1578173002 Review URL: https://codereview.chromium.org/1578173002
Diffstat (limited to 'include/views')
-rw-r--r--include/views/SkOSWindow_SDL.h31
1 files changed, 12 insertions, 19 deletions
diff --git a/include/views/SkOSWindow_SDL.h b/include/views/SkOSWindow_SDL.h
index c40ec2e301..e08108add4 100644
--- a/include/views/SkOSWindow_SDL.h
+++ b/include/views/SkOSWindow_SDL.h
@@ -14,16 +14,11 @@
class SkOSWindow : public SkWindow {
public:
- SkOSWindow(void* screen);
+ SkOSWindow(void*);
virtual ~SkOSWindow();
- static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay) {
- SkFAIL("not implemented\n");
- return false;
- }
-
enum SkBackEndTypes {
- kNone_BackEndType,
+ kNone_BackEndType, // TODO: remove this, it's not a real option.
kNativeGL_BackEndType,
#if SK_ANGLE
kANGLE_BackEndType,
@@ -39,25 +34,23 @@ public:
bool makeFullscreen();
void setVsync(bool);
void closeWindow();
- void loop() {
- while (!fQuit) {
- this->handleEvents();
- this->update(nullptr);
- }
- }
+ static void RunEventLoop();
protected:
void onSetTitle(const char title[]) override;
- void onHandleInval(const SkIRect&) override;
- void onPDFSaved(const char title[], const char desc[], const char path[]) override;
private:
- void handleEvents();
- bool fQuit;
- uint32_t fWindowFlags;
+ void createWindow(int msaaSampleCount);
+ void destroyWindow();
+ void updateWindowTitle();
+ static SkOSWindow* GetInstanceForWindowID(Uint32 windowID);
+ static bool HasDirtyWindows();
+ static void UpdateDirtyWindows();
+ static void HandleEvent(const SDL_Event&);
+
SDL_Window* fWindow;
SDL_GLContext fGLContext;
-
+ int fWindowMSAASampleCount;
typedef SkWindow INHERITED;
};