Chromium Code Reviews| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 /** | 133 /** |
| 134 * Use this mode if prior surface contents need to be preserved or | 134 * Use this mode if prior surface contents need to be preserved or |
| 135 * if in doubt. | 135 * if in doubt. |
| 136 */ | 136 */ |
| 137 kRetain_ContentChangeMode, | 137 kRetain_ContentChangeMode, |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Call this if the contents are about to change. This will (lazily) force a new | 141 * Call this if the contents are about to change. This will (lazily) force a new |
| 142 * value to be returned from generationID() when it is called next. | 142 * value to be returned from generationID() when it is called next. |
| 143 * | |
| 144 * CAN WE DEPRECATE THIS? | |
|
Justin Novosad
2015/06/26 21:33:14
No we can't. This API drives an important optimiza
reed1
2015/06/27 17:56:11
Lets discuss as part of DeferredCanvas discussion
| |
| 143 */ | 145 */ |
| 144 void notifyContentWillChange(ContentChangeMode mode); | 146 void notifyContentWillChange(ContentChangeMode mode); |
| 145 | 147 |
| 146 /** | 148 /** |
| 149 * Retrieves the backend API handle of the texture used by this surface, or 0 if the surface | |
| 150 * is not backed by a GPU texture. | |
| 151 * | |
| 152 * If flushPendingWrites then the GrContext will issue to the backend API a ny deferred | |
|
bsalomon
2015/06/26 21:15:22
comment looks incorrect
reed1
2015/06/26 21:21:13
Doh
| |
| 153 * read operations on the texture before returning. | |
| 154 */ | |
| 155 GrBackendObject getTextureHandle(ContentChangeMode); | |
|
f(malita)
2015/06/26 21:39:38
Can you also document the lifetime & ownership for
reed1
2015/06/27 17:56:11
Done.
| |
| 156 | |
| 157 /** | |
| 147 * Return a canvas that will draw into this surface. This will always | 158 * Return a canvas that will draw into this surface. This will always |
| 148 * return the same canvas for a given surface, and is manged/owned by the | 159 * return the same canvas for a given surface, and is manged/owned by the |
| 149 * surface. It should not be used when its parent surface has gone out of | 160 * surface. It should not be used when its parent surface has gone out of |
| 150 * scope. | 161 * scope. |
| 151 */ | 162 */ |
| 152 SkCanvas* getCanvas(); | 163 SkCanvas* getCanvas(); |
| 153 | 164 |
| 154 /** | 165 /** |
| 155 * Return a new surface that is "compatible" with this one, in that it will | 166 * Return a new surface that is "compatible" with this one, in that it will |
| 156 * efficiently be able to be drawn into this surface. Typical calling | 167 * efficiently be able to be drawn into this surface. Typical calling |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 private: | 242 private: |
| 232 const SkSurfaceProps fProps; | 243 const SkSurfaceProps fProps; |
| 233 const int fWidth; | 244 const int fWidth; |
| 234 const int fHeight; | 245 const int fHeight; |
| 235 uint32_t fGenerationID; | 246 uint32_t fGenerationID; |
| 236 | 247 |
| 237 typedef SkRefCnt INHERITED; | 248 typedef SkRefCnt INHERITED; |
| 238 }; | 249 }; |
| 239 | 250 |
| 240 #endif | 251 #endif |
| OLD | NEW |