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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1500923004: Matrix convolution bounds fix; affectsTransparentBlack fixes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make filterPtr a required param for asAColorFilter. Created 5 years 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
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 6a3286ed67475510be347379142f35d8084cc5df..3f33bc3876a3e9a4a4c9ea753743941be6aa292c 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -309,9 +309,6 @@ void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
}
bool SkImageFilter::canComputeFastBounds() const {
- if (this->affectsTransparentBlack()) {
- return false;
- }
for (int i = 0; i < fInputCount; i++) {
SkImageFilter* input = this->getInput(i);
if (input && !input->canComputeFastBounds()) {
@@ -321,10 +318,6 @@ bool SkImageFilter::canComputeFastBounds() const {
return true;
}
-bool SkImageFilter::affectsTransparentBlack() const {
- return false;
-}
-
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const Context&,
SkBitmap*, SkIPoint*) const {
return false;
@@ -391,6 +384,14 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
return false;
}
+bool SkImageFilter::asAColorFilter(SkColorFilter** filterPtr) const {
+ SkASSERT(nullptr != filterPtr);
+ return this->countInputs() > 0 &&
+ NULL == this->getInput(0) &&
+ this->isColorFilterNode(filterPtr) &&
+ !(*filterPtr)->affectsTransparentBlack();
+}
+
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src,
const SkIPoint& srcOffset, SkIRect* dstBounds,
SkIRect* srcBounds) const {

Powered by Google App Engine
This is Rietveld 408576698