+ if (!EnsureIsValid())
+ return true;
+
+ if (m_interpolation == interpolation)
+ return true;
+
+ m_interpolation = interpolation;
+ CGInterpolationQuality quality;
+
+ switch (interpolation)
+ {
+ case wxINTERPOLATION_DEFAULT:
+ quality = kCGInterpolationDefault;
+ break;
+ case wxINTERPOLATION_NONE:
+ quality = kCGInterpolationNone;
+ break;
+ case wxINTERPOLATION_FAST:
+ quality = kCGInterpolationLow;
+ break;
+ case wxINTERPOLATION_GOOD:
+#if wxOSX_USE_COCOA_OR_CARBON
+ quality = UMAGetSystemVersion() < 0x1060 ? kCGInterpolationHigh : (CGInterpolationQuality) 4 /*kCGInterpolationMedium only on 10.6*/;
+#else
+ quality = kCGInterpolationMedium;
+#endif
+ break;
+ case wxINTERPOLATION_BEST:
+ quality = kCGInterpolationHigh;
+ break;
+ default:
+ return false;
+ }
+ CGContextSetInterpolationQuality(m_cgContext, quality);
+ return true;