OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkSurface_DEFINED | 8 #ifndef SkSurface_DEFINED |
9 #define SkSurface_DEFINED | 9 #define SkSurface_DEFINED |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 /** | 131 /** |
132 * Use this mode if prior surface contents need to be preserved or | 132 * Use this mode if prior surface contents need to be preserved or |
133 * if in doubt. | 133 * if in doubt. |
134 */ | 134 */ |
135 kRetain_ContentChangeMode, | 135 kRetain_ContentChangeMode, |
136 }; | 136 }; |
137 | 137 |
138 /** | 138 /** |
139 * Call this if the contents are about to change. This will (lazily) force
a new | 139 * Call this if the contents are about to change. This will (lazily) force
a new |
140 * value to be returned from generationID() when it is called next. | 140 * value to be returned from generationID() when it is called next. |
| 141 * |
| 142 * CAN WE DEPRECATE THIS? |
141 */ | 143 */ |
142 void notifyContentWillChange(ContentChangeMode mode); | 144 void notifyContentWillChange(ContentChangeMode mode); |
143 | 145 |
| 146 enum TextureHandleAccess { |
| 147 kFlushRead_TextureHandleAccess, //!< caller may read from the textur
e |
| 148 kFlushWrite_TextureHandleAccess, //!< caller may write to the texture |
| 149 kDiscardWrite_TextureHandleAccess, //!< caller must over-write the enti
re texture |
| 150 }; |
| 151 /** |
| 152 * Retrieves the backend API handle of the texture used by this surface, or
0 if the surface |
| 153 * is not backed by a GPU texture. |
| 154 * |
| 155 * The returned texture-handle is only valid until the next draw-call into
the surface, |
| 156 * or the surface is deleted. |
| 157 */ |
| 158 GrBackendObject getTextureHandle(TextureHandleAccess); |
| 159 |
144 /** | 160 /** |
145 * Return a canvas that will draw into this surface. This will always | 161 * Return a canvas that will draw into this surface. This will always |
146 * return the same canvas for a given surface, and is manged/owned by the | 162 * return the same canvas for a given surface, and is manged/owned by the |
147 * surface. It should not be used when its parent surface has gone out of | 163 * surface. It should not be used when its parent surface has gone out of |
148 * scope. | 164 * scope. |
149 */ | 165 */ |
150 SkCanvas* getCanvas(); | 166 SkCanvas* getCanvas(); |
151 | 167 |
152 /** | 168 /** |
153 * Return a new surface that is "compatible" with this one, in that it will | 169 * Return a new surface that is "compatible" with this one, in that it will |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 private: | 245 private: |
230 const SkSurfaceProps fProps; | 246 const SkSurfaceProps fProps; |
231 const int fWidth; | 247 const int fWidth; |
232 const int fHeight; | 248 const int fHeight; |
233 uint32_t fGenerationID; | 249 uint32_t fGenerationID; |
234 | 250 |
235 typedef SkRefCnt INHERITED; | 251 typedef SkRefCnt INHERITED; |
236 }; | 252 }; |
237 | 253 |
238 #endif | 254 #endif |
OLD | NEW |