aboutsummaryrefslogtreecommitdiff
path: root/src/image
diff options
context:
space:
mode:
authorJim Van Verth <jvanverth@google.com>2018-10-12 16:15:34 -0400
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2018-10-12 21:01:00 +0000
commitcea3902d9ee7a58a7fac5db9ff4fcebc3d2d4067 (patch)
treeef52560c9b78802df0eb1d6d5d2b53934a5765ce /src/image
parentfd9c3cdd5b6916358ee5dafce7e86cd4c8bd2d0f (diff)
downloadskqp-cea3902d9ee7a58a7fac5db9ff4fcebc3d2d4067.tar.gz
Make SkImage_Gpu MakePromise interfaces consistent
Bug: skia:7903 Change-Id: Ia14cdafcfc26f75fde4296e7e93ce6f56a98400f Reviewed-on: https://skia-review.googlesource.com/c/161827 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage_GpuYUVA.cpp29
-rw-r--r--src/image/SkImage_GpuYUVA.h14
2 files changed, 24 insertions, 19 deletions
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index f1321c5f67..d67f2b923a 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -18,12 +18,11 @@
#include "SkImage_GpuYUVA.h"
#include "effects/GrYUVtoRGBEffect.h"
-SkImage_GpuYUVA::SkImage_GpuYUVA(sk_sp<GrContext> context, uint32_t uniqueID,
+SkImage_GpuYUVA::SkImage_GpuYUVA(sk_sp<GrContext> context, int width, int height, uint32_t uniqueID,
SkYUVColorSpace colorSpace, sk_sp<GrTextureProxy> proxies[],
- const SkYUVAIndex yuvaIndices[4], SkISize size,
- GrSurfaceOrigin origin, sk_sp<SkColorSpace> imageColorSpace,
- SkBudgeted budgeted)
- : INHERITED(std::move(context), size.width(), size.height(), uniqueID,
+ const SkYUVAIndex yuvaIndices[4], GrSurfaceOrigin origin,
+ sk_sp<SkColorSpace> imageColorSpace, SkBudgeted budgeted)
+ : INHERITED(std::move(context), width, height, uniqueID,
// If an alpha channel is present we always switch to kPremul. This is because,
// although the planar data is always un-premul, the final interleaved RGB image
// is/would-be premul.
@@ -103,7 +102,8 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakeFromYUVATextures(GrContext* ctx,
SkYUVColorSpace colorSpace,
const GrBackendTexture yuvaTextures[],
const SkYUVAIndex yuvaIndices[4],
- SkISize size,
+ int width,
+ int height,
GrSurfaceOrigin origin,
sk_sp<SkColorSpace> imageColorSpace) {
GrProxyProvider* proxyProvider = ctx->contextPriv().proxyProvider();
@@ -173,8 +173,8 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakeFromYUVATextures(GrContext* ctx,
}
}
- return sk_make_sp<SkImage_GpuYUVA>(sk_ref_sp(ctx), kNeedNewImageUniqueID, colorSpace,
- tempTextureProxies, yuvaIndices, size, origin,
+ return sk_make_sp<SkImage_GpuYUVA>(sk_ref_sp(ctx), width, height, kNeedNewImageUniqueID,
+ colorSpace, tempTextureProxies, yuvaIndices, origin,
imageColorSpace, SkBudgeted::kYes);
}
@@ -184,7 +184,8 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakePromiseYUVATexture(GrContext* context,
const GrBackendFormat yuvaFormats[],
const SkISize yuvaSizes[],
const SkYUVAIndex yuvaIndices[4],
- SkISize size,
+ int imageWidth,
+ int imageHeight,
GrSurfaceOrigin imageOrigin,
sk_sp<SkColorSpace> imageColorSpace,
TextureFulfillProc textureFulfillProc,
@@ -215,7 +216,7 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakePromiseYUVATexture(GrContext* context,
return nullptr;
}
- if (size.width() <= 0 || size.height() <= 0) {
+ if (imageWidth <= 0 || imageWidth <= 0) {
return nullptr;
}
@@ -225,7 +226,7 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakePromiseYUVATexture(GrContext* context,
SkAlphaType at = (-1 != yuvaIndices[SkYUVAIndex::kA_Index].fIndex) ? kPremul_SkAlphaType
: kOpaque_SkAlphaType;
- SkImageInfo info = SkImageInfo::Make(size.width(), size.height(), kRGBA_8888_SkColorType,
+ SkImageInfo info = SkImageInfo::Make(imageWidth, imageHeight, kRGBA_8888_SkColorType,
at, imageColorSpace);
if (!SkImageInfoIsValid(info)) {
return nullptr;
@@ -294,8 +295,8 @@ sk_sp<SkImage> SkImage_GpuYUVA::MakePromiseYUVATexture(GrContext* context,
}
}
- return sk_make_sp<SkImage_GpuYUVA>(sk_ref_sp(context), kNeedNewImageUniqueID, yuvColorSpace,
- proxies, yuvaIndices, size, imageOrigin,
- std::move(imageColorSpace), SkBudgeted::kNo);
+ return sk_make_sp<SkImage_GpuYUVA>(sk_ref_sp(context), imageWidth, imageHeight,
+ kNeedNewImageUniqueID, yuvColorSpace, proxies, yuvaIndices,
+ imageOrigin, std::move(imageColorSpace), SkBudgeted::kNo);
}
diff --git a/src/image/SkImage_GpuYUVA.h b/src/image/SkImage_GpuYUVA.h
index 162b716210..c5f0b9d146 100644
--- a/src/image/SkImage_GpuYUVA.h
+++ b/src/image/SkImage_GpuYUVA.h
@@ -22,8 +22,8 @@ class GrTexture;
// proxy will be stored and used for any future rendering.
class SkImage_GpuYUVA : public SkImage_GpuBase {
public:
- SkImage_GpuYUVA(sk_sp<GrContext>, uint32_t uniqueID, SkYUVColorSpace,
- sk_sp<GrTextureProxy> proxies[], const SkYUVAIndex yuvaIndices[4], SkISize size,
+ SkImage_GpuYUVA(sk_sp<GrContext>, int width, int height, uint32_t uniqueID, SkYUVColorSpace,
+ sk_sp<GrTextureProxy> proxies[], const SkYUVAIndex yuvaIndices[4],
GrSurfaceOrigin, sk_sp<SkColorSpace>, SkBudgeted);
~SkImage_GpuYUVA() override;
@@ -62,8 +62,10 @@ public:
@param context Gpu context
@param yuvColorSpace color range of expected YUV pixels
@param yuvaFormats formats of promised gpu textures for each YUVA plane
+ @param yuvaSizes width and height of promised gpu textures
@param yuvaIndices mapping from yuv plane index to texture representing that plane
- @param imageSize width and height of promised gpu texture
+ @param width width of promised gpu texture
+ @param height height of promised gpu texture
@param imageOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin
@param imageColorSpace range of colors; may be nullptr
@param textureFulfillProc function called to get actual gpu texture
@@ -77,7 +79,8 @@ public:
const GrBackendFormat yuvaFormats[],
const SkISize yuvaSizes[],
const SkYUVAIndex yuvaIndices[4],
- SkISize imageSize,
+ int width,
+ int height,
GrSurfaceOrigin imageOrigin,
sk_sp<SkColorSpace> imageColorSpace,
TextureFulfillProc textureFulfillProc,
@@ -89,7 +92,8 @@ public:
SkYUVColorSpace yuvColorSpace,
const GrBackendTexture yuvaTextures[],
const SkYUVAIndex yuvaIndices[4],
- SkISize imageSize,
+ int width,
+ int height,
GrSurfaceOrigin imageOrigin,
sk_sp<SkColorSpace> imageColorSpace);