- _effectFilter = [[CIFilter filterWithName:@"CIShapedWaterRipple"] retain];
- [_effectFilter setDefaults];
- [_effectFilter setValue:[NSNumber numberWithFloat:50.0] forKey:@"inputCornerRadius"];
- [_effectFilter setValue:[CIVector vectorWithX:rippleRect.origin.x Y:rippleRect.origin.y] forKey:@"inputPoint0"];
- [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width) Y:(rippleRect.origin.y + rippleRect.size.height)] forKey:@"inputPoint1"];
- [_effectFilter setValue:[NSNumber numberWithFloat:0.0] forKey:@"inputPhase"];
+ if (_ripple) {
+ _effectFilter = [[CIFilter filterWithName:@"CIShapedWaterRipple"] retain];
+ [_effectFilter setDefaults];
+ [_effectFilter setValue:[NSNumber numberWithFloat:50.0] forKey:@"inputCornerRadius"];
+ [_effectFilter setValue:[CIVector vectorWithX:rippleRect.origin.x Y:rippleRect.origin.y] forKey:@"inputPoint0"];
+ [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width) Y:(rippleRect.origin.y + rippleRect.size.height)] forKey:@"inputPoint1"];
+ [_effectFilter setValue:[NSNumber numberWithFloat:0.0] forKey:@"inputPhase"];
+ } else {
+ _effectFilter = [[CIFilter filterWithName:@"CIZoomBlur"] retain];
+ [_effectFilter setDefaults];
+ [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width / 2) Y:(rippleRect.origin.y + rippleRect.size.height / 2)] forKey:@"inputCenter"];
+ }