| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * Helper version of NewRaster. It creates a SkImageInfo with the | 73 * Helper version of NewRaster. It creates a SkImageInfo with the |
| 74 * specified width and height, and populates the rest of info to match | 74 * specified width and height, and populates the rest of info to match |
| 75 * pixels in SkPMColor format. | 75 * pixels in SkPMColor format. |
| 76 */ | 76 */ |
| 77 static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height, | 77 static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height, |
| 78 const SkSurfaceProps* props = nu
llptr) { | 78 const SkSurfaceProps* props = nu
llptr) { |
| 79 return MakeRaster(SkImageInfo::MakeN32Premul(width, height), props); | 79 return MakeRaster(SkImageInfo::MakeN32Premul(width, height), props); |
| 80 } | 80 } |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Return a new surface using the specified render target. | |
| 84 */ | |
| 85 static sk_sp<SkSurface> MakeRenderTargetDirect(GrRenderTarget*, sk_sp<SkColo
rSpace> colorSpace, | |
| 86 const SkSurfaceProps* = nullp
tr); | |
| 87 | |
| 88 /** | |
| 89 * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The k
RenderTarget flag | 83 * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The k
RenderTarget flag |
| 90 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership | 84 * must be set on GrBackendTextureDesc for this to succeed. Skia will not a
ssume ownership |
| 91 * of the texture and the client must ensure the texture is valid for the l
ifetime of the | 85 * of the texture and the client must ensure the texture is valid for the l
ifetime of the |
| 92 * SkSurface. | 86 * SkSurface. |
| 93 */ | 87 */ |
| 94 static sk_sp<SkSurface> MakeFromBackendTexture(GrContext*, const GrBackendTe
xtureDesc&, | 88 static sk_sp<SkSurface> MakeFromBackendTexture(GrContext*, const GrBackendTe
xtureDesc&, |
| 95 sk_sp<SkColorSpace>, const Sk
SurfaceProps*); | 89 sk_sp<SkColorSpace>, const Sk
SurfaceProps*); |
| 96 | 90 |
| 97 /** | 91 /** |
| 98 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume | 92 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 private: | 389 private: |
| 396 const SkSurfaceProps fProps; | 390 const SkSurfaceProps fProps; |
| 397 const int fWidth; | 391 const int fWidth; |
| 398 const int fHeight; | 392 const int fHeight; |
| 399 uint32_t fGenerationID; | 393 uint32_t fGenerationID; |
| 400 | 394 |
| 401 typedef SkRefCnt INHERITED; | 395 typedef SkRefCnt INHERITED; |
| 402 }; | 396 }; |
| 403 | 397 |
| 404 #endif | 398 #endif |
| OLD | NEW |