Bug 722164 - Set Azure Quartz Canvas image interpolation to low for better performance. r=jmuizelaar
authorBenoit Girard <b56girard@gmail.com>
Sun, 29 Jan 2012 17:08:58 -0500
changeset 88197 bf005f6e4d5f39c42b3cb0c50e8e852f6d1cd7e0
parent 88196 8e80c7006ebafa9775bd228aaa10c3afa6f16217
child 88198 e4ed1817e1a77d3b2ed4cc0d1a9bdb3026585876
push idunknown
push userunknown
push dateunknown
reviewersjmuizelaar
bugs722164
milestone12.0a1
Bug 722164 - Set Azure Quartz Canvas image interpolation to low for better performance. r=jmuizelaar
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -860,16 +860,24 @@ DrawTargetCG::Init(const IntSize &aSize,
                                bitinfo);
 
 
   assert(mCg);
   // CGContext's default to have the origin at the bottom left
   // so flip it to the top left
   CGContextTranslateCTM(mCg, 0, mSize.height);
   CGContextScaleCTM(mCg, 1, -1);
+  // See Bug 722164 for performance details
+  // Medium or higher quality lead to expensive interpolation
+  // for canvas we want to use low quality interpolation
+  // to have competitive performance with other canvas
+  // implementation.
+  // XXX: Create input parameter to control interpolation and
+  //      use the default for content.
+  CGContextSetInterpolationQuality(mCg, kCGInterpolationLow);
 
   //XXX: set correct format
   mFormat = FORMAT_B8G8R8A8;
 
   return true;
 }
 
 TemporaryRef<PathBuilder>