Bug 950511 - Back out part 1 from bug 941095 (DrawTargetCG::SetPermitSubpixelAA) because it's unnecessary and causes bad text rendering in context menus.
authorMarkus Stange <mstange@themasta.com>
Tue, 04 Feb 2014 21:03:12 +0100
changeset 166809 5c04b296c127b188fe3a983322a6e54a1a1bc0bf
parent 166808 51e86840de9bc91109d50c4d05c4533d8c1410b4
child 166810 73caaea5844f87837d7cb9adcbc152e1b7857fd9
push id39285
push usermstange@themasta.com
push dateTue, 04 Feb 2014 20:03:27 +0000
treeherdermozilla-inbound@5c04b296c127 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs950511, 941095
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 950511 - Back out part 1 from bug 941095 (DrawTargetCG::SetPermitSubpixelAA) because it's unnecessary and causes bad text rendering in context menus.
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() {