Remove origin from GrSurfaceProxy.
Bug: skia:9556
Change-Id: Ic95a3a6b11e1ff8a6f6b2f5c5aeb9037b72aae90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270840
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index aae109cb..fcb882c 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -131,10 +131,9 @@
}
GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
- sk_sp<GrTextureProxy> proxy =
- proxyProvider->wrapBackendTexture(backendTex, colorType, origin, ownership,
- GrWrapCacheable::kNo, kRead_GrIOType,
- releaseProc, releaseCtx);
+ sk_sp<GrTextureProxy> proxy = proxyProvider->wrapBackendTexture(
+ backendTex, colorType, ownership, GrWrapCacheable::kNo, kRead_GrIOType, releaseProc,
+ releaseCtx);
if (!proxy) {
return nullptr;
}
@@ -163,9 +162,8 @@
}
GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
- sk_sp<GrTextureProxy> proxy =
- proxyProvider->wrapCompressedBackendTexture(tex, origin, kBorrow_GrWrapOwnership,
- GrWrapCacheable::kNo, releaseP, releaseC);
+ sk_sp<GrTextureProxy> proxy = proxyProvider->wrapCompressedBackendTexture(
+ tex, kBorrow_GrWrapOwnership, GrWrapCacheable::kNo, releaseP, releaseC);
if (!proxy) {
return nullptr;
}
@@ -496,8 +494,7 @@
}
callDone.clear();
- auto proxy = MakePromiseImageLazyProxy(context, width, height, origin,
- grColorType, backendFormat,
+ auto proxy = MakePromiseImageLazyProxy(context, width, height, grColorType, backendFormat,
mipMapped, textureFulfillProc, textureReleaseProc,
textureDoneProc, textureContext, version);
if (!proxy) {
@@ -625,9 +622,9 @@
}
sk_sp<GrTextureProxy> proxy =
- proxyProvider->wrapBackendTexture(backendTexture, grColorType, surfaceOrigin,
- kBorrow_GrWrapOwnership, GrWrapCacheable::kNo,
- kRW_GrIOType, deleteImageProc, deleteImageCtx);
+ proxyProvider->wrapBackendTexture(backendTexture, grColorType, kBorrow_GrWrapOwnership,
+ GrWrapCacheable::kNo, kRW_GrIOType, deleteImageProc,
+ deleteImageCtx);
if (!proxy) {
deleteImageProc(deleteImageCtx);
return nullptr;
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index d757a64..95002e0 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -288,7 +288,7 @@
SkASSERT(yuvaTextures[textureIndex].isValid());
auto proxy = proxyProvider->wrapBackendTexture(yuvaTextures[textureIndex], grColorType,
- imageOrigin, kBorrow_GrWrapOwnership,
+ kBorrow_GrWrapOwnership,
GrWrapCacheable::kNo, kRead_GrIOType);
if (!proxy) {
return false;
@@ -357,7 +357,7 @@
}
sk_sp<GrTextureProxy> SkImage_GpuBase::MakePromiseImageLazyProxy(
- GrContext* context, int width, int height, GrSurfaceOrigin origin, GrColorType colorType,
+ GrContext* context, int width, int height, GrColorType colorType,
GrBackendFormat backendFormat, GrMipMapped mipMapped,
PromiseImageTextureFulfillProc fulfillProc, PromiseImageTextureReleaseProc releaseProc,
PromiseImageTextureDoneProc doneProc, PromiseImageTextureContext textureContext,
@@ -531,9 +531,8 @@
// We pass kReadOnly here since we should treat content of the client's texture as immutable.
// The promise API provides no way for the client to indicated that the texture is protected.
- return proxyProvider->createLazyProxy(std::move(callback), backendFormat, {width, height},
- readSwizzle, GrRenderable::kNo, 1, origin, mipMapped,
- mipMapsStatus, GrInternalSurfaceFlags::kReadOnly,
- SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo,
- GrSurfaceProxy::UseAllocator::kYes);
+ return proxyProvider->createLazyProxy(
+ std::move(callback), backendFormat, {width, height}, readSwizzle, GrRenderable::kNo, 1,
+ mipMapped, mipMapsStatus, GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact,
+ SkBudgeted::kNo, GrProtected::kNo, GrSurfaceProxy::UseAllocator::kYes);
}
diff --git a/src/image/SkImage_GpuBase.h b/src/image/SkImage_GpuBase.h
index cc59705..05fc48f 100644
--- a/src/image/SkImage_GpuBase.h
+++ b/src/image/SkImage_GpuBase.h
@@ -80,8 +80,8 @@
// proxy along with the TextureFulfillProc and TextureReleaseProc. PromiseDoneProc must not
// be null.
static sk_sp<GrTextureProxy> MakePromiseImageLazyProxy(
- GrContext*, int width, int height, GrSurfaceOrigin, GrColorType, GrBackendFormat,
- GrMipMapped, PromiseImageTextureFulfillProc, PromiseImageTextureReleaseProc,
+ GrContext*, int width, int height, GrColorType, GrBackendFormat, GrMipMapped,
+ PromiseImageTextureFulfillProc, PromiseImageTextureReleaseProc,
PromiseImageTextureDoneProc, PromiseImageTextureContext, PromiseImageApiVersion);
static bool RenderYUVAToRGBA(GrContext* ctx, GrRenderTargetContext* renderTargetContext,
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index 2f7ced0..eedd399 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -382,9 +382,9 @@
}
auto proxy = MakePromiseImageLazyProxy(
- context, yuvaSizes[texIdx].width(), yuvaSizes[texIdx].height(), imageOrigin,
- colorType, yuvaFormats[texIdx], GrMipMapped::kNo, textureFulfillProc,
- textureReleaseProc, promiseDoneProc, textureContexts[texIdx], version);
+ context, yuvaSizes[texIdx].width(), yuvaSizes[texIdx].height(), colorType,
+ yuvaFormats[texIdx], GrMipMapped::kNo, textureFulfillProc, textureReleaseProc,
+ promiseDoneProc, textureContexts[texIdx], version);
++proxiesCreated;
if (!proxy) {
return nullptr;
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index e3d000d..81a874d 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -455,7 +455,7 @@
// 1. Check the cache for a pre-existing one
if (key.isValid()) {
- auto proxy = proxyProvider->findOrCreateProxyByUniqueKey(key, ct, kTopLeft_GrSurfaceOrigin);
+ auto proxy = proxyProvider->findOrCreateProxyByUniqueKey(key, ct);
if (proxy) {
SK_HISTOGRAM_ENUMERATION("LockTexturePath", kPreExisting_LockTexturePath,
kLockTexturePathCount);
diff --git a/src/image/SkSurface_GpuMtl.mm b/src/image/SkSurface_GpuMtl.mm
index d42fa54..8015948 100644
--- a/src/image/SkSurface_GpuMtl.mm
+++ b/src/image/SkSurface_GpuMtl.mm
@@ -79,7 +79,6 @@
dims,
readSwizzle,
sampleCnt,
- origin,
sampleCnt > 1 ? GrInternalSurfaceFlags::kRequiresManualMSAAResolve
: GrInternalSurfaceFlags::kNone,
metalLayer.framebufferOnly ? nullptr : &texInfo,
@@ -152,7 +151,6 @@
dims,
readSwizzle,
sampleCnt,
- origin,
sampleCnt > 1 ? GrInternalSurfaceFlags::kRequiresManualMSAAResolve
: GrInternalSurfaceFlags::kNone,
mtkView.framebufferOnly ? nullptr : &texInfo,