Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2145343005: Recast draw_filter_into_device as drawDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698