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

Unified Diff: src/core/SkImageFilter.cpp

Issue 27521002: Remove support for SK_CROP_RECT_IS_INT, now that it is no longer used in Blink or Chrome. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add comment Created 7 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 | « include/core/SkImageFilter.h ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index c8c0c4dbf8257000d8eaa9bb07cf788a6730849d..ee43c0e019d3037cc6c094524b738cf4f38834b6 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -21,11 +21,7 @@ SK_DEFINE_INST_COUNT(SkImageFilter)
SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect)
: fInputCount(inputCount),
fInputs(new SkImageFilter*[inputCount]),
-#ifdef SK_CROP_RECT_IS_INT
- fCropRect(cropRect ? *cropRect : SkIRect::MakeLargest()) {
-#else
fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)) {
-#endif
for (int i = 0; i < inputCount; ++i) {
fInputs[i] = inputs[i];
SkSafeRef(fInputs[i]);
@@ -35,22 +31,14 @@ SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropR
SkImageFilter::SkImageFilter(SkImageFilter* input, const CropRect* cropRect)
: fInputCount(1),
fInputs(new SkImageFilter*[1]),
-#ifdef SK_CROP_RECT_IS_INT
- fCropRect(cropRect ? *cropRect : SkIRect::MakeLargest()) {
-#else
fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)) {
-#endif
fInputs[0] = input;
SkSafeRef(fInputs[0]);
}
SkImageFilter::SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect* cropRect)
: fInputCount(2), fInputs(new SkImageFilter*[2]),
-#ifdef SK_CROP_RECT_IS_INT
- fCropRect(cropRect ? *cropRect : SkIRect::MakeLargest()) {
-#else
fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)) {
-#endif
fInputs[0] = input1;
fInputs[1] = input2;
SkSafeRef(fInputs[0]);
@@ -73,12 +61,8 @@ SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
fInputs[i] = NULL;
}
}
-#ifdef SK_CROP_RECT_IS_INT
- buffer.readIRect(&fCropRect);
-#else
buffer.readRect(&fCropRect.fRect);
fCropRect.fFlags = buffer.readUInt();
-#endif
}
void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
@@ -90,12 +74,8 @@ void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
buffer.writeFlattenable(input);
}
}
-#ifdef SK_CROP_RECT_IS_INT
- buffer.writeIRect(fCropRect);
-#else
buffer.writeRect(fCropRect.fRect);
buffer.writeUInt(fCropRect.fFlags);
-#endif
}
bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
@@ -178,16 +158,6 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMa
bool SkImageFilter::applyCropRect(SkIRect* rect, const SkMatrix& matrix) const {
SkRect cropRect;
-#ifdef SK_CROP_RECT_IS_INT
- matrix.mapRect(&cropRect, SkRect::Make(fCropRect));
- SkIRect cropRectI;
- cropRect.roundOut(&cropRectI);
- // If the original crop rect edges were unset, max out the new crop edges
- if (fCropRect.fLeft == SK_MinS32) cropRectI.fLeft = SK_MinS32;
- if (fCropRect.fTop == SK_MinS32) cropRectI.fTop = SK_MinS32;
- if (fCropRect.fRight == SK_MaxS32) cropRectI.fRight = SK_MaxS32;
- if (fCropRect.fBottom == SK_MaxS32) cropRectI.fBottom = SK_MaxS32;
-#else
matrix.mapRect(&cropRect, fCropRect.fRect);
SkIRect cropRectI;
cropRect.roundOut(&cropRectI);
@@ -196,7 +166,6 @@ bool SkImageFilter::applyCropRect(SkIRect* rect, const SkMatrix& matrix) const {
if (!(fCropRect.fFlags & CropRect::kHasTop_CropEdge)) cropRectI.fTop = SK_MinS32;
if (!(fCropRect.fFlags & CropRect::kHasRight_CropEdge)) cropRectI.fRight = SK_MaxS32;
if (!(fCropRect.fFlags & CropRect::kHasBottom_CropEdge)) cropRectI.fBottom = SK_MaxS32;
-#endif
return rect->intersect(cropRectI);
}
« no previous file with comments | « include/core/SkImageFilter.h ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698