aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-28 06:21:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-28 06:21:55 -0700
commitaa19a5fbc58e372df11443c90a25f02a04ecef52 (patch)
tree4c6f03988d11d06477e9cedae7fda5d44dfcc650 /src
parentb8498825b54718cdd90c30c39323cfc433695f23 (diff)
Revert of Refactor drawContext/RenderTarget creation (patchset #8 id:140001 of https://codereview.chromium.org/1914883002/ )
Reason for revert: Experimental revert to see if this is blocking the DEPS roll. Original issue's description: > Refactor drawContext/RenderTarget creation > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002 > > Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1929833004
Diffstat (limited to 'src')
-rw-r--r--src/core/SkImageFilter.cpp17
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp22
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp17
-rw-r--r--src/effects/SkLightingImageFilter.cpp18
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp41
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp20
-rw-r--r--src/gpu/GrBlurUtils.cpp59
-rw-r--r--src/gpu/GrContext.cpp31
-rw-r--r--src/image/SkImage_Gpu.cpp33
9 files changed, 144 insertions, 114 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index d0042527e4..ed6d14ac14 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -280,9 +280,18 @@ sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
paint.addColorFragmentProcessor(fp.get());
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- bounds.width(), bounds.height(),
- kRGBA_8888_GrPixelConfig));
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fWidth = bounds.width();
+ desc.fHeight = bounds.height();
+ desc.fConfig = kRGBA_8888_GrPixelConfig;
+
+ sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc));
+ if (!dst) {
+ return nullptr;
+ }
+
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -294,7 +303,7 @@ sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- drawContext->asTexture());
+ std::move(dst));
}
#endif
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index cec45ba911..bfbcfd21f8 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -95,16 +95,24 @@ SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(const SkRegion& region,
sk_sp<GrTexture> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* context,
const SkMatrix& inMatrix,
const SkIRect& bounds) const {
- GrPixelConfig config;
+ GrSurfaceDesc maskDesc;
if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
- config = kAlpha_8_GrPixelConfig;
+ maskDesc.fConfig = kAlpha_8_GrPixelConfig;
} else {
- config = kRGBA_8888_GrPixelConfig;
+ maskDesc.fConfig = kRGBA_8888_GrPixelConfig;
+ }
+ maskDesc.fFlags = kRenderTarget_GrSurfaceFlag;
+ // Add one pixel of border to ensure that clamp mode will be all zeros
+ // the outside.
+ maskDesc.fWidth = bounds.width();
+ maskDesc.fHeight = bounds.height();
+ sk_sp<GrTexture> maskTexture(context->textureProvider()->createApproxTexture(maskDesc));
+ if (!maskTexture) {
+ return nullptr;
}
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- bounds.width(), bounds.height(),
- config));
+ sk_sp<GrDrawContext> drawContext(
+ context->drawContext(sk_ref_sp(maskTexture->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -121,7 +129,7 @@ sk_sp<GrTexture> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* contex
iter.next();
}
- return drawContext->asTexture();
+ return maskTexture;
}
#endif
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index cf9e2c3c9f..797bd972dd 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -317,6 +317,17 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
return nullptr;
}
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fWidth = bounds.width();
+ desc.fHeight = bounds.height();
+ desc.fConfig = kSkia8888_GrPixelConfig;
+
+ sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc));
+ if (!dst) {
+ return nullptr;
+ }
+
GrPaint paint;
SkMatrix offsetMatrix = GrCoordTransform::MakeDivByTextureWHMatrix(displTexture.get());
offsetMatrix.preTranslate(SkIntToScalar(colorOffset.fX - displOffset.fX),
@@ -335,9 +346,7 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
SkMatrix matrix;
matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colorBounds.y()));
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- bounds.width(), bounds.height(),
- kSkia8888_GrPixelConfig));
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -348,7 +357,7 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
offset->fY = bounds.top();
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- drawContext->asTexture());
+ std::move(dst));
}
#endif
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 6efb0f6c4e..7223ae5a1e 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -407,10 +407,18 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
sk_sp<GrTexture> inputTexture(input->asTextureRef(context));
SkASSERT(inputTexture);
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- offsetBounds.width(),
- offsetBounds.height(),
- kRGBA_8888_GrPixelConfig));
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag,
+ desc.fWidth = offsetBounds.width();
+ desc.fHeight = offsetBounds.height();
+ desc.fConfig = kRGBA_8888_GrPixelConfig;
+
+ sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc));
+ if (!dst) {
+ return nullptr;
+ }
+
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -454,7 +462,7 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- drawContext->asTexture());
+ std::move(dst));
}
#endif
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 2a0f078c05..9e87fe04a4 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -478,18 +478,26 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
SkASSERT(srcTexture);
// setup new clip
- const GrClip clip(SkRect::MakeWH(SkIntToScalar(srcTexture->width()),
- SkIntToScalar(srcTexture->height())));
-
- const SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height());
+ GrClip clip(SkRect::MakeWH(SkIntToScalar(srcTexture->width()),
+ SkIntToScalar(srcTexture->height())));
+
+ SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height());
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fWidth = rect.width();
+ desc.fHeight = rect.height();
+ desc.fConfig = kSkia8888_GrPixelConfig;
SkIRect srcRect = rect;
SkASSERT(radius.width() > 0 || radius.height() > 0);
if (radius.fWidth > 0) {
- sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- rect.width(), rect.height(),
- kSkia8888_GrPixelConfig));
+ GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
+ if (!scratch) {
+ return nullptr;
+ }
+ sk_sp<GrDrawContext> dstDrawContext(
+ context->drawContext(sk_ref_sp(scratch->asRenderTarget())));
if (!dstDrawContext) {
return nullptr;
}
@@ -499,18 +507,21 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
Gr1DKernelEffect::kX_Direction);
SkIRect clearRect = SkIRect::MakeXYWH(dstRect.fLeft, dstRect.fBottom,
dstRect.width(), radius.fHeight);
- GrColor clearColor = GrMorphologyEffect::kErode_MorphologyType == morphType
- ? SK_ColorWHITE
- : SK_ColorTRANSPARENT;
+ GrColor clearColor = GrMorphologyEffect::kErode_MorphologyType == morphType ?
+ SK_ColorWHITE :
+ SK_ColorTRANSPARENT;
dstDrawContext->clear(&clearRect, clearColor, false);
- srcTexture = dstDrawContext->asTexture();
+ srcTexture.reset(scratch);
srcRect = dstRect;
}
if (radius.fHeight > 0) {
- sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- rect.width(), rect.height(),
- kSkia8888_GrPixelConfig));
+ GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
+ if (!scratch) {
+ return nullptr;
+ }
+ sk_sp<GrDrawContext> dstDrawContext(
+ context->drawContext(sk_ref_sp(scratch->asRenderTarget())));
if (!dstDrawContext) {
return nullptr;
}
@@ -519,7 +530,7 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
srcRect, dstRect, radius.fHeight, morphType,
Gr1DKernelEffect::kY_Direction);
- srcTexture = dstDrawContext->asTexture();
+ srcTexture.reset(scratch);
}
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height()),
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index b1e19bbec3..b1ac1c32e0 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -176,6 +176,16 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
foregroundTex = foreground->asTextureRef(context);
}
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fWidth = bounds.width();
+ desc.fHeight = bounds.height();
+ desc.fConfig = kSkia8888_GrPixelConfig;
+ sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc));
+ if (!dst) {
+ return nullptr;
+ }
+
GrPaint paint;
// SRGBTODO: AllowSRGBInputs?
SkAutoTUnref<const GrFragmentProcessor> bgFP;
@@ -226,11 +236,11 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
mode.reset(new SkProcCoeffXfermode(rec, SkXfermode::kSrcOver_Mode));
}
- sk_sp<const GrFragmentProcessor> xferFP(mode->getFragmentProcessorForImageFilter(bgFP));
+ SkAutoTUnref<const GrFragmentProcessor> xferFP(mode->getFragmentProcessorForImageFilter(bgFP));
// A null 'xferFP' here means kSrc_Mode was used in which case we can just proceed
if (xferFP) {
- paint.addColorFragmentProcessor(xferFP.get());
+ paint.addColorFragmentProcessor(xferFP);
}
} else {
paint.addColorFragmentProcessor(bgFP);
@@ -238,9 +248,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- bounds.width(), bounds.height(),
- kSkia8888_GrPixelConfig));
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -251,7 +259,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- drawContext->asTexture());
+ std::move(dst));
}
#endif
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index f95bdfff02..6827c83421 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -93,34 +93,38 @@ static bool sw_draw_with_mask_filter(GrDrawContext* drawContext,
}
// Create a mask of 'devPath' and place the result in 'mask'.
-static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
- SkRect* maskRect,
- const SkPath& devPath,
- const GrStrokeInfo& strokeInfo,
- bool doAA,
- int sampleCnt) {
+static GrTexture* create_mask_GPU(GrContext* context,
+ SkRect* maskRect,
+ const SkPath& devPath,
+ const GrStrokeInfo& strokeInfo,
+ bool doAA,
+ int sampleCnt) {
// This mask will ultimately be drawn as a non-AA rect (see draw_mask).
// Non-AA rects have a bad habit of snapping arbitrarily. Integerize here
// so the mask draws in a reproducible manner.
*maskRect = SkRect::Make(maskRect->roundOut());
- if (!doAA) {
- // Don't need MSAA if mask isn't AA
- sampleCnt = 0;
- }
-
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fWidth = SkScalarCeilToInt(maskRect->width());
+ desc.fHeight = SkScalarCeilToInt(maskRect->height());
+ desc.fSampleCnt = doAA ? sampleCnt : 0;
// We actually only need A8, but it often isn't supported as a
// render target so default to RGBA_8888
- GrPixelConfig config = kRGBA_8888_GrPixelConfig;
- if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt > 0)) {
- config = kAlpha_8_GrPixelConfig;
+ desc.fConfig = kRGBA_8888_GrPixelConfig;
+
+ if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, desc.fSampleCnt > 0)) {
+ desc.fConfig = kAlpha_8_GrPixelConfig;
}
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- SkScalarCeilToInt(maskRect->width()),
- SkScalarCeilToInt(maskRect->height()),
- config,
- sampleCnt));
+ GrTexture* mask = context->textureProvider()->createApproxTexture(desc);
+ if (nullptr == mask) {
+ return nullptr;
+ }
+
+ SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height());
+
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(mask->asRenderTarget())));
if (!drawContext) {
return nullptr;
}
@@ -132,7 +136,6 @@ static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
// setup new clip
- const SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height());
GrClip clip(clipRect);
// Draw the mask into maskTexture with the path's integerized top-left at
@@ -140,7 +143,7 @@ static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
SkMatrix translate;
translate.setTranslate(-maskRect->fLeft, -maskRect->fTop);
drawContext->drawPath(clip, tempPaint, translate, devPath, strokeInfo);
- return drawContext->asTexture();;
+ return mask;
}
static void draw_path_with_mask_filter(GrContext* context,
@@ -216,16 +219,16 @@ static void draw_path_with_mask_filter(GrContext* context,
return;
}
- sk_sp<GrTexture> mask(create_mask_GPU(context,
- &maskRect,
- *devPathPtr,
- strokeInfo,
- paint->isAntiAlias(),
- drawContext->numColorSamples()));
+ SkAutoTUnref<GrTexture> mask(create_mask_GPU(context,
+ &maskRect,
+ *devPathPtr,
+ strokeInfo,
+ paint->isAntiAlias(),
+ drawContext->numColorSamples()));
if (mask) {
GrTexture* filtered;
- if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, maskRect, &filtered, true)) {
+ if (maskFilter->filterMaskGPU(mask, viewMatrix, maskRect, &filtered, true)) {
// filterMaskGPU gives us ownership of a ref to the result
SkAutoTUnref<GrTexture> atu(filtered);
if (draw_mask(drawContext, clip, viewMatrix, maskRect, paint, filtered)) {
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a186bd87bc..5ebb2e95fb 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -615,37 +615,6 @@ sk_sp<GrDrawContext> GrContext::drawContext(sk_sp<GrRenderTarget> rt,
return fDrawingManager->drawContext(std::move(rt), surfaceProps);
}
-sk_sp<GrDrawContext> GrContext::newDrawContext(BackingFit fit,
- int width, int height,
- GrPixelConfig config,
- int sampleCnt,
- GrSurfaceOrigin origin) {
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fOrigin = origin;
- desc.fWidth = width;
- desc.fHeight = height;
- desc.fConfig = config;
- desc.fSampleCnt = sampleCnt;
-
- sk_sp<GrTexture> tex;
- if (kTight_BackingFit == fit) {
- tex.reset(this->textureProvider()->createTexture(desc, SkBudgeted::kYes));
- } else {
- tex.reset(this->textureProvider()->createApproxTexture(desc));
- }
- if (!tex) {
- return nullptr;
- }
-
- sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(tex->asRenderTarget())));
- if (!drawContext) {
- return nullptr;
- }
-
- return drawContext;
-}
-
bool GrContext::abandoned() const {
ASSERT_SINGLE_OWNER
return fDrawingManager->abandoned();
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index eea7e2c040..a66a623638 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -249,16 +249,17 @@ sk_sp<SkImage> SkImage::MakeFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace
return nullptr;
}
- const int width = yuvSizes[0].fWidth;
- const int height = yuvSizes[0].fHeight;
-
+ GrSurfaceDesc dstDesc;
// Needs to be a render target in order to draw to it for the yuv->rgb conversion.
- sk_sp<GrDrawContext> drawContext(ctx->newDrawContext(GrContext::kTight_BackingFit,
- width, height,
- kRGBA_8888_GrPixelConfig,
- 0,
- origin));
- if (!drawContext) {
+ dstDesc.fFlags = kRenderTarget_GrSurfaceFlag;
+ dstDesc.fOrigin = origin;
+ dstDesc.fWidth = yuvSizes[0].fWidth;
+ dstDesc.fHeight = yuvSizes[0].fHeight;
+ dstDesc.fConfig = kRGBA_8888_GrPixelConfig;
+ dstDesc.fSampleCnt = 0;
+
+ SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, SkBudgeted::kYes));
+ if (!dst) {
return nullptr;
}
@@ -267,13 +268,17 @@ sk_sp<SkImage> SkImage::MakeFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace
paint.addColorFragmentProcessor(GrYUVEffect::CreateYUVToRGB(yTex, uTex, vTex, yuvSizes,
colorSpace))->unref();
- const SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
+ const SkRect rect = SkRect::MakeWH(SkIntToScalar(dstDesc.fWidth),
+ SkIntToScalar(dstDesc.fHeight));
+ sk_sp<GrDrawContext> drawContext(ctx->drawContext(sk_ref_sp(dst->asRenderTarget())));
+ if (!drawContext) {
+ return nullptr;
+ }
drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), rect);
- ctx->flushSurfaceWrites(drawContext->accessRenderTarget());
- return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID,
- kOpaque_SkAlphaType,
- drawContext->asTexture().get(), budgeted);
+ ctx->flushSurfaceWrites(dst);
+ return sk_make_sp<SkImage_Gpu>(dstDesc.fWidth, dstDesc.fHeight, kNeedNewImageUniqueID,
+ kOpaque_SkAlphaType, dst, budgeted);
}
static sk_sp<SkImage> create_image_from_maker(GrTextureMaker* maker, SkAlphaType at, uint32_t id) {