aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPaint.cpp19
-rw-r--r--src/core/SkPathEffect.cpp4
2 files changed, 17 insertions, 6 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 15fdbd196e..66fa0df1be 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2044,16 +2044,24 @@ bool SkPaint::getFillPath(const SkPath& src, SkPath* dst) const {
return width != 0; // return true if we're filled, or false if we're hairline (width == 0)
}
-const SkRect& SkPaint::doComputeFastBounds(const SkRect& src,
+const SkRect& SkPaint::doComputeFastBounds(const SkRect& origSrc,
SkRect* storage) const {
SkASSERT(storage);
+ const SkRect* src = &origSrc;
+
if (this->getLooper()) {
SkASSERT(this->getLooper()->canComputeFastBounds(*this));
- this->getLooper()->computeFastBounds(*this, src, storage);
+ this->getLooper()->computeFastBounds(*this, *src, storage);
return *storage;
}
+ SkRect tmpSrc;
+ if (this->getPathEffect()) {
+ this->getPathEffect()->computeFastBounds(&tmpSrc, origSrc);
+ src = &tmpSrc;
+ }
+
if (this->getStyle() != SkPaint::kFill_Style) {
// since we're stroked, outset the rect by the radius (and join type)
SkScalar radius = SkScalarHalf(this->getStrokeWidth());
@@ -2065,13 +2073,12 @@ const SkRect& SkPaint::doComputeFastBounds(const SkRect& src,
radius = SkScalarMul(radius, scale);
}
}
- storage->set(src.fLeft - radius, src.fTop - radius,
- src.fRight + radius, src.fBottom + radius);
+ storage->set(src->fLeft - radius, src->fTop - radius,
+ src->fRight + radius, src->fBottom + radius);
} else {
- *storage = src;
+ *storage = *src;
}
- // check the mask filter
if (this->getMaskFilter()) {
this->getMaskFilter()->computeFastBounds(*storage, storage);
}
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp
index 8731aedb84..dcce6d6b56 100644
--- a/src/core/SkPathEffect.cpp
+++ b/src/core/SkPathEffect.cpp
@@ -11,6 +11,10 @@
#include "SkPath.h"
#include "SkBuffer.h"
+void SkPathEffect::computeFastBounds(SkRect* dst, const SkRect& src) {
+ *dst = src;
+}
+
///////////////////////////////////////////////////////////////////////////////
SkPairPathEffect::SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1)