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

Unified Diff: tools/viewer/sk_app/mac/Window_mac.h

Issue 2210603003: Get Mac viewer working with SDL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix patch Created 4 years, 4 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 | « tools/viewer/sk_app/mac/WindowContextFactory_mac.h ('k') | tools/viewer/sk_app/mac/Window_mac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/mac/Window_mac.h
diff --git a/tools/viewer/sk_app/mac/Window_mac.h b/tools/viewer/sk_app/mac/Window_mac.h
index a5f2aa10f0cf34e1ff2f2ad09ded67fa7f917a9a..19211aef187e81d1cbe6b1e3f1c2745161bef15c 100644
--- a/tools/viewer/sk_app/mac/Window_mac.h
+++ b/tools/viewer/sk_app/mac/Window_mac.h
@@ -12,25 +12,20 @@
#include "SkChecksum.h"
#include "SkTDynamicHash.h"
+#include "SDL.h"
+
namespace sk_app {
class Window_mac : public Window {
public:
- Window_mac() : Window()
-#if 0
- // TODO: use Mac-specific objects
- , fDisplay(nullptr)
- , fWindow(0)
- , fGC(nullptr)
- , fVisualInfo(nullptr)
-#endif
- , fMSAASampleCount(0) {}
+ Window_mac()
+ : INHERITED()
+ , fWindow(nullptr)
+ , fWindowID(0)
+ , fMSAASampleCount(0) {}
~Window_mac() override { this->closeWindow(); }
-#if 0
- // TODO: need to init with Mac-specific data
- bool initWindow(Display* display, const DisplayParams* params);
-#endif
+ bool initWindow(const DisplayParams* params);
void setTitle(const char*) override;
void show() override;
@@ -39,18 +34,29 @@ public:
void onInval() override;
+ static bool HandleWindowEvent(const SDL_Event& event);
+
+ static const Uint32& GetKey(const Window_mac& w) {
+ return w.fWindowID;
+ }
+
+ static uint32_t Hash(const Uint32& winID) {
+ return winID;
+ }
+
private:
+ bool handleEvent(const SDL_Event& event);
+
void closeWindow();
-#if 0
- // TODO: use Mac-specific window data
- Display* fDisplay;
- XWindow fWindow;
- GC fGC;
- XVisualInfo* fVisualInfo;
-#endif
+ static SkTDynamicHash<Window_mac, Uint32> gWindowMap;
+
+ SDL_Window* fWindow;
+ Uint32 fWindowID;
int fMSAASampleCount;
+
+ typedef Window INHERITED;
};
} // namespace sk_app
« no previous file with comments | « tools/viewer/sk_app/mac/WindowContextFactory_mac.h ('k') | tools/viewer/sk_app/mac/Window_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698