OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkOSWindow_MacCocoa_DEFINED | 9 #ifndef SkOSWindow_MacCocoa_DEFINED |
10 #define SkOSWindow_MacCocoa_DEFINED | 10 #define SkOSWindow_MacCocoa_DEFINED |
11 | 11 |
12 #include "SkWindow.h" | 12 #include "SkWindow.h" |
13 | 13 |
14 class SkOSWindow : public SkWindow { | 14 class SkOSWindow : public SkWindow { |
15 public: | 15 public: |
16 SkOSWindow(void* hwnd); | 16 SkOSWindow(void* hwnd); |
17 ~SkOSWindow(); | 17 ~SkOSWindow(); |
18 void* getHWND() const { return fHWND; } | 18 void* getHWND() const { return fHWND; } |
19 | 19 |
20 virtual bool onDispatchClick(int x, int y, Click::State state, | 20 virtual bool onDispatchClick(int x, int y, Click::State state, |
21 void* owner, unsigned modi); | 21 void* owner, unsigned modi); |
22 enum SkBackEndTypes { | 22 enum SkBackEndTypes { |
23 kNone_BackEndType, | 23 kNone_BackEndType, |
24 #if SK_SUPPORT_GPU | 24 #if SK_SUPPORT_GPU |
25 kNativeGL_BackEndType, | 25 kNativeGL_BackEndType, |
26 #endif | 26 #endif |
27 }; | 27 }; |
28 | 28 |
| 29 struct AttachmentInfo { |
| 30 int fSampleCount; |
| 31 int fStencilBits; |
| 32 }; |
| 33 |
29 void detach(); | 34 void detach(); |
30 bool attach(SkBackEndTypes attachType, int msaaSampleCount); | 35 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInf
o*); |
31 void present(); | 36 void present(); |
32 | 37 |
33 protected: | 38 protected: |
34 // overrides from SkEventSink | 39 // overrides from SkEventSink |
35 virtual bool onEvent(const SkEvent& evt); | 40 virtual bool onEvent(const SkEvent& evt); |
36 // overrides from SkWindow | 41 // overrides from SkWindow |
37 virtual void onHandleInval(const SkIRect&); | 42 virtual void onHandleInval(const SkIRect&); |
38 // overrides from SkView | 43 // overrides from SkView |
39 virtual void onAddMenu(const SkOSMenu*); | 44 virtual void onAddMenu(const SkOSMenu*); |
40 virtual void onUpdateMenu(const SkOSMenu*); | 45 virtual void onUpdateMenu(const SkOSMenu*); |
41 virtual void onSetTitle(const char[]); | 46 virtual void onSetTitle(const char[]); |
42 | 47 |
43 private: | 48 private: |
44 void* fHWND; | 49 void* fHWND; |
45 bool fInvalEventIsPending; | 50 bool fInvalEventIsPending; |
46 void* fNotifier; | 51 void* fNotifier; |
47 #if SK_SUPPORT_GPU | 52 #if SK_SUPPORT_GPU |
48 void* fGLContext; | 53 void* fGLContext; |
49 #endif | 54 #endif |
50 typedef SkWindow INHERITED; | 55 typedef SkWindow INHERITED; |
51 }; | 56 }; |
52 | 57 |
53 #endif | 58 #endif |
OLD | NEW |