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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Window_mac_DEFINED 8 #ifndef Window_mac_DEFINED
9 #define Window_mac_DEFINED 9 #define Window_mac_DEFINED
10 10
11 #include "../Window.h" 11 #include "../Window.h"
12 #include "SkChecksum.h" 12 #include "SkChecksum.h"
13 #include "SkTDynamicHash.h" 13 #include "SkTDynamicHash.h"
14 #include "SDL.h"
14 15
15 namespace sk_app { 16 namespace sk_app {
16 17
17 class Window_mac : public Window { 18 class Window_mac : public Window {
18 public: 19 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.
19 Window_mac() : Window() 20 Window_mac() : Window()
20 #if 0 21 , fWindow(nullptr)
21 // TODO: use Mac-specific objects 22 , fWindowID(0)
22 , fDisplay(nullptr)
23 , fWindow(0)
24 , fGC(nullptr)
25 , fVisualInfo(nullptr)
26 #endif
27 , fMSAASampleCount(0) {} 23 , fMSAASampleCount(0) {}
28 ~Window_mac() override { this->closeWindow(); } 24 ~Window_mac() override { this->closeWindow(); }
29 25
30 #if 0 26 bool initWindow(const DisplayParams* params);
31 // TODO: need to init with Mac-specific data
32 bool initWindow(Display* display, const DisplayParams* params);
33 #endif
34 27
35 void setTitle(const char*) override; 28 void setTitle(const char*) override;
36 void show() override; 29 void show() override;
37 30
38 bool attach(BackendType attachType, const DisplayParams& params) override; 31 bool attach(BackendType attachType, const DisplayParams& params) override;
39 32
40 void onInval() override; 33 void onInval() override;
41 34
35 bool handleEvent(const SDL_Event& event);
36
37 static const Uint32& GetKey(const Window_mac& w) {
38 return w.fWindowID;
39 }
40
41 static uint32_t Hash(const Uint32& winID) {
42 return winID;
43 }
44
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
45 static SkTDynamicHash<Window_mac, Uint32> gWindowMap;
46
42 private: 47 private:
43 void closeWindow(); 48 void closeWindow();
44 49
45 #if 0 50 SDL_Window* fWindow;
46 // TODO: use Mac-specific window data 51 Uint32 fWindowID;
47 Display* fDisplay;
48 XWindow fWindow;
49 GC fGC;
50 XVisualInfo* fVisualInfo;
51 #endif
52 52
53 int fMSAASampleCount; 53 int fMSAASampleCount;
54 }; 54 };
55 55
56 } // namespace sk_app 56 } // namespace sk_app
57 57
58 #endif 58 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698