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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 * Return a new surface using the specified render target. | 78 * Return a new surface using the specified render target. |
79 */ | 79 */ |
80 static sk_sp<SkSurface> MakeRenderTargetDirect(GrRenderTarget*, | 80 static sk_sp<SkSurface> MakeRenderTargetDirect(GrRenderTarget*, |
81 const SkSurfaceProps* = nullp
tr); | 81 const SkSurfaceProps* = nullp
tr); |
82 | 82 |
83 /** | 83 /** |
84 * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The k
RenderTarget flag | 84 * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The k
RenderTarget flag |
85 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership | 85 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership |
86 * of the texture and the client must ensure the texture is valid for the l
ifetime of the | 86 * of the texture and the client must ensure the texture is valid for the l
ifetime of the |
87 * SkSurface. | 87 * SkSurface. |
88 * | |
89 * If the requested sample count is greater than 0, the contents of the sur
face are undefined. | |
90 */ | 88 */ |
91 static sk_sp<SkSurface> MakeFromBackendTexture(GrContext*, const GrBackendTe
xtureDesc&, | 89 static sk_sp<SkSurface> MakeFromBackendTexture(GrContext*, const GrBackendTe
xtureDesc&, |
92 const SkSurfaceProps*); | 90 const SkSurfaceProps*); |
93 | 91 |
94 /** | 92 /** |
95 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume | 93 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume |
96 * ownership of the render target and the client must ensure the render tar
get is valid for the | 94 * ownership of the render target and the client must ensure the render tar
get is valid for the |
97 * lifetime of the SkSurface. | 95 * lifetime of the SkSurface. |
98 */ | 96 */ |
99 static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext*, | 97 static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext*, |
100 const GrBackendRenderTar
getDesc&, | 98 const GrBackendRenderTar
getDesc&, |
101 const SkSurfaceProps*); | 99 const SkSurfaceProps*); |
102 | 100 |
103 /** | 101 /** |
104 * Used to wrap a pre-existing 3D API texture as a SkSurface. Skia will tre
at the texture as | 102 * Used to wrap a pre-existing 3D API texture as a SkSurface. Skia will tre
at the texture as |
105 * a rendering target only, but unlike NewFromBackendRenderTarget, Skia wil
l manage and own | 103 * a rendering target only, but unlike NewFromBackendRenderTarget, Skia wil
l manage and own |
106 * the associated render target objects (but not the provided texture). The
kRenderTarget flag | 104 * the associated render target objects (but not the provided texture). The
kRenderTarget flag |
107 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership | 105 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership |
108 * of the texture and the client must ensure the texture is valid for the l
ifetime of the | 106 * of the texture and the client must ensure the texture is valid for the l
ifetime of the |
109 * SkSurface. | 107 * SkSurface. |
110 * | |
111 * If the requested sample count is greater than 0, the contents of the sur
face are undefined. | |
112 */ | 108 */ |
113 static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget( | 109 static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget( |
114 GrContext*, const GrBackendTextureDesc&, const SkSurfaceProps*); | 110 GrContext*, const GrBackendTextureDesc&, const SkSurfaceProps*); |
115 | 111 |
116 /** | 112 /** |
117 * Return a new surface whose contents will be drawn to an offscreen | 113 * Return a new surface whose contents will be drawn to an offscreen |
118 * render target, allocated by the surface. | 114 * render target, allocated by the surface. |
119 */ | 115 */ |
120 static sk_sp<SkSurface> MakeRenderTarget( | 116 static sk_sp<SkSurface> MakeRenderTarget( |
121 GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, const S
kSurfaceProps*); | 117 GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, const S
kSurfaceProps*); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 private: | 366 private: |
371 const SkSurfaceProps fProps; | 367 const SkSurfaceProps fProps; |
372 const int fWidth; | 368 const int fWidth; |
373 const int fHeight; | 369 const int fHeight; |
374 uint32_t fGenerationID; | 370 uint32_t fGenerationID; |
375 | 371 |
376 typedef SkRefCnt INHERITED; | 372 typedef SkRefCnt INHERITED; |
377 }; | 373 }; |
378 | 374 |
379 #endif | 375 #endif |
OLD | NEW |