OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkOSWindow_Unix_DEFINED | 8 #ifndef SkOSWindow_Unix_DEFINED |
9 #define SkOSWindow_Unix_DEFINED | 9 #define SkOSWindow_Unix_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 void* getDisplay() const { return (void*)fUnixWindow.fDisplay; } | 32 void* getDisplay() const { return (void*)fUnixWindow.fDisplay; } |
33 void* getUnixWindow() const { return (void*)&fUnixWindow; } | 33 void* getUnixWindow() const { return (void*)&fUnixWindow; } |
34 void loop(); | 34 void loop(); |
35 void post_linuxevent(); | 35 void post_linuxevent(); |
36 | 36 |
37 enum SkBackEndTypes { | 37 enum SkBackEndTypes { |
38 kNone_BackEndType, | 38 kNone_BackEndType, |
39 kNativeGL_BackEndType, | 39 kNativeGL_BackEndType, |
40 }; | 40 }; |
41 | 41 |
42 bool attach(SkBackEndTypes attachType, int msaaSampleCount); | 42 struct AttachmentInfo { |
| 43 int fSampleCount; |
| 44 int fStencilBits; |
| 45 }; |
| 46 |
| 47 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*)
; |
43 void detach(); | 48 void detach(); |
44 void present(); | 49 void present(); |
45 | 50 |
46 int getMSAASampleCount() const { return fMSAASampleCount; } | 51 int getMSAASampleCount() const { return fMSAASampleCount; } |
47 | 52 |
48 //static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); | 53 //static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); |
49 | 54 |
50 protected: | 55 protected: |
51 // Overridden from from SkWindow: | 56 // Overridden from from SkWindow: |
52 virtual bool onEvent(const SkEvent&) SK_OVERRIDE; | 57 virtual bool onEvent(const SkEvent&) SK_OVERRIDE; |
53 virtual void onHandleInval(const SkIRect&) SK_OVERRIDE; | 58 virtual void onHandleInval(const SkIRect&) SK_OVERRIDE; |
54 virtual bool onHandleChar(SkUnichar) SK_OVERRIDE; | 59 virtual bool onHandleChar(SkUnichar) SK_OVERRIDE; |
55 virtual bool onHandleKey(SkKey) SK_OVERRIDE; | 60 virtual bool onHandleKey(SkKey) SK_OVERRIDE; |
56 virtual bool onHandleKeyUp(SkKey) SK_OVERRIDE; | 61 virtual bool onHandleKeyUp(SkKey) SK_OVERRIDE; |
57 virtual void onSetTitle(const char title[]) SK_OVERRIDE; | 62 virtual void onSetTitle(const char title[]) SK_OVERRIDE; |
58 | 63 |
59 private: | 64 private: |
60 void doPaint(); | 65 void doPaint(); |
61 void mapWindowAndWait(); | 66 void mapWindowAndWait(); |
62 | 67 |
63 void closeWindow(); | 68 void closeWindow(); |
64 void initWindow(int newMSAASampleCount); | 69 void initWindow(int newMSAASampleCount, AttachmentInfo* info); |
65 | 70 |
66 SkUnixWindow fUnixWindow; | 71 SkUnixWindow fUnixWindow; |
67 | 72 |
68 // Needed for GL | 73 // Needed for GL |
69 XVisualInfo* fVi; | 74 XVisualInfo* fVi; |
70 // we recreate the underlying xwindow if this changes | 75 // we recreate the underlying xwindow if this changes |
71 int fMSAASampleCount; | 76 int fMSAASampleCount; |
72 | 77 |
73 typedef SkWindow INHERITED; | 78 typedef SkWindow INHERITED; |
74 }; | 79 }; |
75 | 80 |
76 #endif | 81 #endif |
OLD | NEW |