Chromium Code Reviews| 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..1be390ad098d5b593ea29e136d7ed27600a93b09 100644 |
| --- a/tools/viewer/sk_app/mac/Window_mac.h |
| +++ b/tools/viewer/sk_app/mac/Window_mac.h |
| @@ -11,26 +11,19 @@ |
| #include "../Window.h" |
| #include "SkChecksum.h" |
| #include "SkTDynamicHash.h" |
| +#include "SDL.h" |
| namespace sk_app { |
| class Window_mac : public Window { |
| public: |
|
robertphillips
2016/08/03 21:22:04
put the ':' on its own line and line every one up
jvanverth1
2016/08/04 15:28:33
Done.
|
| Window_mac() : Window() |
| -#if 0 |
| - // TODO: use Mac-specific objects |
| - , fDisplay(nullptr) |
| - , fWindow(0) |
| - , fGC(nullptr) |
| - , fVisualInfo(nullptr) |
| -#endif |
| + , 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,16 +32,23 @@ public: |
| void onInval() override; |
| + bool handleEvent(const SDL_Event& event); |
| + |
| + static const Uint32& GetKey(const Window_mac& w) { |
| + return w.fWindowID; |
| + } |
| + |
| + static uint32_t Hash(const Uint32& winID) { |
| + return winID; |
| + } |
| + |
|
robertphillips
2016/08/03 21:22:05
Does this need to be public ?
jvanverth1
2016/08/04 15:28:33
The main loop used it to know which window to send
|
| + static SkTDynamicHash<Window_mac, Uint32> gWindowMap; |
| + |
| private: |
| void closeWindow(); |
| -#if 0 |
| - // TODO: use Mac-specific window data |
| - Display* fDisplay; |
| - XWindow fWindow; |
| - GC fGC; |
| - XVisualInfo* fVisualInfo; |
| -#endif |
| + SDL_Window* fWindow; |
| + Uint32 fWindowID; |
| int fMSAASampleCount; |
| }; |