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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 422123003: Adding repeat mode to texture domain (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 6 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 | « gm/texturedomaineffect.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index f1017203bf8d66806f1b9231f0df3663c4111221..6e1d1a46521656bbfe7d196c1dad36b2572175e1 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -319,24 +319,25 @@ bool SkMatrixConvolutionImageFilter::onFilterBounds(const SkIRect& src, const Sk
#if SK_SUPPORT_GPU
-static GrMatrixConvolutionEffect::TileMode convert_tilemodes(
+static GrTextureDomain::Mode convert_tilemodes(
SkMatrixConvolutionImageFilter::TileMode tileMode) {
- GR_STATIC_ASSERT(static_cast<int>(SkMatrixConvolutionImageFilter::kClamp_TileMode) ==
- static_cast<int>(GrMatrixConvolutionEffect::kClamp_TileMode));
- GR_STATIC_ASSERT(static_cast<int>(SkMatrixConvolutionImageFilter::kRepeat_TileMode) ==
- static_cast<int>(GrMatrixConvolutionEffect::kRepeat_TileMode));
- GR_STATIC_ASSERT(static_cast<int>(SkMatrixConvolutionImageFilter::kClampToBlack_TileMode) ==
- static_cast<int>(GrMatrixConvolutionEffect::kClampToBlack_TileMode));
- GR_STATIC_ASSERT(static_cast<int>(SkMatrixConvolutionImageFilter::kMax_TileMode) ==
- static_cast<int>(GrMatrixConvolutionEffect::kMax_TileMode));
- return static_cast<GrMatrixConvolutionEffect::TileMode>(tileMode);
+ switch (tileMode) {
+ case SkMatrixConvolutionImageFilter::kClamp_TileMode:
+ return GrTextureDomain::kClamp_Mode;
+ case SkMatrixConvolutionImageFilter::kRepeat_TileMode:
+ return GrTextureDomain::kRepeat_Mode;
+ case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode:
+ return GrTextureDomain::kDecal_Mode;
+ default:
+ SkASSERT(false);
+ }
+ return GrTextureDomain::kIgnore_Mode;
}
bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffect** effect,
GrTexture* texture,
const SkMatrix&,
- const SkIRect& bounds
- ) const {
+ const SkIRect& bounds) const {
if (!effect) {
return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
}
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698