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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * Call this if the contents are about to change. This will (lazily) force a new | 155 * Call this if the contents are about to change. This will (lazily) force a new |
| 156 * value to be returned from generationID() when it is called next. | 156 * value to be returned from generationID() when it is called next. |
| 157 * | 157 * |
| 158 * CAN WE DEPRECATE THIS? | 158 * CAN WE DEPRECATE THIS? |
| 159 */ | 159 */ |
| 160 void notifyContentWillChange(ContentChangeMode mode); | 160 void notifyContentWillChange(ContentChangeMode mode); |
| 161 | 161 |
| 162 enum TextureHandleAccess { | 162 enum BackendHandleAccess { |
| 163 kFlushRead_TextureHandleAccess, //!< caller may read from the textur e | 163 kFlushRead_BackendHandleAccess, //!< caller may read from the backen d object |
| 164 kFlushWrite_TextureHandleAccess, //!< caller may write to the texture | 164 kFlushWrite_BackendHandleAccess, //!< caller may write to the backend object |
| 165 kDiscardWrite_TextureHandleAccess, //!< caller must over-write the enti re texture | 165 kDiscardWrite_BackendHandleAccess, //!< caller must over-write the enti re backend object |
| 166 }; | 166 }; |
| 167 | |
| 168 static const BackendHandleAccess kFlushRead_TextureHandleAccess = | |
|
bsalomon
2015/07/08 17:21:46
Comment about these being legacy aliases that will
| |
| 169 kFlushRead_BackendHandleAccess; | |
| 170 static const BackendHandleAccess kFlushWrite_TextureHandleAccess = | |
| 171 kFlushWrite_BackendHandleAccess; | |
| 172 static const BackendHandleAccess kDiscardWrite_TextureHandleAccess = | |
| 173 kDiscardWrite_BackendHandleAccess; | |
| 174 | |
| 175 | |
| 167 /** | 176 /** |
| 168 * Retrieves the backend API handle of the texture used by this surface, or 0 if the surface | 177 * Retrieves the backend API handle of the texture used by this surface, or 0 if the surface |
| 169 * is not backed by a GPU texture. | 178 * is not backed by a GPU texture. |
| 170 * | 179 * |
| 171 * The returned texture-handle is only valid until the next draw-call into the surface, | 180 * The returned texture-handle is only valid until the next draw-call into the surface, |
| 172 * or the surface is deleted. | 181 * or the surface is deleted. |
| 173 */ | 182 */ |
| 174 GrBackendObject getTextureHandle(TextureHandleAccess); | 183 GrBackendObject getTextureHandle(BackendHandleAccess); |
| 184 | |
| 185 /** | |
| 186 * Retrieves the backend API handle of the RenderTarget backing this surfac e. Callers must | |
| 187 * ensure this function returns 'true' or else the GrBackendObject will be invalid | |
| 188 * | |
| 189 * In OpenGL this will return the FramebufferObject ID. | |
| 190 */ | |
| 191 bool getRenderTargetHandle(GrBackendObject*, BackendHandleAccess); | |
| 175 | 192 |
| 176 /** | 193 /** |
| 177 * Return a canvas that will draw into this surface. This will always | 194 * Return a canvas that will draw into this surface. This will always |
| 178 * return the same canvas for a given surface, and is manged/owned by the | 195 * return the same canvas for a given surface, and is manged/owned by the |
| 179 * surface. It should not be used when its parent surface has gone out of | 196 * surface. It should not be used when its parent surface has gone out of |
| 180 * scope. | 197 * scope. |
| 181 */ | 198 */ |
| 182 SkCanvas* getCanvas(); | 199 SkCanvas* getCanvas(); |
| 183 | 200 |
| 184 /** | 201 /** |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 private: | 278 private: |
| 262 const SkSurfaceProps fProps; | 279 const SkSurfaceProps fProps; |
| 263 const int fWidth; | 280 const int fWidth; |
| 264 const int fHeight; | 281 const int fHeight; |
| 265 uint32_t fGenerationID; | 282 uint32_t fGenerationID; |
| 266 | 283 |
| 267 typedef SkRefCnt INHERITED; | 284 typedef SkRefCnt INHERITED; |
| 268 }; | 285 }; |
| 269 | 286 |
| 270 #endif | 287 #endif |
| OLD | NEW |