forked from mirrors/gecko-dev
		
	Bug 1549751 - Part 2: Add nsPaintedDisplayItem r=mattwoodrow
Move ApplyOpacity(), CanApplyOpacity(), Paint() and PaintWithClip() methods to nsPaintedDisplayItem Differential Revision: https://phabricator.services.mozilla.com/D30225 --HG-- extra : moz-landing-system : lando
This commit is contained in:
		
							parent
							
								
									d31f4467e4
								
							
						
					
					
						commit
						2c5cb1519c
					
				
					 31 changed files with 256 additions and 207 deletions
				
			
		|  | @ -60,11 +60,11 @@ bool nsButtonFrameRenderer::isDisabled() { | ||||||
|       NS_EVENT_STATE_DISABLED); |       NS_EVENT_STATE_DISABLED); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayButtonBoxShadowOuter : public nsDisplayItem { | class nsDisplayButtonBoxShadowOuter : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayButtonBoxShadowOuter(nsDisplayListBuilder* aBuilder, |   nsDisplayButtonBoxShadowOuter(nsDisplayListBuilder* aBuilder, | ||||||
|                                 nsIFrame* aFrame) |                                 nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayButtonBoxShadowOuter); |     MOZ_COUNT_CTOR(nsDisplayButtonBoxShadowOuter); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -184,11 +184,11 @@ bool nsDisplayButtonBoxShadowOuter::CreateWebRenderCommands( | ||||||
|   return true; |   return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayButtonBorder final : public nsDisplayItem { | class nsDisplayButtonBorder final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayButtonBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayButtonBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                         nsButtonFrameRenderer* aRenderer) |                         nsButtonFrameRenderer* aRenderer) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mBFR(aRenderer) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mBFR(aRenderer) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayButtonBorder); |     MOZ_COUNT_CTOR(nsDisplayButtonBorder); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -290,11 +290,11 @@ nsRect nsDisplayButtonBorder::GetBounds(nsDisplayListBuilder* aBuilder, | ||||||
|                    ToReferenceFrame(); |                    ToReferenceFrame(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayButtonForeground final : public nsDisplayItem { | class nsDisplayButtonForeground final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                             nsButtonFrameRenderer* aRenderer) |                             nsButtonFrameRenderer* aRenderer) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mBFR(aRenderer) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mBFR(aRenderer) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayButtonForeground); |     MOZ_COUNT_CTOR(nsDisplayButtonForeground); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -1421,11 +1421,11 @@ int32_t nsComboboxControlFrame::UpdateRecentIndex(int32_t aIndex) { | ||||||
|   return index; |   return index; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayComboboxFocus : public nsDisplayItem { | class nsDisplayComboboxFocus : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayComboboxFocus(nsDisplayListBuilder* aBuilder, |   nsDisplayComboboxFocus(nsDisplayListBuilder* aBuilder, | ||||||
|                          nsComboboxControlFrame* aFrame) |                          nsComboboxControlFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayComboboxFocus); |     MOZ_COUNT_CTOR(nsDisplayComboboxFocus); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -90,11 +90,11 @@ nsIFrame* nsFieldSetFrame::GetLegend() const { | ||||||
|   return mFrames.FirstChild(); |   return mFrames.FirstChild(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayFieldSetBorder final : public nsDisplayItem { | class nsDisplayFieldSetBorder final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayFieldSetBorder(nsDisplayListBuilder* aBuilder, |   nsDisplayFieldSetBorder(nsDisplayListBuilder* aBuilder, | ||||||
|                           nsFieldSetFrame* aFrame) |                           nsFieldSetFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayFieldSetBorder); |     MOZ_COUNT_CTOR(nsDisplayFieldSetBorder); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -148,10 +148,10 @@ void nsRangeFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements, | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayRangeFocusRing final : public nsDisplayItem { | class nsDisplayRangeFocusRing final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayRangeFocusRing(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayRangeFocusRing(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayRangeFocusRing); |     MOZ_COUNT_CTOR(nsDisplayRangeFocusRing); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -100,10 +100,10 @@ static nsListControlFrame* GetEnclosingListFrame(nsIFrame* aSelectsAreaFrame) { | ||||||
|   return nullptr; |   return nullptr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayListFocus : public nsDisplayItem { | class nsDisplayListFocus : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayListFocus(nsDisplayListBuilder* aBuilder, nsSelectsAreaFrame* aFrame) |   nsDisplayListFocus(nsDisplayListBuilder* aBuilder, nsSelectsAreaFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayListFocus); |     MOZ_COUNT_CTOR(nsDisplayListFocus); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -148,13 +148,13 @@ static bool IsFrameDescendantOfAny( | ||||||
|   return false; |   return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayTextOverflowMarker final : public nsDisplayItem { | class nsDisplayTextOverflowMarker final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayTextOverflowMarker(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayTextOverflowMarker(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                               const nsRect& aRect, nscoord aAscent, |                               const nsRect& aRect, nscoord aAscent, | ||||||
|                               const nsStyleTextOverflowSide* aStyle, |                               const nsStyleTextOverflowSide* aStyle, | ||||||
|                               uint32_t aLineNumber, uint16_t aIndex) |                               uint32_t aLineNumber, uint16_t aIndex) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mRect(aRect), |         mRect(aRect), | ||||||
|         mStyle(*aStyle), |         mStyle(*aStyle), | ||||||
|         mAscent(aAscent), |         mAscent(aAscent), | ||||||
|  |  | ||||||
|  | @ -543,10 +543,10 @@ bool BulletRenderer::CreateWebRenderCommandsForText( | ||||||
|   return textDrawer->Finish(); |   return textDrawer->Finish(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayBullet final : public nsDisplayItem { | class nsDisplayBullet final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayBullet(nsDisplayListBuilder* aBuilder, nsBulletFrame* aFrame) |   nsDisplayBullet(nsDisplayListBuilder* aBuilder, nsBulletFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayBullet); |     MOZ_COUNT_CTOR(nsDisplayBullet); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -604,8 +604,8 @@ class nsDisplayBullet final : public nsDisplayItem { | ||||||
|       aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); |       aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, |     return nsPaintedDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, | ||||||
|                                                     aInvalidRegion); |                                                            aInvalidRegion); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  protected: |  protected: | ||||||
|  |  | ||||||
|  | @ -438,10 +438,10 @@ void nsDisplayCanvasThemedBackground::Paint(nsDisplayListBuilder* aBuilder, | ||||||
|  * |  * | ||||||
|  * The only reason this can't use nsDisplayGeneric is overriding GetBounds. |  * The only reason this can't use nsDisplayGeneric is overriding GetBounds. | ||||||
|  */ |  */ | ||||||
| class nsDisplayCanvasFocus : public nsDisplayItem { | class nsDisplayCanvasFocus : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayCanvasFocus(nsDisplayListBuilder* aBuilder, nsCanvasFrame* aFrame) |   nsDisplayCanvasFocus(nsDisplayListBuilder* aBuilder, nsCanvasFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayCanvasFocus); |     MOZ_COUNT_CTOR(nsDisplayCanvasFocus); | ||||||
|   } |   } | ||||||
|   virtual ~nsDisplayCanvasFocus() { MOZ_COUNT_DTOR(nsDisplayCanvasFocus); } |   virtual ~nsDisplayCanvasFocus() { MOZ_COUNT_DTOR(nsDisplayCanvasFocus); } | ||||||
|  |  | ||||||
|  | @ -21,10 +21,10 @@ static LazyLogModule sColumnSetLog("ColumnSet"); | ||||||
| #define COLUMN_SET_LOG(msg, ...) \ | #define COLUMN_SET_LOG(msg, ...) \ | ||||||
|   MOZ_LOG(sColumnSetLog, LogLevel::Debug, (msg, ##__VA_ARGS__)) |   MOZ_LOG(sColumnSetLog, LogLevel::Debug, (msg, ##__VA_ARGS__)) | ||||||
| 
 | 
 | ||||||
| class nsDisplayColumnRule : public nsDisplayItem { | class nsDisplayColumnRule : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayColumnRule(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayColumnRule(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayColumnRule); |     MOZ_COUNT_CTOR(nsDisplayColumnRule); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -2168,11 +2168,12 @@ int16_t nsFrame::DisplaySelection(nsPresContext* aPresContext, | ||||||
|   return selType; |   return selType; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplaySelectionOverlay : public nsDisplayItem { | class nsDisplaySelectionOverlay : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplaySelectionOverlay(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, |   nsDisplaySelectionOverlay(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, | ||||||
|                             int16_t aSelectionValue) |                             int16_t aSelectionValue) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mSelectionValue(aSelectionValue) { |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|  |         mSelectionValue(aSelectionValue) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplaySelectionOverlay); |     MOZ_COUNT_CTOR(nsDisplaySelectionOverlay); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -1328,11 +1328,11 @@ void nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext, | ||||||
|   aDesiredSize.SetOverflowAreasToDesiredBounds(); |   aDesiredSize.SetOverflowAreasToDesiredBounds(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayFramesetBorder : public nsDisplayItem { | class nsDisplayFramesetBorder : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayFramesetBorder(nsDisplayListBuilder* aBuilder, |   nsDisplayFramesetBorder(nsDisplayListBuilder* aBuilder, | ||||||
|                           nsHTMLFramesetBorderFrame* aFrame) |                           nsHTMLFramesetBorderFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayFramesetBorder); |     MOZ_COUNT_CTOR(nsDisplayFramesetBorder); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -1516,10 +1516,10 @@ void nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext, | ||||||
|   aDesiredSize.SetOverflowAreasToDesiredBounds(); |   aDesiredSize.SetOverflowAreasToDesiredBounds(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayFramesetBlank : public nsDisplayItem { | class nsDisplayFramesetBlank : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayFramesetBlank(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayFramesetBlank(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayFramesetBlank); |     MOZ_COUNT_CTOR(nsDisplayFramesetBlank); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -1295,10 +1295,10 @@ struct nsRecessedBorder : public nsStyleBorder { | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayAltFeedback final : public nsDisplayItem { | class nsDisplayAltFeedback final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayAltFeedback(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayAltFeedback(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) {} |       : nsPaintedDisplayItem(aBuilder, aFrame) {} | ||||||
| 
 | 
 | ||||||
|   virtual nsDisplayItemGeometry* AllocateGeometry( |   virtual nsDisplayItemGeometry* AllocateGeometry( | ||||||
|       nsDisplayListBuilder* aBuilder) override { |       nsDisplayListBuilder* aBuilder) override { | ||||||
|  |  | ||||||
|  | @ -440,10 +440,10 @@ static gfx::Matrix4x4 ComputePageTransform(nsIFrame* aFrame, | ||||||
|   return gfx::Matrix4x4::Scaling(scale, scale, 1); |   return gfx::Matrix4x4::Scaling(scale, scale, 1); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayHeaderFooter final : public nsDisplayItem { | class nsDisplayHeaderFooter final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayHeaderFooter(nsDisplayListBuilder* aBuilder, nsPageFrame* aFrame) |   nsDisplayHeaderFooter(nsDisplayListBuilder* aBuilder, nsPageFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayHeaderFooter); |     MOZ_COUNT_CTOR(nsDisplayHeaderFooter); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -353,10 +353,10 @@ class nsDisplayPluginGeometry : public nsDisplayItemGenericGeometry { | ||||||
|   virtual bool InvalidateForSyncDecodeImages() const override { return true; } |   virtual bool InvalidateForSyncDecodeImages() const override { return true; } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayPlugin final : public nsDisplayItem { | class nsDisplayPlugin final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayPlugin); |     MOZ_COUNT_CTOR(nsDisplayPlugin); | ||||||
|     aBuilder->SetContainsPluginItem(); |     aBuilder->SetContainsPluginItem(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -162,7 +162,7 @@ inline static bool IsTempLayerManager(mozilla::layers::LayerManager* aManager) { | ||||||
| 
 | 
 | ||||||
| nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder, | nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder, | ||||||
|                                  nsSubDocumentFrame* aFrame) |                                  nsSubDocumentFrame* aFrame) | ||||||
|     : nsDisplayItem(aBuilder, aFrame), |     : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|       mTabId{0}, |       mTabId{0}, | ||||||
|       mEventRegionsOverride(EventRegionsOverride::NoOverride) { |       mEventRegionsOverride(EventRegionsOverride::NoOverride) { | ||||||
|   bool frameIsPointerEventsNone = aFrame->StyleUI()->GetEffectivePointerEvents( |   bool frameIsPointerEventsNone = aFrame->StyleUI()->GetEffectivePointerEvents( | ||||||
|  |  | ||||||
|  | @ -89,7 +89,7 @@ class RenderFrame final { | ||||||
|  * A nsDisplayRemote will graft a remote frame's shadow layer tree (for a given |  * A nsDisplayRemote will graft a remote frame's shadow layer tree (for a given | ||||||
|  * nsFrameLoader) into its parent frame's layer tree. |  * nsFrameLoader) into its parent frame's layer tree. | ||||||
|  */ |  */ | ||||||
| class nsDisplayRemote final : public nsDisplayItem { | class nsDisplayRemote final : public nsPaintedDisplayItem { | ||||||
|   typedef mozilla::dom::TabId TabId; |   typedef mozilla::dom::TabId TabId; | ||||||
|   typedef mozilla::gfx::Matrix4x4 Matrix4x4; |   typedef mozilla::gfx::Matrix4x4 Matrix4x4; | ||||||
|   typedef mozilla::layers::EventRegionsOverride EventRegionsOverride; |   typedef mozilla::layers::EventRegionsOverride EventRegionsOverride; | ||||||
|  |  | ||||||
|  | @ -1682,11 +1682,11 @@ nscoord nsMathMLChar::GetMaxWidth(nsIFrame* aForFrame, DrawTarget* aDrawTarget, | ||||||
|   return std::max(bm.width, bm.rightBearing) - std::min(0, bm.leftBearing); |   return std::max(bm.width, bm.rightBearing) - std::min(0, bm.leftBearing); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayMathMLSelectionRect final : public nsDisplayItem { | class nsDisplayMathMLSelectionRect final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLSelectionRect(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayMathMLSelectionRect(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                                const nsRect& aRect) |                                const nsRect& aRect) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mRect(aRect) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mRect(aRect) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayMathMLSelectionRect); |     MOZ_COUNT_CTOR(nsDisplayMathMLSelectionRect); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -1713,12 +1713,12 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder, | ||||||
|   drawTarget->FillRect(rect, ColorPattern(ToDeviceColor(bgColor))); |   drawTarget->FillRect(rect, ColorPattern(ToDeviceColor(bgColor))); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayMathMLCharForeground final : public nsDisplayItem { | class nsDisplayMathMLCharForeground final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder, |   nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder, | ||||||
|                                 nsIFrame* aFrame, nsMathMLChar* aChar, |                                 nsIFrame* aFrame, nsMathMLChar* aChar, | ||||||
|                                 uint16_t aIndex, bool aIsSelected) |                                 uint16_t aIndex, bool aIsSelected) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mChar(aChar), |         mChar(aChar), | ||||||
|         mIndex(aIndex), |         mIndex(aIndex), | ||||||
|         mIsSelected(aIsSelected) { |         mIsSelected(aIsSelected) { | ||||||
|  | @ -1767,11 +1767,11 @@ class nsDisplayMathMLCharForeground final : public nsDisplayItem { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
| class nsDisplayMathMLCharDebug final : public nsDisplayItem { | class nsDisplayMathMLCharDebug final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLCharDebug(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayMathMLCharDebug(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                            const nsRect& aRect) |                            const nsRect& aRect) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mRect(aRect) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mRect(aRect) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayMathMLCharDebug); |     MOZ_COUNT_CTOR(nsDisplayMathMLCharDebug); | ||||||
|   } |   } | ||||||
| #  ifdef NS_BUILD_REFCNT_LOGGING | #  ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -68,10 +68,10 @@ nsresult nsMathMLContainerFrame::ReflowError(DrawTarget* aDrawTarget, | ||||||
|   return NS_OK; |   return NS_OK; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayMathMLError : public nsDisplayItem { | class nsDisplayMathMLError : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLError(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayMathMLError(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayMathMLError); |     MOZ_COUNT_CTOR(nsDisplayMathMLError); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -300,11 +300,11 @@ void nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder, | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| class nsDisplayMathMLBar final : public nsDisplayItem { | class nsDisplayMathMLBar final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                      const nsRect& aRect, uint16_t aIndex) |                      const nsRect& aRect, uint16_t aIndex) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mRect(aRect), mIndex(aIndex) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mRect(aRect), mIndex(aIndex) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayMathMLBar); |     MOZ_COUNT_CTOR(nsDisplayMathMLBar); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -701,12 +701,12 @@ void nsMathMLmencloseFrame::SetAdditionalComputedStyle( | ||||||
|     mMathMLChar[aIndex].SetComputedStyle(aComputedStyle); |     mMathMLChar[aIndex].SetComputedStyle(aComputedStyle); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayNotation final : public nsDisplayItem { | class nsDisplayNotation final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayNotation(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayNotation(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                     const nsRect& aRect, nscoord aThickness, |                     const nsRect& aRect, nscoord aThickness, | ||||||
|                     nsMencloseNotation aType) |                     nsMencloseNotation aType) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mRect(aRect), |         mRect(aRect), | ||||||
|         mThickness(aThickness), |         mThickness(aThickness), | ||||||
|         mType(aType) { |         mType(aType) { | ||||||
|  |  | ||||||
|  | @ -569,11 +569,11 @@ nsresult nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget, | ||||||
|   return NS_OK; |   return NS_OK; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayMathMLSlash : public nsDisplayItem { | class nsDisplayMathMLSlash : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayMathMLSlash(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayMathMLSlash(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                        const nsRect& aRect, nscoord aThickness, bool aRTL) |                        const nsRect& aRect, nscoord aThickness, bool aRTL) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mRect(aRect), |         mRect(aRect), | ||||||
|         mThickness(aThickness), |         mThickness(aThickness), | ||||||
|         mRTL(aRTL) { |         mRTL(aRTL) { | ||||||
|  |  | ||||||
|  | @ -4192,7 +4192,7 @@ void nsDisplayBackgroundImage::HitTest(nsDisplayListBuilder* aBuilder, | ||||||
| 
 | 
 | ||||||
| bool nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder, | bool nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder, | ||||||
|                                                  nsRegion* aVisibleRegion) { |                                                  nsRegion* aVisibleRegion) { | ||||||
|   if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) { |   if (!nsDisplayImageContainer::ComputeVisibility(aBuilder, aVisibleRegion)) { | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -4429,7 +4429,7 @@ bool nsDisplayTableBackgroundImage::IsInvalid(nsRect& aRect) const { | ||||||
| nsDisplayThemedBackground::nsDisplayThemedBackground( | nsDisplayThemedBackground::nsDisplayThemedBackground( | ||||||
|     nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |     nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|     const nsRect& aBackgroundRect) |     const nsRect& aBackgroundRect) | ||||||
|     : nsDisplayItem(aBuilder, aFrame), mBackgroundRect(aBackgroundRect) { |     : nsPaintedDisplayItem(aBuilder, aFrame), mBackgroundRect(aBackgroundRect) { | ||||||
|   MOZ_COUNT_CTOR(nsDisplayThemedBackground); |   MOZ_COUNT_CTOR(nsDisplayThemedBackground); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -5129,7 +5129,8 @@ uint16_t nsDisplayCompositorHitTestInfo::CalculatePerFrameKey() const { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int32_t nsDisplayCompositorHitTestInfo::ZIndex() const { | int32_t nsDisplayCompositorHitTestInfo::ZIndex() const { | ||||||
|   return mOverrideZIndex ? *mOverrideZIndex : nsDisplayItem::ZIndex(); |   return mOverrideZIndex ? *mOverrideZIndex | ||||||
|  |                          : nsDisplayHitTestInfoItem::ZIndex(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void nsDisplayCompositorHitTestInfo::SetOverrideZIndex(int32_t aZIndex) { | void nsDisplayCompositorHitTestInfo::SetOverrideZIndex(int32_t aZIndex) { | ||||||
|  | @ -5138,7 +5139,7 @@ void nsDisplayCompositorHitTestInfo::SetOverrideZIndex(int32_t aZIndex) { | ||||||
| 
 | 
 | ||||||
| nsDisplayCaret::nsDisplayCaret(nsDisplayListBuilder* aBuilder, | nsDisplayCaret::nsDisplayCaret(nsDisplayListBuilder* aBuilder, | ||||||
|                                nsIFrame* aCaretFrame) |                                nsIFrame* aCaretFrame) | ||||||
|     : nsDisplayItem(aBuilder, aCaretFrame), |     : nsPaintedDisplayItem(aBuilder, aCaretFrame), | ||||||
|       mCaret(aBuilder->GetCaret()), |       mCaret(aBuilder->GetCaret()), | ||||||
|       mBounds(aBuilder->GetCaretRect() + ToReferenceFrame()) { |       mBounds(aBuilder->GetCaretRect() + ToReferenceFrame()) { | ||||||
|   MOZ_COUNT_CTOR(nsDisplayCaret); |   MOZ_COUNT_CTOR(nsDisplayCaret); | ||||||
|  | @ -5201,7 +5202,7 @@ bool nsDisplayCaret::CreateWebRenderCommands( | ||||||
| 
 | 
 | ||||||
| nsDisplayBorder::nsDisplayBorder(nsDisplayListBuilder* aBuilder, | nsDisplayBorder::nsDisplayBorder(nsDisplayListBuilder* aBuilder, | ||||||
|                                  nsIFrame* aFrame) |                                  nsIFrame* aFrame) | ||||||
|     : nsDisplayItem(aBuilder, aFrame) { |     : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|   MOZ_COUNT_CTOR(nsDisplayBorder); |   MOZ_COUNT_CTOR(nsDisplayBorder); | ||||||
| 
 | 
 | ||||||
|   mBounds = CalculateBounds<nsRect>(*mFrame->StyleBorder()); |   mBounds = CalculateBounds<nsRect>(*mFrame->StyleBorder()); | ||||||
|  | @ -5370,7 +5371,7 @@ bool nsDisplayBoxShadowOuter::IsInvisibleInRect(const nsRect& aRect) const { | ||||||
| 
 | 
 | ||||||
| bool nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder, | bool nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder, | ||||||
|                                                 nsRegion* aVisibleRegion) { |                                                 nsRegion* aVisibleRegion) { | ||||||
|   if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) { |   if (!nsPaintedDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) { | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -5637,7 +5638,7 @@ bool nsDisplayBoxShadowInner::CreateWebRenderCommands( | ||||||
| 
 | 
 | ||||||
| bool nsDisplayBoxShadowInner::ComputeVisibility(nsDisplayListBuilder* aBuilder, | bool nsDisplayBoxShadowInner::ComputeVisibility(nsDisplayListBuilder* aBuilder, | ||||||
|                                                 nsRegion* aVisibleRegion) { |                                                 nsRegion* aVisibleRegion) { | ||||||
|   if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) { |   if (!nsPaintedDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) { | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -6058,7 +6059,7 @@ static const size_t kOpacityMaxListSize = kOpacityMaxChildCount * 2; | ||||||
|  * Otherwise returns true. |  * Otherwise returns true. | ||||||
|  */ |  */ | ||||||
| static bool CollectItemsWithOpacity(nsDisplayList* aList, | static bool CollectItemsWithOpacity(nsDisplayList* aList, | ||||||
|                                     nsTArray<nsDisplayItem*>& aArray) { |                                     nsTArray<nsPaintedDisplayItem*>& aArray) { | ||||||
|   if (aList->Count() > kOpacityMaxListSize) { |   if (aList->Count() > kOpacityMaxListSize) { | ||||||
|     // Exit early, since |aList| will likely contain more than
 |     // Exit early, since |aList| will likely contain more than
 | ||||||
|     // |kOpacityMaxChildCount| items.
 |     // |kOpacityMaxChildCount| items.
 | ||||||
|  | @ -6068,6 +6069,10 @@ static bool CollectItemsWithOpacity(nsDisplayList* aList, | ||||||
|   for (nsDisplayItem* i : *aList) { |   for (nsDisplayItem* i : *aList) { | ||||||
|     const DisplayItemType type = i->GetType(); |     const DisplayItemType type = i->GetType(); | ||||||
| 
 | 
 | ||||||
|  |     if (type == DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO) { | ||||||
|  |       continue; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     // Descend only into wraplists.
 |     // Descend only into wraplists.
 | ||||||
|     if (type == DisplayItemType::TYPE_WRAP_LIST) { |     if (type == DisplayItemType::TYPE_WRAP_LIST) { | ||||||
|       // The current display item has children, process them first.
 |       // The current display item has children, process them first.
 | ||||||
|  | @ -6078,15 +6083,16 @@ static bool CollectItemsWithOpacity(nsDisplayList* aList, | ||||||
|       continue; |       continue; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (type == DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO) { |     if (aArray.Length() == kOpacityMaxChildCount) { | ||||||
|       continue; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     if (!i->CanApplyOpacity() || aArray.Length() == kOpacityMaxChildCount) { |  | ||||||
|       return false; |       return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     aArray.AppendElement(i); |     auto* item = i->AsPaintedDisplayItem(); | ||||||
|  |     if (!item || !item->CanApplyOpacity()) { | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     aArray.AppendElement(item); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   return true; |   return true; | ||||||
|  | @ -6099,20 +6105,20 @@ bool nsDisplayOpacity::ApplyOpacityToChildren(nsDisplayListBuilder* aBuilder) { | ||||||
| 
 | 
 | ||||||
|   // Iterate through the child display list and copy at most
 |   // Iterate through the child display list and copy at most
 | ||||||
|   // |kOpacityMaxChildCount| child display item pointers to a temporary list.
 |   // |kOpacityMaxChildCount| child display item pointers to a temporary list.
 | ||||||
|   AutoTArray<nsDisplayItem*, kOpacityMaxChildCount> items; |   AutoTArray<nsPaintedDisplayItem*, kOpacityMaxChildCount> items; | ||||||
|   if (!CollectItemsWithOpacity(&mList, items)) { |   if (!CollectItemsWithOpacity(&mList, items)) { | ||||||
|     mChildOpacityState = ChildOpacityState::Deferred; |     mChildOpacityState = ChildOpacityState::Deferred; | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   struct { |   struct { | ||||||
|     nsDisplayItem* item; |     nsPaintedDisplayItem* item; | ||||||
|     nsRect bounds; |     nsRect bounds; | ||||||
|   } children[kOpacityMaxChildCount]; |   } children[kOpacityMaxChildCount]; | ||||||
| 
 | 
 | ||||||
|   bool snap; |   bool snap; | ||||||
|   size_t childCount = 0; |   size_t childCount = 0; | ||||||
|   for (nsDisplayItem* item : items) { |   for (nsPaintedDisplayItem* item : items) { | ||||||
|     children[childCount].item = item; |     children[childCount].item = item; | ||||||
|     children[childCount].bounds = item->GetBounds(aBuilder, &snap); |     children[childCount].bounds = item->GetBounds(aBuilder, &snap); | ||||||
|     childCount++; |     childCount++; | ||||||
|  | @ -6726,7 +6732,7 @@ void nsDisplaySubDocument::RemoveFrame(nsIFrame* aFrame) { | ||||||
|     mSubDocFrame = nullptr; |     mSubDocFrame = nullptr; | ||||||
|     SetDeletedFrame(); |     SetDeletedFrame(); | ||||||
|   } |   } | ||||||
|   nsDisplayItem::RemoveFrame(aFrame); |   nsDisplayOwnLayer::RemoveFrame(aFrame); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void nsDisplaySubDocument::Disown() { | void nsDisplaySubDocument::Disown() { | ||||||
|  | @ -8937,7 +8943,7 @@ bool nsDisplayPerspective::CreateWebRenderCommands( | ||||||
| nsDisplayText::nsDisplayText(nsDisplayListBuilder* aBuilder, | nsDisplayText::nsDisplayText(nsDisplayListBuilder* aBuilder, | ||||||
|                              nsTextFrame* aFrame, |                              nsTextFrame* aFrame, | ||||||
|                              const Maybe<bool>& aIsSelected) |                              const Maybe<bool>& aIsSelected) | ||||||
|     : nsDisplayItem(aBuilder, aFrame), |     : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|       mOpacity(1.0f), |       mOpacity(1.0f), | ||||||
|       mVisIStartEdge(0), |       mVisIStartEdge(0), | ||||||
|       mVisIEndEdge(0) { |       mVisIEndEdge(0) { | ||||||
|  |  | ||||||
|  | @ -1994,7 +1994,6 @@ class nsDisplayListBuilder { | ||||||
| 
 | 
 | ||||||
| class nsDisplayItem; | class nsDisplayItem; | ||||||
| class nsDisplayItemBase; | class nsDisplayItemBase; | ||||||
| class nsDisplayWrapList; |  | ||||||
| class nsDisplayList; | class nsDisplayList; | ||||||
| class RetainedDisplayList; | class RetainedDisplayList; | ||||||
| 
 | 
 | ||||||
|  | @ -2037,8 +2036,10 @@ void AssertUniqueItem(nsDisplayItem* aItem); | ||||||
| template <typename T, typename F, typename... Args> | template <typename T, typename F, typename... Args> | ||||||
| MOZ_ALWAYS_INLINE T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, F* aFrame, | MOZ_ALWAYS_INLINE T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, F* aFrame, | ||||||
|                                      Args&&... aArgs) { |                                      Args&&... aArgs) { | ||||||
|  |   static_assert(std::is_base_of<nsDisplayItem, T>::value, | ||||||
|  |                 "Display item should be derived from nsDisplayItem"); | ||||||
|   static_assert(std::is_base_of<nsIFrame, F>::value, |   static_assert(std::is_base_of<nsIFrame, F>::value, | ||||||
|                 "Frame type is not derived from nsIFrame"); |                 "Frame type should be derived from nsIFrame"); | ||||||
| 
 | 
 | ||||||
|   T* item = new (aBuilder) T(aBuilder, aFrame, std::forward<Args>(aArgs)...); |   T* item = new (aBuilder) T(aBuilder, aFrame, std::forward<Args>(aArgs)...); | ||||||
| 
 | 
 | ||||||
|  | @ -2110,6 +2111,9 @@ class nsDisplayItemLink { | ||||||
|   friend class nsDisplayList; |   friend class nsDisplayList; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | class nsPaintedDisplayItem; | ||||||
|  | class nsDisplayWrapList; | ||||||
|  | 
 | ||||||
| /*
 | /*
 | ||||||
|  * nsDisplayItemBase is a base-class for all display items. It is mainly |  * nsDisplayItemBase is a base-class for all display items. It is mainly | ||||||
|  * responsible for handling the frame-display item 1:n relationship, as well as |  * responsible for handling the frame-display item 1:n relationship, as well as | ||||||
|  | @ -2127,6 +2131,27 @@ class nsDisplayItemBase : public nsDisplayItemLink { | ||||||
|  public: |  public: | ||||||
|   nsDisplayItemBase() = delete; |   nsDisplayItemBase() = delete; | ||||||
| 
 | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Downcasts this item to nsPaintedDisplayItem, if possible. | ||||||
|  |    */ | ||||||
|  |   virtual nsPaintedDisplayItem* AsPaintedDisplayItem() { return nullptr; } | ||||||
|  |   virtual const nsPaintedDisplayItem* AsPaintedDisplayItem() const { | ||||||
|  |     return nullptr; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Downcasts this item to nsDisplayWrapList, if possible. | ||||||
|  |    */ | ||||||
|  |   virtual nsDisplayWrapList* AsDisplayWrapList() { return nullptr; } | ||||||
|  |   virtual const nsDisplayWrapList* AsDisplayWrapList() const { return nullptr; } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Create a clone of this item. | ||||||
|  |    */ | ||||||
|  |   virtual nsDisplayItem* Clone(nsDisplayListBuilder* aBuilder) const { | ||||||
|  |     return nullptr; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   /**
 |   /**
 | ||||||
|    * Frees the memory allocated for this display item. |    * Frees the memory allocated for this display item. | ||||||
|    * The given display list builder must have allocated this display item. |    * The given display list builder must have allocated this display item. | ||||||
|  | @ -2405,30 +2430,6 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|     SetDisplayItemData(nullptr, nullptr); |     SetDisplayItemData(nullptr, nullptr); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  public: |  | ||||||
|   nsDisplayItem() = delete; |  | ||||||
| 
 |  | ||||||
|   virtual void RestoreState() { |  | ||||||
|     mClipChain = mState.mClipChain; |  | ||||||
|     mClip = mState.mClip; |  | ||||||
|     mItemFlags -= ItemFlag::DisableSubpixelAA; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   /**
 |  | ||||||
|    * Downcasts this item to nsDisplayWrapList, if possible. |  | ||||||
|    */ |  | ||||||
|   virtual const nsDisplayWrapList* AsDisplayWrapList() const { return nullptr; } |  | ||||||
|   virtual nsDisplayWrapList* AsDisplayWrapList() { return nullptr; } |  | ||||||
| 
 |  | ||||||
|   /**
 |  | ||||||
|    * Create a clone of this item. |  | ||||||
|    */ |  | ||||||
|   virtual nsDisplayItem* Clone(nsDisplayListBuilder* aBuilder) const { |  | ||||||
|     MOZ_ASSERT_UNREACHABLE("Clone() called on an incorrect item type!"); |  | ||||||
|     return nullptr; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   nsDisplayItem(const nsDisplayItem&) = delete; |  | ||||||
|   /**
 |   /**
 | ||||||
|    * The custom copy-constructor is implemented to prevent copying the saved |    * The custom copy-constructor is implemented to prevent copying the saved | ||||||
|    * state of the item. |    * state of the item. | ||||||
|  | @ -2460,6 +2461,16 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  public: | ||||||
|  |   nsDisplayItem() = delete; | ||||||
|  |   nsDisplayItem(const nsDisplayItem&) = delete; | ||||||
|  | 
 | ||||||
|  |   virtual void RestoreState() { | ||||||
|  |     mClipChain = mState.mClipChain; | ||||||
|  |     mClip = mState.mClip; | ||||||
|  |     mItemFlags -= ItemFlag::DisableSubpixelAA; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   struct HitTestState { |   struct HitTestState { | ||||||
|     explicit HitTestState() : mInPreserves3D(false) {} |     explicit HitTestState() : mInPreserves3D(false) {} | ||||||
| 
 | 
 | ||||||
|  | @ -2709,27 +2720,6 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|     return mozilla::LAYER_NONE; |     return mozilla::LAYER_NONE; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /**
 |  | ||||||
|    * Returns true if this item supports PaintWithClip, where the clipping |  | ||||||
|    * is used directly as the primitive geometry instead of needing an explicit |  | ||||||
|    * clip. |  | ||||||
|    */ |  | ||||||
|   virtual bool CanPaintWithClip(const DisplayItemClip& aClip) { return false; } |  | ||||||
| 
 |  | ||||||
|   /**
 |  | ||||||
|    * Actually paint this item to some rendering context. |  | ||||||
|    * Content outside mVisibleRect need not be painted. |  | ||||||
|    * aCtx must be set up as for nsDisplayList::Paint. |  | ||||||
|    */ |  | ||||||
|   virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) {} |  | ||||||
| 
 |  | ||||||
|   /**
 |  | ||||||
|    * Same as Paint, except provides a clip to use the geometry to draw with. |  | ||||||
|    * Must not be called unless CanPaintWithClip returned true. |  | ||||||
|    */ |  | ||||||
|   virtual void PaintWithClip(nsDisplayListBuilder* aBuilder, gfxContext* aCtx, |  | ||||||
|                              const DisplayItemClip& aClip) {} |  | ||||||
| 
 |  | ||||||
| #ifdef MOZ_DUMP_PAINTING | #ifdef MOZ_DUMP_PAINTING | ||||||
|   /**
 |   /**
 | ||||||
|    * Mark this display item as being painted via |    * Mark this display item as being painted via | ||||||
|  | @ -2928,24 +2918,6 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|     return mBuildingRect; |     return mBuildingRect; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /**
 |  | ||||||
|    * Stores the given opacity value to be applied when drawing. It is an error |  | ||||||
|    * to call this if CanApplyOpacity returned false. |  | ||||||
|    */ |  | ||||||
|   virtual void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity, |  | ||||||
|                             const DisplayItemClipChain* aClip) { |  | ||||||
|     NS_ASSERTION(CanApplyOpacity(), "ApplyOpacity not supported on this type"); |  | ||||||
|   } |  | ||||||
|   /**
 |  | ||||||
|    * Returns true if this display item would return true from ApplyOpacity |  | ||||||
|    * without actually applying the opacity. Otherwise returns false. |  | ||||||
|    */ |  | ||||||
|   virtual bool CanApplyOpacity() const { return false; } |  | ||||||
| 
 |  | ||||||
|   bool ForceNotVisible() const { |  | ||||||
|     return mItemFlags.contains(ItemFlag::ForceNotVisible); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   virtual void WriteDebugInfo(std::stringstream& aStream) {} |   virtual void WriteDebugInfo(std::stringstream& aStream) {} | ||||||
| 
 | 
 | ||||||
|   nsDisplayItem* GetAbove() { return mAbove; } |   nsDisplayItem* GetAbove() { return mAbove; } | ||||||
|  | @ -3053,6 +3025,10 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|     return mItemFlags.contains(ItemFlag::Combines3DTransformWithAncestors); |     return mItemFlags.contains(ItemFlag::Combines3DTransformWithAncestors); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   bool ForceNotVisible() const { | ||||||
|  |     return mItemFlags.contains(ItemFlag::ForceNotVisible); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   bool In3DContextAndBackfaceIsHidden() const { |   bool In3DContextAndBackfaceIsHidden() const { | ||||||
|     return mItemFlags.contains(ItemFlag::BackfaceHidden) && |     return mItemFlags.contains(ItemFlag::BackfaceHidden) && | ||||||
|            mItemFlags.contains(ItemFlag::Combines3DTransformWithAncestors); |            mItemFlags.contains(ItemFlag::Combines3DTransformWithAncestors); | ||||||
|  | @ -3158,6 +3134,65 @@ class nsDisplayItem : public nsDisplayItemBase { | ||||||
|   mozilla::EnumSet<ItemFlag, uint8_t> mItemFlags; |   mozilla::EnumSet<ItemFlag, uint8_t> mItemFlags; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | class nsPaintedDisplayItem : public nsDisplayItem { | ||||||
|  |  public: | ||||||
|  |   nsPaintedDisplayItem* AsPaintedDisplayItem() final { return this; } | ||||||
|  |   const nsPaintedDisplayItem* AsPaintedDisplayItem() const final { | ||||||
|  |     return this; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Stores the given opacity value to be applied when drawing. It is an error | ||||||
|  |    * to call this if CanApplyOpacity returned false. | ||||||
|  |    */ | ||||||
|  |   virtual void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity, | ||||||
|  |                             const DisplayItemClipChain* aClip) { | ||||||
|  |     MOZ_ASSERT(CanApplyOpacity(), "ApplyOpacity is not supported on this type"); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Returns true if this display item would return true from ApplyOpacity | ||||||
|  |    * without actually applying the opacity. Otherwise returns false. | ||||||
|  |    */ | ||||||
|  |   virtual bool CanApplyOpacity() const { return false; } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Returns true if this item supports PaintWithClip, where the clipping | ||||||
|  |    * is used directly as the primitive geometry instead of needing an explicit | ||||||
|  |    * clip. | ||||||
|  |    */ | ||||||
|  |   virtual bool CanPaintWithClip(const DisplayItemClip& aClip) { return false; } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Same as |Paint()|, except provides a clip to use the geometry to draw with. | ||||||
|  |    * Must not be called unless |CanPaintWithClip()| returned true. | ||||||
|  |    */ | ||||||
|  |   virtual void PaintWithClip(nsDisplayListBuilder* aBuilder, gfxContext* aCtx, | ||||||
|  |                              const DisplayItemClip& aClip) { | ||||||
|  |     MOZ_ASSERT_UNREACHABLE("PaintWithClip() is not implemented!"); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /**
 | ||||||
|  |    * Paint this item to some rendering context. | ||||||
|  |    */ | ||||||
|  |   virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) { | ||||||
|  |     // TODO(miko): Make this a pure virtual function to force implementation.
 | ||||||
|  |     MOZ_ASSERT_UNREACHABLE("Paint() is not implemented!"); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |  protected: | ||||||
|  |   nsPaintedDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|  |       : nsDisplayItem(aBuilder, aFrame) {} | ||||||
|  | 
 | ||||||
|  |   nsPaintedDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|  |                        const ActiveScrolledRoot* aActiveScrolledRoot) | ||||||
|  |       : nsDisplayItem(aBuilder, aFrame, aActiveScrolledRoot) {} | ||||||
|  | 
 | ||||||
|  |   nsPaintedDisplayItem(nsDisplayListBuilder* aBuilder, | ||||||
|  |                        const nsPaintedDisplayItem& aOther) | ||||||
|  |       : nsDisplayItem(aBuilder, aOther) {} | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| /**
 | /**
 | ||||||
|  * Manages a singly-linked list of display list items. |  * Manages a singly-linked list of display list items. | ||||||
|  * |  * | ||||||
|  | @ -3887,24 +3922,24 @@ struct HitTestInfo { | ||||||
|   const mozilla::DisplayItemClip* mClip; |   const mozilla::DisplayItemClip* mClip; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayHitTestInfoItem : public nsDisplayItem { | class nsDisplayHitTestInfoItem : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) {} |       : nsPaintedDisplayItem(aBuilder, aFrame) {} | ||||||
| 
 | 
 | ||||||
|   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                            const ActiveScrolledRoot* aActiveScrolledRoot) |                            const ActiveScrolledRoot* aActiveScrolledRoot) | ||||||
|       : nsDisplayItem(aBuilder, aFrame, aActiveScrolledRoot) {} |       : nsPaintedDisplayItem(aBuilder, aFrame, aActiveScrolledRoot) {} | ||||||
| 
 | 
 | ||||||
|   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, |   nsDisplayHitTestInfoItem(nsDisplayListBuilder* aBuilder, | ||||||
|                            const nsDisplayHitTestInfoItem& aOther) |                            const nsDisplayHitTestInfoItem& aOther) | ||||||
|       : nsDisplayItem(aBuilder, aOther) {} |       : nsPaintedDisplayItem(aBuilder, aOther) {} | ||||||
| 
 | 
 | ||||||
|   const HitTestInfo& GetHitTestInfo() const { return *mHitTestInfo; } |   const HitTestInfo& GetHitTestInfo() const { return *mHitTestInfo; } | ||||||
| 
 | 
 | ||||||
|   void SetActiveScrolledRoot( |   void SetActiveScrolledRoot( | ||||||
|       const ActiveScrolledRoot* aActiveScrolledRoot) override { |       const ActiveScrolledRoot* aActiveScrolledRoot) override { | ||||||
|     nsDisplayItem::SetActiveScrolledRoot(aActiveScrolledRoot); |     nsPaintedDisplayItem::SetActiveScrolledRoot(aActiveScrolledRoot); | ||||||
|     UpdateHitTestInfoActiveScrolledRoot(aActiveScrolledRoot); |     UpdateHitTestInfoActiveScrolledRoot(aActiveScrolledRoot); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -3956,7 +3991,7 @@ class nsDisplayHitTestInfoItem : public nsDisplayItem { | ||||||
|   mozilla::UniquePtr<HitTestInfo> mHitTestInfo; |   mozilla::UniquePtr<HitTestInfo> mHitTestInfo; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayImageContainer : public nsDisplayItem { | class nsDisplayImageContainer : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   typedef mozilla::LayerIntPoint LayerIntPoint; |   typedef mozilla::LayerIntPoint LayerIntPoint; | ||||||
|   typedef mozilla::LayoutDeviceRect LayoutDeviceRect; |   typedef mozilla::LayoutDeviceRect LayoutDeviceRect; | ||||||
|  | @ -3964,7 +3999,7 @@ class nsDisplayImageContainer : public nsDisplayItem { | ||||||
|   typedef mozilla::layers::ImageLayer ImageLayer; |   typedef mozilla::layers::ImageLayer ImageLayer; | ||||||
| 
 | 
 | ||||||
|   nsDisplayImageContainer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayImageContainer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) {} |       : nsPaintedDisplayItem(aBuilder, aFrame) {} | ||||||
| 
 | 
 | ||||||
|   /**
 |   /**
 | ||||||
|    * @return true if this display item can be optimized into an image layer. |    * @return true if this display item can be optimized into an image layer. | ||||||
|  | @ -3996,7 +4031,7 @@ class nsDisplayImageContainer : public nsDisplayItem { | ||||||
|  * custom display item class could be, and fractionally slower. However it does |  * custom display item class could be, and fractionally slower. However it does | ||||||
|  * save code size. We use this for infrequently-used item types. |  * save code size. We use this for infrequently-used item types. | ||||||
|  */ |  */ | ||||||
| class nsDisplayGeneric : public nsDisplayItem { | class nsDisplayGeneric : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   typedef void (*PaintCallback)(nsIFrame* aFrame, DrawTarget* aDrawTarget, |   typedef void (*PaintCallback)(nsIFrame* aFrame, DrawTarget* aDrawTarget, | ||||||
|                                 const nsRect& aDirtyRect, nsPoint aFramePt); |                                 const nsRect& aDirtyRect, nsPoint aFramePt); | ||||||
|  | @ -4008,7 +4043,7 @@ class nsDisplayGeneric : public nsDisplayItem { | ||||||
|   nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                    PaintCallback aPaint, const char* aName, |                    PaintCallback aPaint, const char* aName, | ||||||
|                    DisplayItemType aType) |                    DisplayItemType aType) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mPaint(aPaint), |         mPaint(aPaint), | ||||||
|         mOldPaint(nullptr), |         mOldPaint(nullptr), | ||||||
|         mName(aName) { |         mName(aName) { | ||||||
|  | @ -4020,7 +4055,7 @@ class nsDisplayGeneric : public nsDisplayItem { | ||||||
|   nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                    OldPaintCallback aOldPaint, const char* aName, |                    OldPaintCallback aOldPaint, const char* aName, | ||||||
|                    DisplayItemType aType) |                    DisplayItemType aType) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mPaint(nullptr), |         mPaint(nullptr), | ||||||
|         mOldPaint(aOldPaint), |         mOldPaint(aOldPaint), | ||||||
|         mName(aName) { |         mName(aName) { | ||||||
|  | @ -4080,11 +4115,11 @@ class nsDisplayGeneric : public nsDisplayItem { | ||||||
|  * XXXbz the color thing is a bit of a mess, but 0 basically means "not set" |  * XXXbz the color thing is a bit of a mess, but 0 basically means "not set" | ||||||
|  * here...  I could switch it all to nscolor, but why bother? |  * here...  I could switch it all to nscolor, but why bother? | ||||||
|  */ |  */ | ||||||
| class nsDisplayReflowCount : public nsDisplayItem { | class nsDisplayReflowCount : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayReflowCount(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayReflowCount(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                        const char* aFrameName, uint32_t aColor = 0) |                        const char* aFrameName, uint32_t aColor = 0) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mFrameName(aFrameName), |         mFrameName(aFrameName), | ||||||
|         mColor(aColor) { |         mColor(aColor) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayReflowCount); |     MOZ_COUNT_CTOR(nsDisplayReflowCount); | ||||||
|  | @ -4143,7 +4178,7 @@ class nsDisplayReflowCount : public nsDisplayItem { | ||||||
| 
 | 
 | ||||||
| #endif  // MOZ_REFLOW_PERF_DSP && MOZ_REFLOW_PERF
 | #endif  // MOZ_REFLOW_PERF_DSP && MOZ_REFLOW_PERF
 | ||||||
| 
 | 
 | ||||||
| class nsDisplayCaret : public nsDisplayItem { | class nsDisplayCaret : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayCaret(nsDisplayListBuilder* aBuilder, nsIFrame* aCaretFrame); |   nsDisplayCaret(nsDisplayListBuilder* aBuilder, nsIFrame* aCaretFrame); | ||||||
| 
 | 
 | ||||||
|  | @ -4170,7 +4205,7 @@ class nsDisplayCaret : public nsDisplayItem { | ||||||
| /**
 | /**
 | ||||||
|  * The standard display item to paint the CSS borders of a frame. |  * The standard display item to paint the CSS borders of a frame. | ||||||
|  */ |  */ | ||||||
| class nsDisplayBorder : public nsDisplayItem { | class nsDisplayBorder : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame); |   nsDisplayBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame); | ||||||
| 
 | 
 | ||||||
|  | @ -4280,11 +4315,11 @@ class nsDisplayBorder : public nsDisplayItem { | ||||||
|  * is not yet a frame tree to go in the frame/iframe so we use the subdoc |  * is not yet a frame tree to go in the frame/iframe so we use the subdoc | ||||||
|  * frame of the parent document as a standin. |  * frame of the parent document as a standin. | ||||||
|  */ |  */ | ||||||
| class nsDisplaySolidColorBase : public nsDisplayItem { | class nsDisplaySolidColorBase : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplaySolidColorBase(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplaySolidColorBase(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                           nscolor aColor) |                           nscolor aColor) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mColor(aColor) {} |       : nsPaintedDisplayItem(aBuilder, aFrame), mColor(aColor) {} | ||||||
| 
 | 
 | ||||||
|   nsDisplayItemGeometry* AllocateGeometry( |   nsDisplayItemGeometry* AllocateGeometry( | ||||||
|       nsDisplayListBuilder* aBuilder) override { |       nsDisplayListBuilder* aBuilder) override { | ||||||
|  | @ -4380,13 +4415,13 @@ class nsDisplaySolidColor : public nsDisplaySolidColorBase { | ||||||
|  * exposed through CSS, its only purpose is efficient invalidation of |  * exposed through CSS, its only purpose is efficient invalidation of | ||||||
|  * the find bar highlighter dimmer. |  * the find bar highlighter dimmer. | ||||||
|  */ |  */ | ||||||
| class nsDisplaySolidColorRegion : public nsDisplayItem { | class nsDisplaySolidColorRegion : public nsPaintedDisplayItem { | ||||||
|   typedef mozilla::gfx::Color Color; |   typedef mozilla::gfx::Color Color; | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|   nsDisplaySolidColorRegion(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplaySolidColorRegion(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                             const nsRegion& aRegion, nscolor aColor) |                             const nsRegion& aRegion, nscolor aColor) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mRegion(aRegion), |         mRegion(aRegion), | ||||||
|         mColor(Color::FromABGR(aColor)) { |         mColor(Color::FromABGR(aColor)) { | ||||||
|     NS_ASSERTION(NS_GET_A(aColor) > 0, |     NS_ASSERTION(NS_GET_A(aColor) > 0, | ||||||
|  | @ -4576,7 +4611,7 @@ class nsDisplayBackgroundImage : public nsDisplayImageContainer { | ||||||
|     if (aFrame == mDependentFrame) { |     if (aFrame == mDependentFrame) { | ||||||
|       mDependentFrame = nullptr; |       mDependentFrame = nullptr; | ||||||
|     } |     } | ||||||
|     nsDisplayItem::RemoveFrame(aFrame); |     nsDisplayImageContainer::RemoveFrame(aFrame); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  protected: |  protected: | ||||||
|  | @ -4692,7 +4727,7 @@ class nsDisplayTableBackgroundImage : public nsDisplayBackgroundImage { | ||||||
| /**
 | /**
 | ||||||
|  * A display item to paint the native theme background for a frame. |  * A display item to paint the native theme background for a frame. | ||||||
|  */ |  */ | ||||||
| class nsDisplayThemedBackground : public nsDisplayItem { | class nsDisplayThemedBackground : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayThemedBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayThemedBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                             const nsRect& aBackgroundRect); |                             const nsRect& aBackgroundRect); | ||||||
|  | @ -4711,7 +4746,7 @@ class nsDisplayThemedBackground : public nsDisplayItem { | ||||||
| 
 | 
 | ||||||
|   void Destroy(nsDisplayListBuilder* aBuilder) override { |   void Destroy(nsDisplayListBuilder* aBuilder) override { | ||||||
|     aBuilder->UnregisterThemeGeometry(this); |     aBuilder->UnregisterThemeGeometry(this); | ||||||
|     nsDisplayItem::Destroy(aBuilder); |     nsPaintedDisplayItem::Destroy(aBuilder); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, |   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, | ||||||
|  | @ -4815,7 +4850,7 @@ class nsDisplayTableThemedBackground : public nsDisplayThemedBackground { | ||||||
|   TableType mTableType; |   TableType mTableType; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayBackgroundColor : public nsDisplayItem { | class nsDisplayBackgroundColor : public nsPaintedDisplayItem { | ||||||
|   typedef mozilla::gfx::Color Color; |   typedef mozilla::gfx::Color Color; | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|  | @ -4823,7 +4858,7 @@ class nsDisplayBackgroundColor : public nsDisplayItem { | ||||||
|                            const nsRect& aBackgroundRect, |                            const nsRect& aBackgroundRect, | ||||||
|                            const mozilla::ComputedStyle* aBackgroundStyle, |                            const mozilla::ComputedStyle* aBackgroundStyle, | ||||||
|                            const nscolor& aColor) |                            const nscolor& aColor) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mBackgroundRect(aBackgroundRect), |         mBackgroundRect(aBackgroundRect), | ||||||
|         mHasStyle(aBackgroundStyle), |         mHasStyle(aBackgroundStyle), | ||||||
|         mDependentFrame(nullptr), |         mDependentFrame(nullptr), | ||||||
|  | @ -4847,7 +4882,7 @@ class nsDisplayBackgroundColor : public nsDisplayItem { | ||||||
|   NS_DISPLAY_DECL_NAME("BackgroundColor", TYPE_BACKGROUND_COLOR) |   NS_DISPLAY_DECL_NAME("BackgroundColor", TYPE_BACKGROUND_COLOR) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { |   void RestoreState() override { | ||||||
|     nsDisplayItem::RestoreState(); |     nsPaintedDisplayItem::RestoreState(); | ||||||
|     mColor = mState.mColor; |     mColor = mState.mColor; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -4934,7 +4969,8 @@ class nsDisplayBackgroundColor : public nsDisplayItem { | ||||||
|     if (aFrame == mDependentFrame) { |     if (aFrame == mDependentFrame) { | ||||||
|       mDependentFrame = nullptr; |       mDependentFrame = nullptr; | ||||||
|     } |     } | ||||||
|     nsDisplayItem::RemoveFrame(aFrame); | 
 | ||||||
|  |     nsPaintedDisplayItem::RemoveFrame(aFrame); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void WriteDebugInfo(std::stringstream& aStream) override; |   void WriteDebugInfo(std::stringstream& aStream) override; | ||||||
|  | @ -4999,10 +5035,10 @@ class nsDisplayTableBackgroundColor : public nsDisplayBackgroundColor { | ||||||
|   TableType mTableType; |   TableType mTableType; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class nsDisplayClearBackground : public nsDisplayItem { | class nsDisplayClearBackground : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayClearBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayClearBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) {} |       : nsPaintedDisplayItem(aBuilder, aFrame) {} | ||||||
| 
 | 
 | ||||||
|   NS_DISPLAY_DECL_NAME("ClearBackground", TYPE_CLEAR_BACKGROUND) |   NS_DISPLAY_DECL_NAME("ClearBackground", TYPE_CLEAR_BACKGROUND) | ||||||
| 
 | 
 | ||||||
|  | @ -5045,10 +5081,10 @@ class nsDisplayClearBackground : public nsDisplayItem { | ||||||
| /**
 | /**
 | ||||||
|  * The standard display item to paint the outer CSS box-shadows of a frame. |  * The standard display item to paint the outer CSS box-shadows of a frame. | ||||||
|  */ |  */ | ||||||
| class nsDisplayBoxShadowOuter final : public nsDisplayItem { | class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayBoxShadowOuter(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayBoxShadowOuter(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), mOpacity(1.0f) { |       : nsPaintedDisplayItem(aBuilder, aFrame), mOpacity(1.0f) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayBoxShadowOuter); |     MOZ_COUNT_CTOR(nsDisplayBoxShadowOuter); | ||||||
|     mBounds = GetBoundsInternal(); |     mBounds = GetBoundsInternal(); | ||||||
|   } |   } | ||||||
|  | @ -5062,7 +5098,7 @@ class nsDisplayBoxShadowOuter final : public nsDisplayItem { | ||||||
|   NS_DISPLAY_DECL_NAME("BoxShadowOuter", TYPE_BOX_SHADOW_OUTER) |   NS_DISPLAY_DECL_NAME("BoxShadowOuter", TYPE_BOX_SHADOW_OUTER) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { |   void RestoreState() override { | ||||||
|     nsDisplayItem::RestoreState(); |     nsPaintedDisplayItem::RestoreState(); | ||||||
|     mVisibleRegion.SetEmpty(); |     mVisibleRegion.SetEmpty(); | ||||||
|     mOpacity = 1.0f; |     mOpacity = 1.0f; | ||||||
|   } |   } | ||||||
|  | @ -5108,10 +5144,10 @@ class nsDisplayBoxShadowOuter final : public nsDisplayItem { | ||||||
| /**
 | /**
 | ||||||
|  * The standard display item to paint the inner CSS box-shadows of a frame. |  * The standard display item to paint the inner CSS box-shadows of a frame. | ||||||
|  */ |  */ | ||||||
| class nsDisplayBoxShadowInner : public nsDisplayItem { | class nsDisplayBoxShadowInner : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayBoxShadowInner(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayBoxShadowInner(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayBoxShadowInner); |     MOZ_COUNT_CTOR(nsDisplayBoxShadowInner); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -5124,7 +5160,7 @@ class nsDisplayBoxShadowInner : public nsDisplayItem { | ||||||
|   NS_DISPLAY_DECL_NAME("BoxShadowInner", TYPE_BOX_SHADOW_INNER) |   NS_DISPLAY_DECL_NAME("BoxShadowInner", TYPE_BOX_SHADOW_INNER) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { |   void RestoreState() override { | ||||||
|     nsDisplayItem::RestoreState(); |     nsPaintedDisplayItem::RestoreState(); | ||||||
|     mVisibleRegion.SetEmpty(); |     mVisibleRegion.SetEmpty(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -5171,10 +5207,10 @@ class nsDisplayBoxShadowInner : public nsDisplayItem { | ||||||
| /**
 | /**
 | ||||||
|  * The standard display item to paint the CSS outline of a frame. |  * The standard display item to paint the CSS outline of a frame. | ||||||
|  */ |  */ | ||||||
| class nsDisplayOutline : public nsDisplayItem { | class nsDisplayOutline : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayOutline(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayOutline(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayOutline); |     MOZ_COUNT_CTOR(nsDisplayOutline); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -5199,10 +5235,10 @@ class nsDisplayOutline : public nsDisplayItem { | ||||||
|  * A class that lets you receive events within the frame bounds but never |  * A class that lets you receive events within the frame bounds but never | ||||||
|  * paints. |  * paints. | ||||||
|  */ |  */ | ||||||
| class nsDisplayEventReceiver : public nsDisplayItem { | class nsDisplayEventReceiver : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayEventReceiver(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayEventReceiver(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayEventReceiver); |     MOZ_COUNT_CTOR(nsDisplayEventReceiver); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -5350,13 +5386,12 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoItem { | ||||||
| 
 | 
 | ||||||
|   NS_DISPLAY_DECL_NAME("WrapList", TYPE_WRAP_LIST) |   NS_DISPLAY_DECL_NAME("WrapList", TYPE_WRAP_LIST) | ||||||
| 
 | 
 | ||||||
|   const nsDisplayWrapList* AsDisplayWrapList() const override { return this; } |   const nsDisplayWrapList* AsDisplayWrapList() const final { return this; } | ||||||
| 
 |   nsDisplayWrapList* AsDisplayWrapList() final { return this; } | ||||||
|   nsDisplayWrapList* AsDisplayWrapList() override { return this; } |  | ||||||
| 
 | 
 | ||||||
|   void Destroy(nsDisplayListBuilder* aBuilder) override { |   void Destroy(nsDisplayListBuilder* aBuilder) override { | ||||||
|     mList.DeleteAll(aBuilder); |     mList.DeleteAll(aBuilder); | ||||||
|     nsDisplayItem::Destroy(aBuilder); |     nsDisplayHitTestInfoItem::Destroy(aBuilder); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /**
 |   /**
 | ||||||
|  | @ -5401,7 +5436,7 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoItem { | ||||||
|     // Skip unnecessary call to
 |     // Skip unnecessary call to
 | ||||||
|     // |nsDisplayHitTestInfoItem::UpdateHitTestInfoActiveScrolledRoot()|, since
 |     // |nsDisplayHitTestInfoItem::UpdateHitTestInfoActiveScrolledRoot()|, since
 | ||||||
|     // callers will manually call that with different ASR.
 |     // callers will manually call that with different ASR.
 | ||||||
|     nsDisplayItem::SetActiveScrolledRoot(aActiveScrolledRoot); |     nsDisplayHitTestInfoItem::SetActiveScrolledRoot(aActiveScrolledRoot); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, |   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, | ||||||
|  | @ -5465,7 +5500,8 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoItem { | ||||||
|   RetainedDisplayList* GetChildren() const override { return mListPtr; } |   RetainedDisplayList* GetChildren() const override { return mListPtr; } | ||||||
| 
 | 
 | ||||||
|   int32_t ZIndex() const override { |   int32_t ZIndex() const override { | ||||||
|     return (mHasZIndexOverride) ? mOverrideZIndex : nsDisplayItem::ZIndex(); |     return (mHasZIndexOverride) ? mOverrideZIndex | ||||||
|  |                                 : nsDisplayHitTestInfoItem::ZIndex(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void SetOverrideZIndex(int32_t aZIndex) { |   void SetOverrideZIndex(int32_t aZIndex) { | ||||||
|  | @ -5586,7 +5622,7 @@ class nsDisplayOpacity : public nsDisplayWrapList { | ||||||
|   NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY) |   NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { |   void RestoreState() override { | ||||||
|     nsDisplayItem::RestoreState(); |     nsDisplayWrapList::RestoreState(); | ||||||
|     mOpacity = mState.mOpacity; |     mOpacity = mState.mOpacity; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -6490,7 +6526,10 @@ class nsDisplayEffectsBase : public nsDisplayWrapList { | ||||||
|   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, |   void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, | ||||||
|                HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override; |                HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override; | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { mHandleOpacity = false; } |   void RestoreState() override { | ||||||
|  |     nsDisplayWrapList::RestoreState(); | ||||||
|  |     mHandleOpacity = false; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override { |   bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override { | ||||||
|     return false; |     return false; | ||||||
|  | @ -6759,7 +6798,10 @@ class nsDisplayTransform : public nsDisplayHitTestInfoItem { | ||||||
| 
 | 
 | ||||||
|   NS_DISPLAY_DECL_NAME("nsDisplayTransform", TYPE_TRANSFORM) |   NS_DISPLAY_DECL_NAME("nsDisplayTransform", TYPE_TRANSFORM) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() override { mShouldFlatten = false; } |   void RestoreState() override { | ||||||
|  |     nsDisplayHitTestInfoItem::RestoreState(); | ||||||
|  |     mShouldFlatten = false; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   void UpdateBounds(nsDisplayListBuilder* aBuilder) override; |   void UpdateBounds(nsDisplayListBuilder* aBuilder) override; | ||||||
| 
 | 
 | ||||||
|  | @ -6773,7 +6815,7 @@ class nsDisplayTransform : public nsDisplayHitTestInfoItem { | ||||||
| 
 | 
 | ||||||
|   void Destroy(nsDisplayListBuilder* aBuilder) override { |   void Destroy(nsDisplayListBuilder* aBuilder) override { | ||||||
|     GetChildren()->DeleteAll(aBuilder); |     GetChildren()->DeleteAll(aBuilder); | ||||||
|     nsDisplayItem::Destroy(aBuilder); |     nsDisplayHitTestInfoItem::Destroy(aBuilder); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) const override; |   nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) const override; | ||||||
|  | @ -6850,7 +6892,7 @@ class nsDisplayTransform : public nsDisplayHitTestInfoItem { | ||||||
|     if (!mTransformGetter) { |     if (!mTransformGetter) { | ||||||
|       return mFrame; |       return mFrame; | ||||||
|     } |     } | ||||||
|     return nsDisplayItem::ReferenceFrameForChildren(); |     return nsDisplayHitTestInfoItem::ReferenceFrameForChildren(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata() const override { |   AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata() const override { | ||||||
|  | @ -7169,7 +7211,7 @@ class nsDisplayPerspective : public nsDisplayHitTestInfoItem { | ||||||
|  * The values must be non-negative. |  * The values must be non-negative. | ||||||
|  * The default value for both edges is zero, which means everything is painted. |  * The default value for both edges is zero, which means everything is painted. | ||||||
|  */ |  */ | ||||||
| class nsDisplayText final : public nsDisplayItem { | class nsDisplayText final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayText(nsDisplayListBuilder* aBuilder, nsTextFrame* aFrame, |   nsDisplayText(nsDisplayListBuilder* aBuilder, nsTextFrame* aFrame, | ||||||
|                 const mozilla::Maybe<bool>& aIsSelected); |                 const mozilla::Maybe<bool>& aIsSelected); | ||||||
|  | @ -7180,10 +7222,9 @@ class nsDisplayText final : public nsDisplayItem { | ||||||
|   NS_DISPLAY_DECL_NAME("Text", TYPE_TEXT) |   NS_DISPLAY_DECL_NAME("Text", TYPE_TEXT) | ||||||
| 
 | 
 | ||||||
|   void RestoreState() final { |   void RestoreState() final { | ||||||
|  |     nsPaintedDisplayItem::RestoreState(); | ||||||
|     mIsFrameSelected.reset(); |     mIsFrameSelected.reset(); | ||||||
|     mOpacity = 1.0f; |     mOpacity = 1.0f; | ||||||
| 
 |  | ||||||
|     nsDisplayItem::RestoreState(); |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const final { |   nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const final { | ||||||
|  |  | ||||||
|  | @ -56,12 +56,12 @@ NS_QUERYFRAME_TAIL_INHERITING(nsFrame) | ||||||
| //----------------------------------------------------------------------
 | //----------------------------------------------------------------------
 | ||||||
| // Display list item:
 | // Display list item:
 | ||||||
| 
 | 
 | ||||||
| class nsDisplaySVGGeometry final : public nsDisplayItem { | class nsDisplaySVGGeometry final : public nsPaintedDisplayItem { | ||||||
|   typedef mozilla::image::imgDrawingParams imgDrawingParams; |   typedef mozilla::image::imgDrawingParams imgDrawingParams; | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|   nsDisplaySVGGeometry(nsDisplayListBuilder* aBuilder, SVGGeometryFrame* aFrame) |   nsDisplaySVGGeometry(nsDisplayListBuilder* aBuilder, SVGGeometryFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplaySVGGeometry); |     MOZ_COUNT_CTOR(nsDisplaySVGGeometry); | ||||||
|     MOZ_ASSERT(aFrame, "Must have a frame!"); |     MOZ_ASSERT(aFrame, "Must have a frame!"); | ||||||
|   } |   } | ||||||
|  | @ -134,7 +134,8 @@ void nsDisplaySVGGeometry::ComputeInvalidationRegion( | ||||||
|     aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); |     aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion); |   nsPaintedDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, | ||||||
|  |                                                   aInvalidRegion); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| namespace mozilla { | namespace mozilla { | ||||||
|  |  | ||||||
|  | @ -2807,10 +2807,10 @@ void SVGTextDrawPathCallbacks::StrokeGeometry() { | ||||||
| // ----------------------------------------------------------------------------
 | // ----------------------------------------------------------------------------
 | ||||||
| // Display list item
 | // Display list item
 | ||||||
| 
 | 
 | ||||||
| class nsDisplaySVGText final : public nsDisplayItem { | class nsDisplaySVGText final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplaySVGText(nsDisplayListBuilder* aBuilder, SVGTextFrame* aFrame) |   nsDisplaySVGText(nsDisplayListBuilder* aBuilder, SVGTextFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplaySVGText); |     MOZ_COUNT_CTOR(nsDisplaySVGText); | ||||||
|     MOZ_ASSERT(aFrame, "Must have a frame!"); |     MOZ_ASSERT(aFrame, "Must have a frame!"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -527,10 +527,10 @@ void nsSVGOuterSVGFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas) { | ||||||
| /**
 | /**
 | ||||||
|  * Used to paint/hit-test SVG when SVG display lists are disabled. |  * Used to paint/hit-test SVG when SVG display lists are disabled. | ||||||
|  */ |  */ | ||||||
| class nsDisplayOuterSVG final : public nsDisplayItem { | class nsDisplayOuterSVG final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayOuterSVG(nsDisplayListBuilder* aBuilder, nsSVGOuterSVGFrame* aFrame) |   nsDisplayOuterSVG(nsDisplayListBuilder* aBuilder, nsSVGOuterSVGFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayOuterSVG); |     MOZ_COUNT_CTOR(nsDisplayOuterSVG); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -38,10 +38,10 @@ using namespace mozilla; | ||||||
| using namespace mozilla::gfx; | using namespace mozilla::gfx; | ||||||
| using namespace mozilla::image; | using namespace mozilla::image; | ||||||
| 
 | 
 | ||||||
| class nsDisplayTableCellSelection final : public nsDisplayItem { | class nsDisplayTableCellSelection final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayTableCellSelection(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) |   nsDisplayTableCellSelection(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayTableCellSelection); |     MOZ_COUNT_CTOR(nsDisplayTableCellSelection); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -42,11 +42,11 @@ static inline bool IsTableCell(mozilla::LayoutFrameType frameType) { | ||||||
|          frameType == mozilla::LayoutFrameType::BCTableCell; |          frameType == mozilla::LayoutFrameType::BCTableCell; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayTableItem : public nsDisplayItem { | class nsDisplayTableItem : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayTableItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, |   nsDisplayTableItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, | ||||||
|                      bool aDrawsBackground = true) |                      bool aDrawsBackground = true) | ||||||
|       : nsDisplayItem(aBuilder, aFrame), |       : nsPaintedDisplayItem(aBuilder, aFrame), | ||||||
|         mPartHasFixedBackground(false), |         mPartHasFixedBackground(false), | ||||||
|         mDrawsBackground(aDrawsBackground) {} |         mDrawsBackground(aDrawsBackground) {} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -93,11 +93,11 @@ nsIFrame* NS_NewGroupBoxFrame(PresShell* aPresShell, ComputedStyle* aStyle) { | ||||||
| 
 | 
 | ||||||
| NS_IMPL_FRAMEARENA_HELPERS(nsGroupBoxFrame) | NS_IMPL_FRAMEARENA_HELPERS(nsGroupBoxFrame) | ||||||
| 
 | 
 | ||||||
| class nsDisplayXULGroupBorder final : public nsDisplayItem { | class nsDisplayXULGroupBorder final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayXULGroupBorder(nsDisplayListBuilder* aBuilder, |   nsDisplayXULGroupBorder(nsDisplayListBuilder* aBuilder, | ||||||
|                           nsGroupBoxFrame* aFrame) |                           nsGroupBoxFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayXULGroupBorder); |     MOZ_COUNT_CTOR(nsDisplayXULGroupBorder); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -240,10 +240,10 @@ void nsTextBoxFrame::UpdateAttributes(nsAtom* aAttribute, bool& aResize, | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayXULTextBox final : public nsDisplayItem { | class nsDisplayXULTextBox final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayXULTextBox(nsDisplayListBuilder* aBuilder, nsTextBoxFrame* aFrame) |   nsDisplayXULTextBox(nsDisplayListBuilder* aBuilder, nsTextBoxFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayXULTextBox); |     MOZ_COUNT_CTOR(nsDisplayXULTextBox); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  |  | ||||||
|  | @ -2463,10 +2463,10 @@ nsresult nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext, | ||||||
|   return NS_OK; |   return NS_OK; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class nsDisplayTreeBody final : public nsDisplayItem { | class nsDisplayTreeBody final : public nsPaintedDisplayItem { | ||||||
|  public: |  public: | ||||||
|   nsDisplayTreeBody(nsDisplayListBuilder* aBuilder, nsFrame* aFrame) |   nsDisplayTreeBody(nsDisplayListBuilder* aBuilder, nsFrame* aFrame) | ||||||
|       : nsDisplayItem(aBuilder, aFrame) { |       : nsPaintedDisplayItem(aBuilder, aFrame) { | ||||||
|     MOZ_COUNT_CTOR(nsDisplayTreeBody); |     MOZ_COUNT_CTOR(nsDisplayTreeBody); | ||||||
|   } |   } | ||||||
| #ifdef NS_BUILD_REFCNT_LOGGING | #ifdef NS_BUILD_REFCNT_LOGGING | ||||||
|  | @ -2480,7 +2480,7 @@ class nsDisplayTreeBody final : public nsDisplayItem { | ||||||
| 
 | 
 | ||||||
|   void Destroy(nsDisplayListBuilder* aBuilder) override { |   void Destroy(nsDisplayListBuilder* aBuilder) override { | ||||||
|     aBuilder->UnregisterThemeGeometry(this); |     aBuilder->UnregisterThemeGeometry(this); | ||||||
|     nsDisplayItem::Destroy(aBuilder); |     nsPaintedDisplayItem::Destroy(aBuilder); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, |   void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, | ||||||
|  | @ -2495,8 +2495,8 @@ class nsDisplayTreeBody final : public nsDisplayItem { | ||||||
|       aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); |       aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, |     nsPaintedDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, | ||||||
|                                              aInvalidRegion); |                                                     aInvalidRegion); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   virtual void Paint(nsDisplayListBuilder* aBuilder, |   virtual void Paint(nsDisplayListBuilder* aBuilder, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Miko Mynttinen
						Miko Mynttinen