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

Unified Diff: src/effects/SkMagnifierImageFilter.cpp

Issue 13602013: Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This w… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix return value of SkImageFilter::asNewEffect(). Created 7 years, 8 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
Index: src/effects/SkMagnifierImageFilter.cpp
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index f6675c4776c20c268bfd8267954b4dbe6568e226..a68ab7cc967c5c41b0996fe15e921007e9456115 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -212,7 +212,7 @@ GrEffectRef* GrMagnifierEffect::TestCreate(SkMWCRandom* random,
uint32_t y = random->nextULessThan(kMaxHeight - height);
SkScalar inset = SkIntToScalar(random->nextULessThan(kMaxInset));
- SkAutoTUnref<SkImageFilter> filter(
+ SkAutoTUnref<SkMagnifierImageFilter> filter(
new SkMagnifierImageFilter(
SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(y),
SkIntToScalar(width), SkIntToScalar(height)),
@@ -263,22 +263,20 @@ SkMagnifierImageFilter::SkMagnifierImageFilter(SkRect srcRect, SkScalar inset)
SkASSERT(srcRect.x() >= 0 && srcRect.y() >= 0 && inset >= 0);
}
-bool SkMagnifierImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture) const {
#if SK_SUPPORT_GPU
+bool SkMagnifierImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture) const {
if (effect) {
- *effect = GrMagnifierEffect::Create(texture,
- fSrcRect.x() / texture->width(),
- fSrcRect.y() / texture->height(),
- texture->width() / fSrcRect.width(),
- texture->height() / fSrcRect.height(),
- fInset / texture->width(),
- fInset / texture->height());
+ *effect = GrMagnifierEffect::Create(texture,
+ fSrcRect.x() / texture->width(),
+ fSrcRect.y() / texture->height(),
+ texture->width() / fSrcRect.width(),
+ texture->height() / fSrcRect.height(),
+ fInset / texture->width(),
+ fInset / texture->height());
}
return true;
-#else
- return false;
-#endif
}
+#endif
void SkMagnifierImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);

Powered by Google App Engine
This is Rietveld 408576698