Always force GPU generated masks be top left

Bug: 878195
Change-Id: Ie5e89753c2251ee1b4bd60ac2b02cedb7f5292f7
Reviewed-on: https://skia-review.googlesource.com/150133
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2018-08-29 12:19:46 -04:00 committed by Skia Commit-Bot
parent 33ac15e452
commit 0b7ce069f2
2 changed files with 19 additions and 6 deletions

View File

@ -120,7 +120,9 @@ static sk_sp<GrRenderTargetContext> convolve_gaussian_2d(GrContext* context,
sk_sp<GrRenderTargetContext> renderTargetContext;
renderTargetContext = context->contextPriv().makeDeferredRenderTargetContext(
dstFit, dstII.width(), dstII.height(),
config, dstII.refColorSpace());
config, dstII.refColorSpace(),
1, GrMipMapped::kNo,
proxy->origin());
if (!renderTargetContext) {
return nullptr;
}
@ -162,7 +164,9 @@ static sk_sp<GrRenderTargetContext> convolve_gaussian(GrContext* context,
fit, srcRect.width(),
srcRect.height(),
config,
dstII.refColorSpace());
dstII.refColorSpace(),
1, GrMipMapped::kNo,
proxy->origin());
if (!dstRenderTargetContext) {
return nullptr;
}
@ -279,7 +283,9 @@ static sk_sp<GrTextureProxy> decimate(GrContext* context,
SkBackingFit::kApprox,
dstRect.fRight,
dstRect.fBottom,
config, dstII.refColorSpace());
config, dstII.refColorSpace(),
1, GrMipMapped::kNo,
src->origin());
if (!dstRenderTargetContext) {
return nullptr;
}
@ -377,7 +383,9 @@ static sk_sp<GrRenderTargetContext> reexpand(GrContext* context,
sk_sp<GrRenderTargetContext> dstRenderTargetContext =
context->contextPriv().makeDeferredRenderTargetContext(fit, dstII.width(), dstII.height(),
config, dstII.refColorSpace());
config, dstII.refColorSpace(),
1, GrMipMapped::kNo,
srcProxy->origin());
if (!dstRenderTargetContext) {
return nullptr;
}
@ -532,6 +540,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
mode, finalDestII, fit);
}
SkASSERT(dstRenderTargetContext->origin() == srcProxy->origin());
return dstRenderTargetContext;
}

View File

@ -156,6 +156,8 @@ static bool sw_draw_with_mask_filter(GrContext* context,
return false;
}
SkASSERT(kTopLeft_GrSurfaceOrigin == filteredMask->origin());
drawRect = dstM.fBounds;
if (key.isValid()) {
@ -176,7 +178,7 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
sk_sp<GrRenderTargetContext> rtContext(
context->contextPriv().makeDeferredRenderTargetContextWithFallback(
SkBackingFit::kApprox, maskRect.width(), maskRect.height(), kAlpha_8_GrPixelConfig,
nullptr, sampleCnt));
nullptr, sampleCnt, GrMipMapped::kNo, kTopLeft_GrSurfaceOrigin));
if (!rtContext) {
return nullptr;
}
@ -387,7 +389,7 @@ static void draw_shape_with_mask_filter(GrContext* context,
if (maskKey.isValid()) {
// TODO: this cache look up is duplicated in sw_draw_with_mask_filter for raster
filteredMask = proxyProvider->findOrCreateProxyByUniqueKey(
maskKey, renderTargetContext->origin());
maskKey, kTopLeft_GrSurfaceOrigin);
}
if (!filteredMask) {
@ -402,6 +404,8 @@ static void draw_shape_with_mask_filter(GrContext* context,
std::move(maskProxy),
viewMatrix,
maskRect);
SkASSERT(kTopLeft_GrSurfaceOrigin == filteredMask->origin());
if (filteredMask && maskKey.isValid()) {
proxyProvider->assignUniqueKeyToProxy(maskKey, filteredMask.get());
}