| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index 23f5798c1af758bcc4323f5e9abba3c83454ae75..6df0af6c7a5dc43a8ac126c90c3d9e1973fe72b5 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -1451,16 +1451,20 @@ sk_sp<SkSpecialImage> SkGpuDevice::snapSpecial() {
|
| // When the device doesn't have a texture, we create a temporary texture.
|
| // TODO: we should actually only copy the portion of the source needed to apply the image
|
| // filter
|
| - texture.reset(fContext->textureProvider()->createTexture(this->accessDrawContext()->desc(),
|
| - SkBudgeted::kYes));
|
| - if (!texture) {
|
| - return nullptr;
|
| - }
|
| + const GrSurfaceDesc& desc = this->accessDrawContext()->desc();
|
|
|
| - if (!fContext->copySurface(this->accessDrawContext()->accessRenderTarget(),
|
| - texture.get())) {
|
| - return nullptr;
|
| - }
|
| + sk_sp<GrDrawContext> dc(fContext->newDrawContext(SkBackingFit::kApprox,
|
| + desc.fWidth, desc.fHeight,
|
| + desc.fConfig,
|
| + desc.fSampleCnt,
|
| + kDefault_GrSurfaceOrigin,
|
| + &this->surfaceProps()));
|
| +
|
| + dc->copySurface(this->accessDrawContext()->accessRenderTarget(),
|
| + SkIRect::MakeWH(desc.fWidth, desc.fHeight),
|
| + SkIPoint::Make(0, 0));
|
| +
|
| + texture = dc->asTexture();
|
| }
|
|
|
| const SkImageInfo ii = this->imageInfo();
|
|
|