diff options
author | Robert Phillips <robertphillips@google.com> | 2017-12-13 09:22:45 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-13 15:20:12 +0000 |
commit | c25db637532cd10dde7855d868c0d033e96f61f2 (patch) | |
tree | 63a14b28af84ebf7f2bee6eef63db3de6623a811 /include | |
parent | 2a3009931d7bb0f5ca31490c4cf19eef205e4e7a (diff) |
Update SkImage::MakeFromYUVTexturesCopy to GrBackendTexture
Change-Id: I7ba030c5d7856309709e892a2b1b625cf74c70b8
Reviewed-on: https://skia-review.googlesource.com/82823
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImage.h | 23 | ||||
-rw-r--r-- | include/private/GrSurfaceProxy.h | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h index b2468e011e..454c5e4b7b 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -189,6 +189,29 @@ public: GrSurfaceOrigin surfaceOrigin, sk_sp<SkColorSpace> colorSpace = nullptr); + /** + * Create a new image by copying the pixels from the specified y, u, v textures. The data + * from the textures is immediately ingested into the image and the textures can be modified or + * deleted after the function returns. The image will have the dimensions of the y texture. + */ + static sk_sp<SkImage> MakeFromYUVTexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace, + const GrBackendTexture yuvTextureHandles[3], + const SkISize yuvSizes[3], + GrSurfaceOrigin surfaceOrigin, + sk_sp<SkColorSpace> colorSpace = nullptr); + + /** + * Create a new image by copying the pixels from the specified y and uv textures. The data + * from the textures is immediately ingested into the image and the textures can be modified or + * deleted after the function returns. The image will have the dimensions of the y texture. + */ + static sk_sp<SkImage> MakeFromNV12TexturesCopy(GrContext* context, + SkYUVColorSpace yuvColorSpace, + const GrBackendTexture nv12TextureHandles[2], + const SkISize nv12Sizes[2], + GrSurfaceOrigin surfaceOrigin, + sk_sp<SkColorSpace> colorSpace = nullptr); + enum class BitDepth { kU8, kF16, diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index 0e79a3f68b..493140b9dd 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -217,7 +217,8 @@ public: const GrSurfaceDesc&, SkBudgeted, const void* srcData, size_t rowBytes); - static sk_sp<GrTextureProxy> MakeWrappedBackend(GrContext*, GrBackendTexture&, GrSurfaceOrigin); + static sk_sp<GrTextureProxy> MakeWrappedBackend(GrContext*, const GrBackendTexture&, + GrSurfaceOrigin); using LazyInstantiateCallback = std::function<sk_sp<GrTexture>(GrResourceProvider*, GrSurfaceOrigin* outOrigin)>; |