Bug 1269971 - Part 7. Clean out unused things created in bug 759568; draft
authorCJKu <cku@mozilla.com>
Fri, 13 May 2016 00:09:39 +0800
changeset 366376 0d06f576ebc2dbb18671e599a63a950a4d94759d
parent 366375 fa32bdcf093fc2128bb1b1ae8e272d18bcbef5a9
child 520759 d72a6a9f3ef7ccb8ed37d4c5091702554ef743f9
push id17966
push usercku@mozilla.com
push dateThu, 12 May 2016 16:10:23 +0000
bugs1269971, 759568
milestone49.0a1
Bug 1269971 - Part 7. Clean out unused things created in bug 759568; MozReview-Commit-ID: 4spLj1fgthI
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -93,26 +93,16 @@
 #ifdef DrawText
 #undef DrawText
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 
-void
-nsTextFrame::DrawPathCallbacks::NotifySelectionBackgroundNeedsFill(
-                                                    const Rect& aBackgroundRect,
-                                                    nscolor aColor,
-                                                    DrawTarget& aDrawTarget)
-{
-  ColorPattern color(ToDeviceColor(aColor));
-  aDrawTarget.FillRect(aBackgroundRect, color);
-}
-
 struct TabWidth {
   TabWidth(uint32_t aOffset, uint32_t aWidth)
     : mOffset(aOffset), mWidth(float(aWidth))
   { }
 
   uint32_t mOffset; // DOM offset relative to the current frame's offset.
   float    mWidth;  // extra space to be added at this position (in app units)
 };
@@ -4791,19 +4781,17 @@ nsDisplayText::Paint(nsDisplayListBuilde
       gfxPoint pt = nsLayoutUtils::PointToGfxPoint(framePt, A2D);
       gfxMatrix mat = ctx->CurrentMatrix()
         .Translate(pt).Scale(scaleFactor, 1.0).Translate(-pt);
       ctx->SetMatrix(mat);
     }
   }
   nsTextFrame::PaintTextParams params(aCtx->ThebesContext());
   params.framePt = gfxPoint(framePt.x, framePt.y);
-
   params.dirtyRect = extraVisible;
-  nsTextFrame::DrawPathCallbacks callbacks;
   params.generateTextMask = aBuilder->IsForGenerateGlyphMask();
   params.paintSelectionBackground = aBuilder->IsForPaintingSelectionBG();
   f->PaintText(params, *this, mOpacity);
 }
 
 void
 nsTextFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                               const nsRect&           aDirtyRect,
@@ -6062,17 +6050,17 @@ nsTextFrame::PaintTextWithSelectionColor
     gfxPoint textBaselinePt = vertical ?
       gfxPoint(aParams.textBaselinePt.x, aParams.framePt.y + iOffset) :
       gfxPoint(aParams.framePt.x + iOffset, aParams.textBaselinePt.y);
 
     // Determine what shadow, if any, to draw - either from textStyle
     // or from the ::-moz-selection pseudo-class if specified there
     nsCSSShadowArray* shadow = textStyle->GetTextShadow();
     GetSelectionTextShadow(this, type, *aParams.textPaintStyle, &shadow);
-    if (shadow && !aParams.callbacks) {
+    if (shadow) {
       nscoord startEdge = iOffset;
       if (mTextRun->IsInlineReversed()) {
         startEdge -= hyphenWidth +
           mTextRun->GetAdvanceWidth(range, aParams.provider);
       }
       shadowParams.range = range;
       shadowParams.textBaselinePt = textBaselinePt;
       shadowParams.foregroundColor = foreground;
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -338,17 +338,17 @@ public:
     }
 
     /**
      * Called to have the selection highlight drawn before the text is drawn
      * over the top.
      */
     virtual void NotifySelectionBackgroundNeedsFill(const Rect& aBackgroundRect,
                                                     nscolor aColor,
-                                                    DrawTarget& aDrawTarget);
+                                                    DrawTarget& aDrawTarget) { }
 
     /**
      * Called before (for under/over-line) or after (for line-through) the text
      * is drawn to have a text decoration line drawn.
      */
     virtual void PaintDecorationLine(Rect aPath, nscolor aColor) { }
 
     /**
@@ -376,18 +376,16 @@ public:
      */
     virtual void NotifyBeforeSelectionDecorationLine(nscolor aColor) { }
 
     /**
      * Called just after a path corresponding to a selection decoration line
      * has been emitted to the gfxContext.
      */
     virtual void NotifySelectionDecorationLinePathEmitted() { }
-
-    virtual void NotifyGlyphPathEmitted() override {}
   };
 
   struct PaintTextParams
   {
     gfxContext* context;
     gfxPoint framePt;
     LayoutDeviceRect dirtyRect;
     gfxTextContextPaint* contextPaint = nullptr;