Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Unified Diff: src/core/SkPaint.cpp

Issue 1296943002: Implement canComputeFastBounds() for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Put SkColorFilter::affectsTransparentBlack() back as a non-virtual helper. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index f64ab1d844784a02b1028ad5cdf16dd6fc0080f1..4ab8927114491bc2650595301a5b45f9efef0eed 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2063,6 +2063,16 @@ bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect
return !rec.isHairlineStyle();
}
+bool SkPaint::canComputeFastBounds() const {
+ if (this->getLooper()) {
+ return this->getLooper()->canComputeFastBounds(*this);
+ }
+ if (this->getImageFilter() && !this->getImageFilter()->canComputeFastBounds()) {
+ return false;
+ }
+ return !this->getRasterizer();
+}
+
const SkRect& SkPaint::doComputeFastBounds(const SkRect& origSrc,
SkRect* storage,
Style style) const {
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698