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); |