aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBBHFactory.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-11-19 07:17:16 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-19 07:17:17 -0800
commit7c4cdd2c5b7b6c71fa0e7612594f7885f2dbf264 (patch)
tree06ea08866680ce7abe2fdc7cdca0eb0321684ace /src/core/SkBBHFactory.cpp
parent7e76bff26e7c74902841ca4f607eb0b24a833a4a (diff)
Revert of allow pictures to have a full bounds (patchset #3 id:40001 of https://codereview.chromium.org/736583004/)
Reason for revert: needed to update legacy width() helpers Original issue's description: > allow pictures to have a full bounds > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/7e76bff26e7c74902841ca4f607eb0b24a833a4a TBR=fmalita@google.com,mtklein@google.com,robertphillips@google.com,fmalita@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/722043005
Diffstat (limited to 'src/core/SkBBHFactory.cpp')
-rw-r--r--src/core/SkBBHFactory.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/core/SkBBHFactory.cpp b/src/core/SkBBHFactory.cpp
index 4b9ae558e2..22f816c4d9 100644
--- a/src/core/SkBBHFactory.cpp
+++ b/src/core/SkBBHFactory.cpp
@@ -9,20 +9,15 @@
#include "SkRTree.h"
#include "SkTileGrid.h"
-SkBBoxHierarchy* SkRTreeFactory::operator()(const SkRect& bounds) const {
- SkScalar aspectRatio = bounds.width() / bounds.height();
+
+SkBBoxHierarchy* SkRTreeFactory::operator()(int width, int height) const {
+ SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width), SkIntToScalar(height));
return SkNEW_ARGS(SkRTree, (aspectRatio));
}
-SkBBoxHierarchy* SkTileGridFactory::operator()(const SkRect& bounds) const {
+SkBBoxHierarchy* SkTileGridFactory::operator()(int width, int height) const {
SkASSERT(fInfo.fMargin.width() >= 0);
SkASSERT(fInfo.fMargin.height() >= 0);
-
- // We want a conservative answer for the size...
- const SkIRect ibounds = bounds.roundOut();
- const int width = ibounds.width();
- const int height = ibounds.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