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 SkWindow_DEFINED | 8 #ifndef SkWindow_DEFINED |
9 #define SkWindow_DEFINED | 9 #define SkWindow_DEFINED |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const SkTDArray<SkOSMenu*>* getMenus() { return &fMenus; } | 71 const SkTDArray<SkOSMenu*>* getMenus() { return &fMenus; } |
72 | 72 |
73 const char* getTitle() const { return fTitle.c_str(); } | 73 const char* getTitle() const { return fTitle.c_str(); } |
74 void setTitle(const char title[]); | 74 void setTitle(const char title[]); |
75 | 75 |
76 const SkMatrix& getMatrix() const { return fMatrix; } | 76 const SkMatrix& getMatrix() const { return fMatrix; } |
77 void setMatrix(const SkMatrix&); | 77 void setMatrix(const SkMatrix&); |
78 void preConcat(const SkMatrix&); | 78 void preConcat(const SkMatrix&); |
79 void postConcat(const SkMatrix&); | 79 void postConcat(const SkMatrix&); |
80 | 80 |
81 virtual SkSurface* createSurface(); | 81 virtual sk_sp<SkSurface> makeSurface(); |
82 | 82 |
83 protected: | 83 protected: |
84 virtual bool onEvent(const SkEvent&); | 84 virtual bool onEvent(const SkEvent&); |
85 virtual bool onDispatchClick(int x, int y, Click::State, void* owner, unsign
ed modi); | 85 virtual bool onDispatchClick(int x, int y, Click::State, void* owner, unsign
ed modi); |
86 // called if part of our bitmap is invalidated | 86 // called if part of our bitmap is invalidated |
87 virtual void onHandleInval(const SkIRect&); | 87 virtual void onHandleInval(const SkIRect&); |
88 virtual bool onHandleChar(SkUnichar); | 88 virtual bool onHandleChar(SkUnichar); |
89 virtual bool onHandleKey(SkKey); | 89 virtual bool onHandleKey(SkKey); |
90 virtual bool onHandleKeyUp(SkKey); | 90 virtual bool onHandleKeyUp(SkKey); |
91 virtual void onAddMenu(const SkOSMenu*) {}; | 91 virtual void onAddMenu(const SkOSMenu*) {}; |
92 virtual void onUpdateMenu(const SkOSMenu*) {}; | 92 virtual void onUpdateMenu(const SkOSMenu*) {}; |
93 virtual void onSetTitle(const char title[]) {} | 93 virtual void onSetTitle(const char title[]) {} |
94 | 94 |
95 // overrides from SkView | 95 // overrides from SkView |
96 virtual bool handleInval(const SkRect*); | 96 virtual bool handleInval(const SkRect*); |
97 virtual bool onGetFocusView(SkView** focus) const; | 97 virtual bool onGetFocusView(SkView** focus) const; |
98 virtual bool onSetFocusView(SkView* focus); | 98 virtual bool onSetFocusView(SkView* focus); |
99 | 99 |
100 #if SK_SUPPORT_GPU | 100 #if SK_SUPPORT_GPU |
101 GrRenderTarget* renderTarget(const AttachmentInfo& attachmentInfo, | 101 sk_sp<SkSurface> makeGpuBackedSurface(const AttachmentInfo& attachmentInfo, |
102 const GrGLInterface* , GrContext* grContext); | 102 const GrGLInterface* , GrContext* grCo
ntext); |
103 #endif | 103 #endif |
104 | 104 |
105 private: | 105 private: |
106 SkSurfaceProps fSurfaceProps; | 106 SkSurfaceProps fSurfaceProps; |
107 SkBitmap fBitmap; | 107 SkBitmap fBitmap; |
108 SkRegion fDirtyRgn; | 108 SkRegion fDirtyRgn; |
109 | 109 |
110 SkTDArray<Click*> fClicks; // to track clicks | 110 SkTDArray<Click*> fClicks; // to track clicks |
111 | 111 |
112 SkTDArray<SkOSMenu*> fMenus; | 112 SkTDArray<SkOSMenu*> fMenus; |
(...skipping 17 matching lines...) Expand all Loading... |
130 #include "SkOSWindow_Win.h" | 130 #include "SkOSWindow_Win.h" |
131 #elif defined(SK_BUILD_FOR_ANDROID) | 131 #elif defined(SK_BUILD_FOR_ANDROID) |
132 #error Android does not support SkOSWindow and SampleApp. Please use Viewer
instead. | 132 #error Android does not support SkOSWindow and SampleApp. Please use Viewer
instead. |
133 #elif defined(SK_BUILD_FOR_UNIX) | 133 #elif defined(SK_BUILD_FOR_UNIX) |
134 #include "SkOSWindow_Unix.h" | 134 #include "SkOSWindow_Unix.h" |
135 #elif defined(SK_BUILD_FOR_IOS) | 135 #elif defined(SK_BUILD_FOR_IOS) |
136 #include "SkOSWindow_iOS.h" | 136 #include "SkOSWindow_iOS.h" |
137 #endif | 137 #endif |
138 | 138 |
139 #endif | 139 #endif |
OLD | NEW |