Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: include/core/SkSurface.h

Issue 1220733007: add ability to get FBO ID to Surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mac warning Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/gpu/GrRenderTarget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 /*
169 * These are legacy aliases which will be removed soon
170 */
171 static const BackendHandleAccess kFlushRead_TextureHandleAccess =
172 kFlushRead_BackendHandleAccess;
173 static const BackendHandleAccess kFlushWrite_TextureHandleAccess =
174 kFlushWrite_BackendHandleAccess;
175 static const BackendHandleAccess kDiscardWrite_TextureHandleAccess =
176 kDiscardWrite_BackendHandleAccess;
177
178
167 /** 179 /**
168 * Retrieves the backend API handle of the texture used by this surface, or 0 if the surface 180 * 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. 181 * is not backed by a GPU texture.
170 * 182 *
171 * The returned texture-handle is only valid until the next draw-call into the surface, 183 * The returned texture-handle is only valid until the next draw-call into the surface,
172 * or the surface is deleted. 184 * or the surface is deleted.
173 */ 185 */
174 GrBackendObject getTextureHandle(TextureHandleAccess); 186 GrBackendObject getTextureHandle(BackendHandleAccess);
187
188 /**
189 * Retrieves the backend API handle of the RenderTarget backing this surfac e. Callers must
190 * ensure this function returns 'true' or else the GrBackendObject will be invalid
191 *
192 * In OpenGL this will return the FramebufferObject ID.
193 */
194 bool getRenderTargetHandle(GrBackendObject*, BackendHandleAccess);
175 195
176 /** 196 /**
177 * Return a canvas that will draw into this surface. This will always 197 * 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 198 * 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 199 * surface. It should not be used when its parent surface has gone out of
180 * scope. 200 * scope.
181 */ 201 */
182 SkCanvas* getCanvas(); 202 SkCanvas* getCanvas();
183 203
184 /** 204 /**
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 private: 281 private:
262 const SkSurfaceProps fProps; 282 const SkSurfaceProps fProps;
263 const int fWidth; 283 const int fWidth;
264 const int fHeight; 284 const int fHeight;
265 uint32_t fGenerationID; 285 uint32_t fGenerationID;
266 286
267 typedef SkRefCnt INHERITED; 287 typedef SkRefCnt INHERITED;
268 }; 288 };
269 289
270 #endif 290 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698