aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-03 02:01:32 +0000
committerGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-03 02:01:32 +0000
commit422188f3c6286d2991a029027958387b070e4dc6 (patch)
treef23b9fc2377f8354ceb555b760bf394e5fe99ab1 /src
parent7d474f8a84a74421bd8d119124daa64ec1710f76 (diff)
Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@6982 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMatrix.cpp16
-rw-r--r--src/core/SkMatrixUtils.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 4845f59592..15d295cc27 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1812,41 +1812,41 @@ bool SkTreatAsSprite(const SkMatrix& mat, const SkRect& src,
if (mat.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask)) {
return false;
}
-
+
// quick success check
if (!subpixelBits && !(mat.getType() & ~SkMatrix::kTranslate_Mask)) {
return true;
}
-
+
// mapRect supports negative scales, so we eliminate those first
if (mat.getScaleX() < 0 || mat.getScaleY() < 0) {
return false;
}
-
+
SkRect dst;
SkIRect isrc, idst;
-
+
mat.mapRect(&dst, src);
-
+
{
SkRect tmp = src;
tmp.offset(mat.getTranslateX(), mat.getTranslateY());
tmp.round(&isrc);
}
-
+
if (subpixelBits) {
isrc.fLeft <<= subpixelBits;
isrc.fTop <<= subpixelBits;
isrc.fRight <<= subpixelBits;
isrc.fBottom <<= subpixelBits;
-
+
const float scale = 1 << subpixelBits;
dst.fLeft *= scale;
dst.fTop *= scale;
dst.fRight *= scale;
dst.fBottom *= scale;
}
-
+
dst.round(&idst);
return isrc == idst;
}
diff --git a/src/core/SkMatrixUtils.h b/src/core/SkMatrixUtils.h
index db7370c97c..04c0892776 100644
--- a/src/core/SkMatrixUtils.h
+++ b/src/core/SkMatrixUtils.h
@@ -27,6 +27,6 @@
* of subpixel-bits to simulate filtering.
*/
bool SkTreatAsSprite(const SkMatrix&, const SkRect& src, unsigned subpixelBits);
-
+
#endif