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

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

Issue 1221853003: Add SkSurface factory for wrapping an FBO in SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix comment 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 | src/image/SkSurface.cpp » ('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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 /** 81 /**
82 * Return a new surface using the specified render target. 82 * Return a new surface using the specified render target.
83 */ 83 */
84 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp s*); 84 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp s*);
85 85
86 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { 86 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) {
87 return NewRenderTargetDirect(target, NULL); 87 return NewRenderTargetDirect(target, NULL);
88 } 88 }
89 89
90 /** 90 /**
91 * Used to wrap a pre-existing backend 3D API texture in a SkSurface. The k RenderTarget flag 91 * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The k RenderTarget flag
92 * must be set on GrBackendTextureDesc for this to succeed. 92 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a ssume ownership
93 * of the texture and the client must ensure the texture is valid for the l ifetime of the
94 * SkSurface.
93 */ 95 */
94 static SkSurface* NewWrappedRenderTarget(GrContext*, GrBackendTextureDesc, 96 static SkSurface* NewFromBackendTexture(GrContext*, const GrBackendTextureDe sc&,
95 const SkSurfaceProps*); 97 const SkSurfaceProps*);
98 // Legacy alias
99 static SkSurface* NewWrappedRenderTarget(GrContext* ctx, const GrBackendText ureDesc& desc,
100 const SkSurfaceProps* props) {
101 return NewFromBackendTexture(ctx, desc, props);
102 }
103
104
105 /**
106 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume
107 * ownership of the render target and the client must ensure the render tar get is valid for the
108 * lifetime of the SkSurface.
109 */
110 static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRend erTargetDesc&,
111 const SkSurfaceProps*);
96 112
97 /** 113 /**
98 * Return a new surface whose contents will be drawn to an offscreen 114 * Return a new surface whose contents will be drawn to an offscreen
99 * render target, allocated by the surface. 115 * render target, allocated by the surface.
100 */ 116 */
101 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount, 117 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount,
102 const SkSurfaceProps* = NULL); 118 const SkSurfaceProps* = NULL);
103 119
104 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn fo& info) { 120 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn fo& info) {
105 return NewRenderTarget(gr, b, info, 0, NULL); 121 return NewRenderTarget(gr, b, info, 0, NULL);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 private: 261 private:
246 const SkSurfaceProps fProps; 262 const SkSurfaceProps fProps;
247 const int fWidth; 263 const int fWidth;
248 const int fHeight; 264 const int fHeight;
249 uint32_t fGenerationID; 265 uint32_t fGenerationID;
250 266
251 typedef SkRefCnt INHERITED; 267 typedef SkRefCnt INHERITED;
252 }; 268 };
253 269
254 #endif 270 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698