Index: src/core/SkBBHFactory.cpp |
diff --git a/src/core/SkBBHFactory.cpp b/src/core/SkBBHFactory.cpp |
index 22f816c4d9570b7760d64c198bde853f470320c7..9fa448bf604c07fbe31602098a75bf16d6bb22a4 100644 |
--- a/src/core/SkBBHFactory.cpp |
+++ b/src/core/SkBBHFactory.cpp |
@@ -9,15 +9,18 @@ |
#include "SkRTree.h" |
#include "SkTileGrid.h" |
- |
-SkBBoxHierarchy* SkRTreeFactory::operator()(int width, int height) const { |
- SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width), SkIntToScalar(height)); |
+SkBBoxHierarchy* SkRTreeFactory::operator()(const SkRect& bounds) const { |
+ SkScalar aspectRatio = bounds.width() / bounds.height(); |
return SkNEW_ARGS(SkRTree, (aspectRatio)); |
} |
-SkBBoxHierarchy* SkTileGridFactory::operator()(int width, int height) const { |
+SkBBoxHierarchy* SkTileGridFactory::operator()(const SkRect& bounds) const { |
SkASSERT(fInfo.fMargin.width() >= 0); |
SkASSERT(fInfo.fMargin.height() >= 0); |
+ |
+ const int width = SkScalarRoundToInt(bounds.width()); |
mtklein
2014/11/18 21:06:49
Is RoundToInt away-from-zero?
reed1
2014/11/18 22:05:30
Nope, but I can change it to that.
Really what we
mtklein
2014/11/18 22:26:11
That sounds right.
reed1
2014/11/19 14:49:16
Done.
|
+ const int height = SkScalarRoundToInt(bounds.height()); |
+ |
// Note: SkIRects are non-inclusive of the right() column and bottom() row. |
// For example, an SkIRect at 0,0 with a size of (1,1) will only have |
// content at pixel (0,0) and will report left=0 and right=1, hence the |