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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 * | 141 * |
| 142 * CAN WE DEPRECATE THIS? | 142 * CAN WE DEPRECATE THIS? |
| 143 */ | 143 */ |
| 144 void notifyContentWillChange(ContentChangeMode mode); | 144 void notifyContentWillChange(ContentChangeMode mode); |
| 145 | 145 |
| 146 enum TextureHandleAccess { | 146 enum BackendHandleAccess { |
| 147 kFlushRead_TextureHandleAccess, //!< caller may read from the textur e | 147 kFlushRead_BackendHandleAccess, //!< caller may read from the backen d object |
| 148 kFlushWrite_TextureHandleAccess, //!< caller may write to the texture | 148 kFlushWrite_BackendHandleAccess, //!< caller may write to the backend object |
| 149 kDiscardWrite_TextureHandleAccess, //!< caller must over-write the enti re texture | 149 kDiscardWrite_BackendHandleAccess, //!< caller must over-write the enti re backend object |
| 150 }; | 150 }; |
| 151 /** | 151 /** |
| 152 * Retrieves the backend API handle of the texture used by this surface, or 0 if the surface | 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. | 153 * is not backed by a GPU texture. |
| 154 * | 154 * |
| 155 * The returned texture-handle is only valid until the next draw-call into the surface, | 155 * The returned texture-handle is only valid until the next draw-call into the surface, |
| 156 * or the surface is deleted. | 156 * or the surface is deleted. |
| 157 */ | 157 */ |
| 158 GrBackendObject getTextureHandle(TextureHandleAccess); | 158 GrBackendObject getTextureHandle(BackendHandleAccess); |
| 159 | |
| 160 /** | |
| 161 * Retrieves the backend API handle of the RenderTarget backing this surfac e. Callers must | |
|
robertphillips
2015/07/06 15:29:02
return -> returns ?
| |
| 162 * ensure this function return 'true' or else the GrBackendObject will be i nvalid | |
| 163 * | |
|
robertphillips
2015/07/06 15:29:02
On -> In ?
| |
| 164 * On OpenGL this will return the FramebufferObject ID. | |
| 165 */ | |
| 166 bool getRenderTargetHandle(GrBackendObject*, BackendHandleAccess); | |
| 159 | 167 |
| 160 /** | 168 /** |
| 161 * Return a canvas that will draw into this surface. This will always | 169 * Return a canvas that will draw into this surface. This will always |
| 162 * return the same canvas for a given surface, and is manged/owned by the | 170 * return the same canvas for a given surface, and is manged/owned by the |
| 163 * surface. It should not be used when its parent surface has gone out of | 171 * surface. It should not be used when its parent surface has gone out of |
| 164 * scope. | 172 * scope. |
| 165 */ | 173 */ |
| 166 SkCanvas* getCanvas(); | 174 SkCanvas* getCanvas(); |
| 167 | 175 |
| 168 /** | 176 /** |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 private: | 253 private: |
| 246 const SkSurfaceProps fProps; | 254 const SkSurfaceProps fProps; |
| 247 const int fWidth; | 255 const int fWidth; |
| 248 const int fHeight; | 256 const int fHeight; |
| 249 uint32_t fGenerationID; | 257 uint32_t fGenerationID; |
| 250 | 258 |
| 251 typedef SkRefCnt INHERITED; | 259 typedef SkRefCnt INHERITED; |
| 252 }; | 260 }; |
| 253 | 261 |
| 254 #endif | 262 #endif |
| OLD | NEW |