Bug 950511 - Back out part 1 from bug 941095 (DrawTargetCG::SetPermitSubpixelAA) because it's unnecessary and causes bad text rendering in context menus. a=backout
authorMarkus Stange <mstange@themasta.com>
Tue, 04 Feb 2014 21:03:12 +0100
changeset 183647 ae49057fdd6ef199cd576c40d60bda1ce6ac7d47
parent 183646 5fc85c474c8b04201a810f31bf816fba373b9810
child 183648 f36faa669bf26c2eb4a290eb48a38aed592f340a
push idunknown
push userunknown
push dateunknown
reviewersbackout
bugs950511, 941095
milestone29.0a2
Bug 950511 - Back out part 1 from bug 941095 (DrawTargetCG::SetPermitSubpixelAA) because it's unnecessary and causes bad text rendering in context menus. a=backout
gfx/2d/DrawTargetCG.cpp
gfx/2d/DrawTargetCG.h
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -1336,17 +1336,16 @@ DrawTargetCG::Init(BackendType aType,
   // 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);
-  CGContextSetShouldSmoothFonts(mCg, GetPermitSubpixelAA());
 
 
   if (aType == BackendType::COREGRAPHICS_ACCELERATED) {
     // The bitmap backend uses callac to clear, we can't do that without
     // reading back the surface. This should trigger something equivilent
     // to glClear.
     ClearRect(Rect(0, 0, mSize.width, mSize.height));
   }
@@ -1376,17 +1375,16 @@ DrawTargetCG::Init(CGContextRef cgContex
   //XXX: handle SurfaceFormat
 
   //XXX: we'd be better off reusing the Colorspace across draw targets
   mColorSpace = CGColorSpaceCreateDeviceRGB();
 
   mSize = aSize;
 
   mCg = cgContext;
-  CGContextSetShouldSmoothFonts(mCg, GetPermitSubpixelAA());
   CGContextRetain(mCg);
 
   assert(mCg);
 
   // CGContext's default to have the origin at the bottom left.
   // However, currently the only use of this function is to construct a
   // DrawTargetCG around a CGContextRef from a cairo quartz surface which
   // already has it's origin adjusted.
@@ -1530,22 +1528,16 @@ DrawTargetCG::MarkChanged()
     if (mSnapshot->refCount() > 1) {
       // We only need to worry about snapshots that someone else knows about
       mSnapshot->DrawTargetWillChange();
     }
     mSnapshot = nullptr;
   }
 }
 
-void
-DrawTargetCG::SetPermitSubpixelAA(bool aPermitSubpixelAA) {
-  DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA);
-  CGContextSetShouldSmoothFonts(mCg, aPermitSubpixelAA);
-}
-
 CGContextRef
 BorrowedCGContext::BorrowCGContextFromDrawTarget(DrawTarget *aDT)
 {
   if (aDT->GetType() == BackendType::COREGRAPHICS || aDT->GetType() == BackendType::COREGRAPHICS_ACCELERATED) {
     DrawTargetCG* cgDT = static_cast<DrawTargetCG*>(aDT);
     cgDT->MarkChanged();
 
     // swap out the context
--- a/gfx/2d/DrawTargetCG.h
+++ b/gfx/2d/DrawTargetCG.h
@@ -149,17 +149,16 @@ public:
   virtual TemporaryRef<GradientStops> CreateGradientStops(GradientStop *, uint32_t,
                                                           ExtendMode aExtendMode = ExtendMode::CLAMP) const;
   virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType);
 
   virtual void *GetNativeSurface(NativeSurfaceType);
 
   virtual IntSize GetSize() { return mSize; }
 
-  virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) MOZ_OVERRIDE;
 
   /* This is for creating good compatible surfaces */
   virtual TemporaryRef<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
                                                             const IntSize &aSize,
                                                             int32_t aStride,
                                                             SurfaceFormat aFormat) const;
   virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
   CGContextRef GetCGContext() {