Index: src/core/SkMatrix.cpp |
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp |
index dfeb721d45e68394f4bf2db1906c11d708f044e3..c6c79631929f11ed9cd2bc96bcd883eb76d70ab3 100644 |
--- a/src/core/SkMatrix.cpp |
+++ b/src/core/SkMatrix.cpp |
@@ -1623,8 +1623,12 @@ void SkMatrix::toString(SkString* str) const { |
#include "SkMatrixUtils.h" |
-bool SkTreatAsSprite(const SkMatrix& mat, int width, int height, |
- unsigned subpixelBits) { |
+bool SkTreatAsSprite(const SkMatrix& mat, const SkISize& size, const SkPaint& paint) { |
+ // AA is applied using alpha modulation => 8 bits. |
+ static const unsigned kAntiAliasSubpixelBits = 8; |
reed1
2016/01/07 14:40:50
we have various AA techniques: paths get 2 subpixe
f(malita)
2016/01/07 15:19:00
4 seems to work just as well, and it matches the p
|
+ |
+ const unsigned subpixelBits = paint.isAntiAlias() ? kAntiAliasSubpixelBits : 0; |
+ |
// quick reject on affine or perspective |
if (mat.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask)) { |
return false; |
@@ -1641,7 +1645,7 @@ bool SkTreatAsSprite(const SkMatrix& mat, int width, int height, |
} |
SkRect dst; |
- SkIRect isrc = { 0, 0, width, height }; |
+ SkIRect isrc = SkIRect::MakeSize(size); |
{ |
SkRect src; |