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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 679113004: Use approximate scratch textures for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: -one more time we're gonna celebrate Created 6 years, 2 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 | « expectations/gm/ignored-tests.txt ('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 07b7f75e92a2bd2ff9a269855fe526fe39de6287..096b848ab0c2e02babd5d4f7a1f68f0004ba224f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1763,11 +1763,13 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
unsigned flags = info.isOpaque() ? 0 : kNeedClear_Flag;
#if CACHE_COMPATIBLE_DEVICE_TEXTURES
- // layers are never draw in repeat modes, so we can request an approx
- // match and ignore any padding.
- const GrContext::ScratchTexMatch match = (kSaveLayer_Usage == usage) ?
- GrContext::kApprox_ScratchTexMatch :
- GrContext::kExact_ScratchTexMatch;
+ // layers are never draw in repeat modes or with mip maps, so we can request an approx
+ // match and ignore any padding. Image filters (at present) don't tile their inputs or use mip
+ // maps, either.
+ const GrContext::ScratchTexMatch match =
+ (kSaveLayer_Usage == usage || kImageFilter_Usage == usage) ?
+ GrContext::kApprox_ScratchTexMatch :
+ GrContext::kExact_ScratchTexMatch;
texture.reset(fContext->refScratchTexture(desc, match));
#else
texture.reset(fContext->createUncachedTexture(desc, NULL, 0));
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698