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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 769953002: Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMatrixImageFilter.cpp » ('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 cdcf66f6921ec939b42460301a5b7a94b58da36b..045f6a96d58cce817489badad9c3162e01c342b6 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -76,50 +76,6 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create(
input, cropRect, uniqueID));
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
-static bool tile_mode_is_valid(SkMatrixConvolutionImageFilter::TileMode tileMode) {
- switch (tileMode) {
- case SkMatrixConvolutionImageFilter::kClamp_TileMode:
- case SkMatrixConvolutionImageFilter::kRepeat_TileMode:
- case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode:
- return true;
- default:
- break;
- }
- return false;
-}
-
-SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkReadBuffer& buffer)
- : INHERITED(1, buffer) {
- fKernelSize.fWidth = buffer.readInt();
- fKernelSize.fHeight = buffer.readInt();
- if ((fKernelSize.fWidth >= 1) && (fKernelSize.fHeight >= 1) &&
- // Make sure size won't be larger than a signed int,
- // which would still be extremely large for a kernel,
- // but we don't impose a hard limit for kernel size
- (gMaxKernelSize / fKernelSize.fWidth >= fKernelSize.fHeight)) {
- size_t size = fKernelSize.fWidth * fKernelSize.fHeight;
- fKernel = SkNEW_ARRAY(SkScalar, size);
- SkDEBUGCODE(bool success =) buffer.readScalarArray(fKernel, size);
- SkASSERT(success);
- } else {
- fKernel = 0;
- }
- fGain = buffer.readScalar();
- fBias = buffer.readScalar();
- fKernelOffset.fX = buffer.readInt();
- fKernelOffset.fY = buffer.readInt();
- fTileMode = (TileMode) buffer.readInt();
- fConvolveAlpha = buffer.readBool();
- buffer.validate((fKernel != 0) &&
- SkScalarIsFinite(fGain) &&
- SkScalarIsFinite(fBias) &&
- tile_mode_is_valid(fTileMode) &&
- (fKernelOffset.fX >= 0) && (fKernelOffset.fX < fKernelSize.fWidth) &&
- (fKernelOffset.fY >= 0) && (fKernelOffset.fY < fKernelSize.fHeight));
-}
-#endif
-
SkFlattenable* SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkISize kernelSize;
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMatrixImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698