| 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 | |
| 34 void detach(); | 29 void detach(); |
| 35 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInf
o*); | 30 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInf
o*); |
| 36 void present(); | 31 void present(); |
| 37 | 32 |
| 38 protected: | 33 protected: |
| 39 // overrides from SkEventSink | 34 // overrides from SkEventSink |
| 40 virtual bool onEvent(const SkEvent& evt); | 35 virtual bool onEvent(const SkEvent& evt); |
| 41 // overrides from SkWindow | 36 // overrides from SkWindow |
| 42 virtual void onHandleInval(const SkIRect&); | 37 virtual void onHandleInval(const SkIRect&); |
| 43 // overrides from SkView | 38 // overrides from SkView |
| 44 virtual void onAddMenu(const SkOSMenu*); | 39 virtual void onAddMenu(const SkOSMenu*); |
| 45 virtual void onUpdateMenu(const SkOSMenu*); | 40 virtual void onUpdateMenu(const SkOSMenu*); |
| 46 virtual void onSetTitle(const char[]); | 41 virtual void onSetTitle(const char[]); |
| 47 | 42 |
| 48 private: | 43 private: |
| 49 void* fHWND; | 44 void* fHWND; |
| 50 bool fInvalEventIsPending; | 45 bool fInvalEventIsPending; |
| 51 void* fNotifier; | 46 void* fNotifier; |
| 52 #if SK_SUPPORT_GPU | 47 #if SK_SUPPORT_GPU |
| 53 void* fGLContext; | 48 void* fGLContext; |
| 54 #endif | 49 #endif |
| 55 typedef SkWindow INHERITED; | 50 typedef SkWindow INHERITED; |
| 56 }; | 51 }; |
| 57 | 52 |
| 58 #endif | 53 #endif |
| OLD | NEW |