Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel

MozReview-Commit-ID: K1WUIOnvazF
This commit is contained in:
Alexis Beingessner 2017-06-09 15:14:53 -04:00 committed by Jeff Muizelaar
parent 19e589eeb2
commit adb013669b
182 changed files with 919 additions and 1020 deletions

View File

@ -7,6 +7,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxPattern.h" #include "gfxPattern.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
@ -19,7 +20,6 @@
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsColor.h" #include "nsColor.h"
#include "gfxContext.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsCSSValue.h" #include "nsCSSValue.h"

View File

@ -5,9 +5,9 @@
#ifndef mozilla_dom_DocumentRendererChild #ifndef mozilla_dom_DocumentRendererChild
#define mozilla_dom_DocumentRendererChild #define mozilla_dom_DocumentRendererChild
#include "gfxContext.h"
#include "mozilla/ipc/PDocumentRendererChild.h" #include "mozilla/ipc/PDocumentRendererChild.h"
#include "nsString.h" #include "nsString.h"
#include "gfxContext.h"
class nsIDOMWindow; class nsIDOMWindow;

View File

@ -5,10 +5,10 @@
#ifndef mozilla_dom_DocumentRendererParent #ifndef mozilla_dom_DocumentRendererParent
#define mozilla_dom_DocumentRendererParent #define mozilla_dom_DocumentRendererParent
#include "gfxContext.h"
#include "mozilla/ipc/PDocumentRendererParent.h" #include "mozilla/ipc/PDocumentRendererParent.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsString.h" #include "nsString.h"
#include "gfxContext.h"
class nsICanvasRenderingContextInternal; class nsICanvasRenderingContextInternal;

View File

@ -31,7 +31,6 @@
#ifdef MOZ_X11 #ifdef MOZ_X11
#include "gfxXlibSurface.h" #include "gfxXlibSurface.h"
#endif #endif
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "Layers.h" #include "Layers.h"

View File

@ -60,8 +60,7 @@ public:
RefPtr<gfxContext> context = gfxContext::CreateOrNull(aDT, aDeviceOffset); RefPtr<gfxContext> context = gfxContext::CreateOrNull(aDT, aDeviceOffset);
context->SetMatrix(ThebesMatrix(transform)); context->SetMatrix(ThebesMatrix(transform));
nsRenderingContext ctx(context); mItem->Paint(mBuilder, context);
mItem->Paint(mBuilder, &ctx);
} }
protected: protected:

View File

@ -161,8 +161,7 @@ WebRenderDisplayItemLayer::PushItemAsBlobImage(wr::DisplayListBuilder& aBuilder,
RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt, offset.ToUnknownPoint()); RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt, offset.ToUnknownPoint());
MOZ_ASSERT(context); MOZ_ASSERT(context);
nsRenderingContext ctx(context); mItem->Paint(mBuilder, context);
mItem->Paint(mBuilder, &ctx);
} }
wr::ByteBuffer bytes; wr::ByteBuffer bytes;

View File

@ -33,7 +33,6 @@ EXPORTS += [
'nsRect.h', 'nsRect.h',
'nsRegion.h', 'nsRegion.h',
'nsRegionFwd.h', 'nsRegionFwd.h',
'nsRenderingContext.h',
'nsSize.h', 'nsSize.h',
'nsThemeConstants.h', 'nsThemeConstants.h',
'nsTransform2D.h', 'nsTransform2D.h',

View File

@ -6,6 +6,7 @@
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
#include <math.h> // for floor, ceil #include <math.h> // for floor, ceil
#include <algorithm> // for max #include <algorithm> // for max
#include "gfxContext.h" // for gfxContext
#include "gfxFontConstants.h" // for NS_FONT_SYNTHESIS_* #include "gfxFontConstants.h" // for NS_FONT_SYNTHESIS_*
#include "gfxPlatform.h" // for gfxPlatform #include "gfxPlatform.h" // for gfxPlatform
#include "gfxPoint.h" // for gfxPoint #include "gfxPoint.h" // for gfxPoint
@ -16,7 +17,6 @@
#include "nsDeviceContext.h" // for nsDeviceContext #include "nsDeviceContext.h" // for nsDeviceContext
#include "nsIAtom.h" // for nsIAtom #include "nsIAtom.h" // for nsIAtom
#include "nsMathUtils.h" // for NS_round #include "nsMathUtils.h" // for NS_round
#include "nsRenderingContext.h" // for nsRenderingContext
#include "nsString.h" // for nsString #include "nsString.h" // for nsString
#include "nsStyleConsts.h" // for StyleHyphens::None #include "nsStyleConsts.h" // for StyleHyphens::None
#include "mozilla/Assertions.h" // for MOZ_ASSERT #include "mozilla/Assertions.h" // for MOZ_ASSERT
@ -354,7 +354,7 @@ nsFontMetrics::GetWidth(const char16_t* aString, uint32_t aLength,
void void
nsFontMetrics::DrawString(const char *aString, uint32_t aLength, nsFontMetrics::DrawString(const char *aString, uint32_t aLength,
nscoord aX, nscoord aY, nscoord aX, nscoord aY,
nsRenderingContext *aContext) gfxContext *aContext)
{ {
if (aLength == 0) if (aLength == 0)
return; return;
@ -373,7 +373,7 @@ nsFontMetrics::DrawString(const char *aString, uint32_t aLength,
pt.x += textRun->GetAdvanceWidth(range, &provider); pt.x += textRun->GetAdvanceWidth(range, &provider);
} }
} }
gfxTextRun::DrawParams params(aContext->ThebesContext()); gfxTextRun::DrawParams params(aContext);
params.provider = &provider; params.provider = &provider;
textRun->Draw(range, pt, params); textRun->Draw(range, pt, params);
} }
@ -381,7 +381,7 @@ nsFontMetrics::DrawString(const char *aString, uint32_t aLength,
void void
nsFontMetrics::DrawString(const char16_t* aString, uint32_t aLength, nsFontMetrics::DrawString(const char16_t* aString, uint32_t aLength,
nscoord aX, nscoord aY, nscoord aX, nscoord aY,
nsRenderingContext *aContext, gfxContext *aContext,
DrawTarget* aTextRunConstructionDrawTarget) DrawTarget* aTextRunConstructionDrawTarget)
{ {
if (aLength == 0) if (aLength == 0)
@ -401,7 +401,7 @@ nsFontMetrics::DrawString(const char16_t* aString, uint32_t aLength,
pt.x += textRun->GetAdvanceWidth(range, &provider); pt.x += textRun->GetAdvanceWidth(range, &provider);
} }
} }
gfxTextRun::DrawParams params(aContext->ThebesContext()); gfxTextRun::DrawParams params(aContext);
params.provider = &provider; params.provider = &provider;
textRun->Draw(range, pt, params); textRun->Draw(range, pt, params);
} }

View File

@ -18,11 +18,11 @@
#include "nsISupports.h" // for NS_INLINE_DECL_REFCOUNTING #include "nsISupports.h" // for NS_INLINE_DECL_REFCOUNTING
#include "nscore.h" // for char16_t #include "nscore.h" // for char16_t
class gfxContext;
class gfxUserFontSet; class gfxUserFontSet;
class gfxTextPerfMetrics; class gfxTextPerfMetrics;
class nsDeviceContext; class nsDeviceContext;
class nsIAtom; class nsIAtom;
class nsRenderingContext;
struct nsBoundingMetrics; struct nsBoundingMetrics;
/** /**
@ -200,10 +200,10 @@ public:
// Draw a string using this font handle on the surface passed in. // Draw a string using this font handle on the surface passed in.
void DrawString(const char *aString, uint32_t aLength, void DrawString(const char *aString, uint32_t aLength,
nscoord aX, nscoord aY, nscoord aX, nscoord aY,
nsRenderingContext *aContext); gfxContext *aContext);
void DrawString(const char16_t* aString, uint32_t aLength, void DrawString(const char16_t* aString, uint32_t aLength,
nscoord aX, nscoord aY, nscoord aX, nscoord aY,
nsRenderingContext *aContext, gfxContext *aContext,
DrawTarget* aTextRunConstructionDrawTarget); DrawTarget* aTextRunConstructionDrawTarget);
nsBoundingMetrics GetBoundingMetrics(const char16_t *aString, nsBoundingMetrics GetBoundingMetrics(const char16_t *aString,

View File

@ -15,9 +15,9 @@
#include "Units.h" #include "Units.h"
struct nsRect; struct nsRect;
class gfxContext;
class nsAttrValue; class nsAttrValue;
class nsPresContext; class nsPresContext;
class nsRenderingContext;
class nsDeviceContext; class nsDeviceContext;
class nsIFrame; class nsIFrame;
class nsIAtom; class nsIAtom;
@ -55,7 +55,7 @@ public:
* @param aRect the rectangle defining the area occupied by the widget * @param aRect the rectangle defining the area occupied by the widget
* @param aDirtyRect the rectangle that needs to be drawn * @param aDirtyRect the rectangle that needs to be drawn
*/ */
NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext, NS_IMETHOD DrawWidgetBackground(gfxContext* aContext,
nsIFrame* aFrame, nsIFrame* aFrame,
uint8_t aWidgetType, uint8_t aWidgetType,
const nsRect& aRect, const nsRect& aRect,

View File

@ -1,41 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NSRENDERINGCONTEXT__H__
#define NSRENDERINGCONTEXT__H__
#include "gfxContext.h"
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "mozilla/RefPtr.h"
namespace mozilla {
namespace gfx {
class DrawTarget;
} // namespace gfx
} // namespace mozilla
class MOZ_STACK_CLASS nsRenderingContext final
{
typedef mozilla::gfx::DrawTarget DrawTarget;
public:
explicit nsRenderingContext(gfxContext* aThebesContext)
: mThebes(aThebesContext)
{}
explicit nsRenderingContext(already_AddRefed<gfxContext>&& aThebesContext)
: mThebes(aThebesContext)
{}
// These accessors will never return null.
gfxContext *ThebesContext() { return mThebes; }
DrawTarget *GetDrawTarget() { return mThebes->GetDrawTarget(); }
private:
RefPtr<gfxContext> mThebes;
};
#endif // NSRENDERINGCONTEXT__H__

View File

@ -11,6 +11,7 @@
#include "mozilla/GeckoRestyleManager.h" #include "mozilla/GeckoRestyleManager.h"
#include <algorithm> // For std::max #include <algorithm> // For std::max
#include "gfxContext.h"
#include "mozilla/EffectSet.h" #include "mozilla/EffectSet.h"
#include "mozilla/EventStates.h" #include "mozilla/EventStates.h"
#include "mozilla/ViewportFrame.h" #include "mozilla/ViewportFrame.h"
@ -31,7 +32,6 @@
#include "nsAnimationManager.h" #include "nsAnimationManager.h"
#include "nsTransitionManager.h" #include "nsTransitionManager.h"
#include "nsViewManager.h" #include "nsViewManager.h"
#include "nsRenderingContext.h"
#include "nsSVGIntegrationUtils.h" #include "nsSVGIntegrationUtils.h"
#include "nsCSSAnonBoxes.h" #include "nsCSSAnonBoxes.h"
#include "nsContainerFrame.h" #include "nsContainerFrame.h"

View File

@ -45,6 +45,7 @@
#include "winuser.h" #include "winuser.h"
#endif #endif
#include "gfxContext.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "gfxUserFontSet.h" #include "gfxUserFontSet.h"
#include "nsPresContext.h" #include "nsPresContext.h"
@ -102,7 +103,6 @@
#include "prenv.h" #include "prenv.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsRegion.h" #include "nsRegion.h"
#include "nsRenderingContext.h"
#include "nsAutoLayoutPhase.h" #include "nsAutoLayoutPhase.h"
#ifdef MOZ_REFLOW_PERF #ifdef MOZ_REFLOW_PERF
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
@ -118,7 +118,6 @@
#include "nsNetUtil.h" #include "nsNetUtil.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsStyleSheetService.h" #include "nsStyleSheetService.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "nsSMILAnimationController.h" #include "nsSMILAnimationController.h"
#include "SVGContentUtils.h" #include "SVGContentUtils.h"
@ -381,7 +380,7 @@ public:
void Add(const char * aName, nsIFrame * aFrame); void Add(const char * aName, nsIFrame * aFrame);
ReflowCounter * LookUp(const char * aName); ReflowCounter * LookUp(const char * aName);
void PaintCount(const char *aName, nsRenderingContext* aRenderingContext, void PaintCount(const char *aName, gfxContext* aRenderingContext,
nsPresContext *aPresContext, nsIFrame *aFrame, nsPresContext *aPresContext, nsIFrame *aFrame,
const nsPoint &aOffset, uint32_t aColor); const nsPoint &aOffset, uint32_t aColor);
@ -4685,8 +4684,6 @@ PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
AutoSaveRestoreRenderingState _(this); AutoSaveRestoreRenderingState _(this);
nsRenderingContext rc(aThebesContext);
bool wouldFlushRetainedLayers = false; bool wouldFlushRetainedLayers = false;
PaintFrameFlags flags = PaintFrameFlags::PAINT_IGNORE_SUPPRESSION; PaintFrameFlags flags = PaintFrameFlags::PAINT_IGNORE_SUPPRESSION;
if (aThebesContext->CurrentMatrix().HasNonIntegerTranslation()) { if (aThebesContext->CurrentMatrix().HasNonIntegerTranslation()) {
@ -4735,7 +4732,7 @@ PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
flags &= ~PaintFrameFlags::PAINT_WIDGET_LAYERS; flags &= ~PaintFrameFlags::PAINT_WIDGET_LAYERS;
} }
nsLayoutUtils::PaintFrame(&rc, rootFrame, nsRegion(aRect), nsLayoutUtils::PaintFrame(aThebesContext, rootFrame, nsRegion(aRect),
aBackgroundColor, aBackgroundColor,
nsDisplayListBuilderMode::PAINTING, nsDisplayListBuilderMode::PAINTING,
flags); flags);
@ -5075,8 +5072,6 @@ PresShell::PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems
ctx->Clip(path); ctx->Clip(path);
} }
nsRenderingContext rc(ctx);
gfxMatrix initialTM = ctx->CurrentMatrix(); gfxMatrix initialTM = ctx->CurrentMatrix();
if (resize) if (resize)
@ -5111,7 +5106,7 @@ PresShell::PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems
aArea.MoveBy(-rangeInfo->mRootOffset.x, -rangeInfo->mRootOffset.y); aArea.MoveBy(-rangeInfo->mRootOffset.x, -rangeInfo->mRootOffset.y);
nsRegion visible(aArea); nsRegion visible(aArea);
RefPtr<LayerManager> layerManager = RefPtr<LayerManager> layerManager =
rangeInfo->mList.PaintRoot(&rangeInfo->mBuilder, &rc, rangeInfo->mList.PaintRoot(&rangeInfo->mBuilder, ctx,
nsDisplayList::PAINT_DEFAULT); nsDisplayList::PAINT_DEFAULT);
aArea.MoveBy(rangeInfo->mRootOffset.x, rangeInfo->mRootOffset.y); aArea.MoveBy(rangeInfo->mRootOffset.x, rangeInfo->mRootOffset.y);
} }
@ -9243,7 +9238,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame(); nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
// CreateReferenceRenderingContext can return nullptr // CreateReferenceRenderingContext can return nullptr
nsRenderingContext rcx(CreateReferenceRenderingContext()); RefPtr<gfxContext> rcx(CreateReferenceRenderingContext());
#ifdef DEBUG #ifdef DEBUG
mCurrentReflowRoot = target; mCurrentReflowRoot = target;
@ -9266,7 +9261,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
// Don't pass size directly to the reflow state, since a // Don't pass size directly to the reflow state, since a
// constrained height implies page/column breaking. // constrained height implies page/column breaking.
LogicalSize reflowSize(wm, size.ISize(wm), NS_UNCONSTRAINEDSIZE); LogicalSize reflowSize(wm, size.ISize(wm), NS_UNCONSTRAINEDSIZE);
ReflowInput reflowInput(mPresContext, target, &rcx, reflowSize, ReflowInput reflowInput(mPresContext, target, rcx, reflowSize,
ReflowInput::CALLER_WILL_INIT); ReflowInput::CALLER_WILL_INIT);
reflowInput.mOrthogonalLimit = size.BSize(wm); reflowInput.mOrthogonalLimit = size.BSize(wm);
@ -9347,7 +9342,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
target->GetView(), target->GetView(),
boundsRelativeToTarget); boundsRelativeToTarget);
nsContainerFrame::SyncWindowProperties(mPresContext, target, nsContainerFrame::SyncWindowProperties(mPresContext, target,
target->GetView(), &rcx, target->GetView(), rcx,
nsContainerFrame::SET_ASYNC); nsContainerFrame::SET_ASYNC);
target->DidReflow(mPresContext, nullptr, nsDidReflowStatus::FINISHED); target->DidReflow(mPresContext, nullptr, nsDidReflowStatus::FINISHED);
@ -10265,7 +10260,7 @@ PresShell::CountReflows(const char * aName, nsIFrame * aFrame)
//------------------------------------------------------------- //-------------------------------------------------------------
void void
PresShell::PaintCount(const char * aName, PresShell::PaintCount(const char * aName,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsIFrame * aFrame, nsIFrame * aFrame,
const nsPoint& aOffset, const nsPoint& aOffset,
@ -10458,7 +10453,7 @@ void ReflowCountMgr::Add(const char * aName, nsIFrame * aFrame)
//------------------------------------------------------------------ //------------------------------------------------------------------
void ReflowCountMgr::PaintCount(const char* aName, void ReflowCountMgr::PaintCount(const char* aName,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
const nsPoint& aOffset, const nsPoint& aOffset,
@ -10475,11 +10470,11 @@ void ReflowCountMgr::PaintCount(const char* aName,
DrawTarget* drawTarget = aRenderingContext->GetDrawTarget(); DrawTarget* drawTarget = aRenderingContext->GetDrawTarget();
int32_t appUnitsPerDevPixel = aPresContext->AppUnitsPerDevPixel(); int32_t appUnitsPerDevPixel = aPresContext->AppUnitsPerDevPixel();
aRenderingContext->ThebesContext()->Save(); aRenderingContext->Save();
gfxPoint devPixelOffset = gfxPoint devPixelOffset =
nsLayoutUtils::PointToGfxPoint(aOffset, appUnitsPerDevPixel); nsLayoutUtils::PointToGfxPoint(aOffset, appUnitsPerDevPixel);
aRenderingContext->ThebesContext()->SetMatrix( aRenderingContext->SetMatrix(
aRenderingContext->ThebesContext()->CurrentMatrix().Translate(devPixelOffset)); aRenderingContext->CurrentMatrix().Translate(devPixelOffset));
// We don't care about the document language or user fonts here; // We don't care about the document language or user fonts here;
// just get a default Latin font. // just get a default Latin font.
@ -10522,12 +10517,12 @@ void ReflowCountMgr::PaintCount(const char* aName,
ColorPattern black(ToDeviceColor(Color(0.f, 0.f, 0.f, 1.f))); ColorPattern black(ToDeviceColor(Color(0.f, 0.f, 0.f, 1.f)));
drawTarget->FillRect(devPxRect, black); drawTarget->FillRect(devPxRect, black);
aRenderingContext->ThebesContext()->SetColor(color2); aRenderingContext->SetColor(color2);
fm->DrawString(buf, len, x+15, y+15, aRenderingContext); fm->DrawString(buf, len, x+15, y+15, aRenderingContext);
aRenderingContext->ThebesContext()->SetColor(color); aRenderingContext->SetColor(color);
fm->DrawString(buf, len, x, y, aRenderingContext); fm->DrawString(buf, len, x, y, aRenderingContext);
aRenderingContext->ThebesContext()->Restore(); aRenderingContext->Restore();
} }
} }
} }
@ -11192,8 +11187,8 @@ nsIPresShell::SyncWindowProperties(nsView* aView)
nsIFrame* frame = aView->GetFrame(); nsIFrame* frame = aView->GetFrame();
if (frame && mPresContext) { if (frame && mPresContext) {
// CreateReferenceRenderingContext can return nullptr // CreateReferenceRenderingContext can return nullptr
nsRenderingContext rcx(CreateReferenceRenderingContext()); RefPtr<gfxContext> rcx(CreateReferenceRenderingContext());
nsContainerFrame::SyncWindowProperties(mPresContext, frame, aView, &rcx, 0); nsContainerFrame::SyncWindowProperties(mPresContext, frame, aView, rcx, 0);
} }
} }

View File

@ -318,7 +318,7 @@ public:
virtual void DumpReflows() override; virtual void DumpReflows() override;
virtual void CountReflows(const char * aName, nsIFrame * aFrame) override; virtual void CountReflows(const char * aName, nsIFrame * aFrame) override;
virtual void PaintCount(const char * aName, virtual void PaintCount(const char * aName,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsIFrame * aFrame, nsIFrame * aFrame,
const nsPoint& aOffset, const nsPoint& aOffset,

View File

@ -821,8 +821,8 @@ RecomputePosition(nsIFrame* aFrame)
// the frame, and then get the offsets and size from it. If the frame's size // the frame, and then get the offsets and size from it. If the frame's size
// doesn't need to change, we can simply update the frame position. Otherwise // doesn't need to change, we can simply update the frame position. Otherwise
// we fall back to a reflow. // we fall back to a reflow.
nsRenderingContext rc( RefPtr<gfxContext> rc =
aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext()); aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
// Construct a bogus parent reflow state so that there's a usable // Construct a bogus parent reflow state so that there's a usable
// containing block reflow state. // containing block reflow state.
@ -832,7 +832,7 @@ RecomputePosition(nsIFrame* aFrame)
LogicalSize parentSize = parentFrame->GetLogicalSize(); LogicalSize parentSize = parentFrame->GetLogicalSize();
nsFrameState savedState = parentFrame->GetStateBits(); nsFrameState savedState = parentFrame->GetStateBits();
ReflowInput parentReflowInput(aFrame->PresContext(), parentFrame, &rc, ReflowInput parentReflowInput(aFrame->PresContext(), parentFrame, rc,
parentSize); parentSize);
parentFrame->RemoveStateBits(~nsFrameState(0)); parentFrame->RemoveStateBits(~nsFrameState(0));
parentFrame->AddStateBits(savedState); parentFrame->AddStateBits(savedState);
@ -846,7 +846,7 @@ RecomputePosition(nsIFrame* aFrame)
if (cbFrame && (aFrame->GetContainingBlock() != parentFrame || if (cbFrame && (aFrame->GetContainingBlock() != parentFrame ||
parentFrame->IsTableFrame())) { parentFrame->IsTableFrame())) {
LogicalSize cbSize = cbFrame->GetLogicalSize(); LogicalSize cbSize = cbFrame->GetLogicalSize();
cbReflowInput.emplace(cbFrame->PresContext(), cbFrame, &rc, cbSize); cbReflowInput.emplace(cbFrame->PresContext(), cbFrame, rc, cbSize);
cbReflowInput->ComputedPhysicalMargin() = cbFrame->GetUsedMargin(); cbReflowInput->ComputedPhysicalMargin() = cbFrame->GetUsedMargin();
cbReflowInput->ComputedPhysicalPadding() = cbFrame->GetUsedPadding(); cbReflowInput->ComputedPhysicalPadding() = cbFrame->GetUsedPadding();
cbReflowInput->ComputedPhysicalBorderPadding() = cbReflowInput->ComputedPhysicalBorderPadding() =

View File

@ -5,12 +5,12 @@
#include "mozilla/IntegerRange.h" #include "mozilla/IntegerRange.h"
#include "gfxContext.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsBidiPresUtils.h" #include "nsBidiPresUtils.h"
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsBidiUtils.h" #include "nsBidiUtils.h"
#include "nsCSSFrameConstructor.h" #include "nsCSSFrameConstructor.h"
#include "nsContainerFrame.h" #include "nsContainerFrame.h"
@ -2300,7 +2300,7 @@ class MOZ_STACK_CLASS nsIRenderingContextBidiProcessor final
public: public:
typedef mozilla::gfx::DrawTarget DrawTarget; typedef mozilla::gfx::DrawTarget DrawTarget;
nsIRenderingContextBidiProcessor(nsRenderingContext* aCtx, nsIRenderingContextBidiProcessor(gfxContext* aCtx,
DrawTarget* aTextRunConstructionDrawTarget, DrawTarget* aTextRunConstructionDrawTarget,
nsFontMetrics* aFontMetrics, nsFontMetrics* aFontMetrics,
const nsPoint& aPt) const nsPoint& aPt)
@ -2344,7 +2344,7 @@ public:
} }
private: private:
nsRenderingContext* mCtx; gfxContext* mCtx;
DrawTarget* mTextRunConstructionDrawTarget; DrawTarget* mTextRunConstructionDrawTarget;
nsFontMetrics* mFontMetrics; nsFontMetrics* mFontMetrics;
nsPoint mPt; nsPoint mPt;
@ -2356,7 +2356,7 @@ nsresult nsBidiPresUtils::ProcessTextForRenderingContext(const char16_t* a
int32_t aLength, int32_t aLength,
nsBidiLevel aBaseLevel, nsBidiLevel aBaseLevel,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
DrawTarget* aTextRunConstructionDrawTarget, DrawTarget* aTextRunConstructionDrawTarget,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
Mode aMode, Mode aMode,

View File

@ -7,11 +7,11 @@
#ifndef nsBidiPresUtils_h___ #ifndef nsBidiPresUtils_h___
#define nsBidiPresUtils_h___ #define nsBidiPresUtils_h___
#include "gfxContext.h"
#include "nsBidi.h" #include "nsBidi.h"
#include "nsBidiUtils.h" #include "nsBidiUtils.h"
#include "nsHashKeys.h" #include "nsHashKeys.h"
#include "nsCoord.h" #include "nsCoord.h"
#include "nsRenderingContext.h"
#ifdef DrawText #ifdef DrawText
#undef DrawText #undef DrawText
@ -19,11 +19,11 @@
struct BidiParagraphData; struct BidiParagraphData;
struct BidiLineData; struct BidiLineData;
class gfxContext;
class nsFontMetrics; class nsFontMetrics;
class nsIFrame; class nsIFrame;
class nsBlockFrame; class nsBlockFrame;
class nsPresContext; class nsPresContext;
class nsRenderingContext;
class nsBlockInFlowLineIterator; class nsBlockInFlowLineIterator;
class nsStyleContext; class nsStyleContext;
struct nsSize; struct nsSize;
@ -213,7 +213,7 @@ public:
int32_t aLength, int32_t aLength,
nsBidiLevel aBaseLevel, nsBidiLevel aBaseLevel,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
DrawTarget* aTextRunConstructionDrawTarget, DrawTarget* aTextRunConstructionDrawTarget,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nscoord aX, nscoord aX,
@ -231,7 +231,7 @@ public:
int32_t aLength, int32_t aLength,
nsBidiLevel aBaseLevel, nsBidiLevel aBaseLevel,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics) nsFontMetrics& aFontMetrics)
{ {
nscoord length; nscoord length;
@ -379,7 +379,7 @@ private:
int32_t aLength, int32_t aLength,
nsBidiLevel aBaseLevel, nsBidiLevel aBaseLevel,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
DrawTarget* aTextRunConstructionDrawTarget, DrawTarget* aTextRunConstructionDrawTarget,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
Mode aMode, Mode aMode,

View File

@ -6,6 +6,7 @@
/* container for a document and its presentation */ /* container for a document and its presentation */
#include "gfxContext.h"
#include "mozilla/ServoRestyleManager.h" #include "mozilla/ServoRestyleManager.h"
#include "mozilla/ServoStyleSet.h" #include "mozilla/ServoStyleSet.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
@ -82,7 +83,6 @@
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsStyleSheetService.h" #include "nsStyleSheetService.h"
#include "nsRenderingContext.h"
#include "nsILoadContext.h" #include "nsILoadContext.h"
#include "nsIPrompt.h" #include "nsIPrompt.h"
@ -3527,8 +3527,8 @@ nsDocumentViewer::GetContentSizeInternal(int32_t* aWidth, int32_t* aHeight,
nscoord prefWidth; nscoord prefWidth;
{ {
nsRenderingContext rcx(presShell->CreateReferenceRenderingContext()); RefPtr<gfxContext> rcx(presShell->CreateReferenceRenderingContext());
prefWidth = root->GetPrefISize(&rcx); prefWidth = root->GetPrefISize(rcx);
} }
if (prefWidth > aMaxWidth) { if (prefWidth > aMaxWidth) {
prefWidth = aMaxWidth; prefWidth = aMaxWidth;

View File

@ -51,13 +51,13 @@
#include "nsFrameState.h" #include "nsFrameState.h"
#include "Units.h" #include "Units.h"
class gfxContext;
class nsDocShell; class nsDocShell;
class nsIDocument; class nsIDocument;
class nsIFrame; class nsIFrame;
class nsPresContext; class nsPresContext;
class nsViewManager; class nsViewManager;
class nsView; class nsView;
class nsRenderingContext;
class nsIPageSequenceFrame; class nsIPageSequenceFrame;
class nsCanvasFrame; class nsCanvasFrame;
class nsAString; class nsAString;
@ -77,7 +77,6 @@ template<class E> class nsCOMArray;
class AutoWeakFrame; class AutoWeakFrame;
class WeakFrame; class WeakFrame;
class nsIScrollableFrame; class nsIScrollableFrame;
class gfxContext;
class nsIDOMEvent; class nsIDOMEvent;
class nsDisplayList; class nsDisplayList;
class nsDisplayListBuilder; class nsDisplayListBuilder;
@ -1021,7 +1020,7 @@ public:
virtual void DumpReflows() = 0; virtual void DumpReflows() = 0;
virtual void CountReflows(const char * aName, nsIFrame * aFrame) = 0; virtual void CountReflows(const char * aName, nsIFrame * aFrame) = 0;
virtual void PaintCount(const char * aName, virtual void PaintCount(const char * aName,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsPresContext * aPresContext, nsPresContext * aPresContext,
nsIFrame * aFrame, nsIFrame * aFrame,
const nsPoint& aOffset, const nsPoint& aOffset,

View File

@ -50,7 +50,7 @@
#include "ImageRegion.h" #include "ImageRegion.h"
#include "gfxRect.h" #include "gfxRect.h"
#include "gfxContext.h" #include "gfxContext.h"
#include "nsRenderingContext.h" #include "gfxContext.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsCSSRendering.h" #include "nsCSSRendering.h"
#include "nsTextFragment.h" #include "nsTextFragment.h"
@ -3420,7 +3420,7 @@ nsLayoutUtils::ExpireDisplayPortOnAsyncScrollableAncestor(nsIFrame* aFrame)
} }
nsresult nsresult
nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFrame, nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
const nsRegion& aDirtyRegion, nscolor aBackstop, const nsRegion& aDirtyRegion, nscolor aBackstop,
nsDisplayListBuilderMode aBuilderMode, nsDisplayListBuilderMode aBuilderMode,
PaintFrameFlags aFlags) PaintFrameFlags aFlags)
@ -3518,8 +3518,8 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
gfxPoint devPixelOffset = gfxPoint devPixelOffset =
nsLayoutUtils::PointToGfxPoint(pos, nsLayoutUtils::PointToGfxPoint(pos,
presContext->AppUnitsPerDevPixel()); presContext->AppUnitsPerDevPixel());
aRenderingContext->ThebesContext()->SetMatrix( aRenderingContext->SetMatrix(
aRenderingContext->ThebesContext()->CurrentMatrix().Translate(devPixelOffset)); aRenderingContext->CurrentMatrix().Translate(devPixelOffset));
} }
} }
builder.SetIgnoreScrollFrame(rootScrollFrame); builder.SetIgnoreScrollFrame(rootScrollFrame);
@ -4857,7 +4857,7 @@ GetDefiniteSizeTakenByBoxSizing(StyleBoxSizing aBoxSizing,
enum eWidthProperty { PROP_WIDTH, PROP_MAX_WIDTH, PROP_MIN_WIDTH }; enum eWidthProperty { PROP_WIDTH, PROP_MAX_WIDTH, PROP_MIN_WIDTH };
static bool static bool
GetIntrinsicCoord(const nsStyleCoord& aStyle, GetIntrinsicCoord(const nsStyleCoord& aStyle,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
eWidthProperty aProperty, eWidthProperty aProperty,
nscoord& aResult) nscoord& aResult)
@ -4965,7 +4965,7 @@ FormControlShrinksForPercentISize(nsIFrame* aFrame)
* @param aContainerWM the container's WM * @param aContainerWM the container's WM
*/ */
static nscoord static nscoord
AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, AddIntrinsicSizeOffset(gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
const nsIFrame::IntrinsicISizeOffsetData& aOffsets, const nsIFrame::IntrinsicISizeOffsetData& aOffsets,
nsLayoutUtils::IntrinsicISizeType aType, nsLayoutUtils::IntrinsicISizeType aType,
@ -5110,7 +5110,7 @@ AddStateBitToAncestors(nsIFrame* aFrame, nsFrameState aBit)
/* static */ nscoord /* static */ nscoord
nsLayoutUtils::IntrinsicForAxis(PhysicalAxis aAxis, nsLayoutUtils::IntrinsicForAxis(PhysicalAxis aAxis,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
const Maybe<LogicalSize>& aPercentageBasis, const Maybe<LogicalSize>& aPercentageBasis,
@ -5364,7 +5364,7 @@ nsLayoutUtils::IntrinsicForAxis(PhysicalAxis aAxis,
} }
/* static */ nscoord /* static */ nscoord
nsLayoutUtils::IntrinsicForContainer(nsRenderingContext* aRenderingContext, nsLayoutUtils::IntrinsicForContainer(gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
uint32_t aFlags) uint32_t aFlags)
@ -5378,7 +5378,7 @@ nsLayoutUtils::IntrinsicForContainer(nsRenderingContext* aRenderingContext,
/* static */ nscoord /* static */ nscoord
nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis, nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis,
nsRenderingContext* aRC, gfxContext* aRC,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
uint32_t aFlags) uint32_t aFlags)
@ -5674,7 +5674,7 @@ nsLayoutUtils::ComputeAutoSizeWithIntrinsicDimensions(nscoord minWidth, nscoord
/* static */ nscoord /* static */ nscoord
nsLayoutUtils::MinISizeFromInline(nsIFrame* aFrame, nsLayoutUtils::MinISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext) gfxContext* aRenderingContext)
{ {
NS_ASSERTION(!aFrame->IsContainerForFontSizeInflation(), NS_ASSERTION(!aFrame->IsContainerForFontSizeInflation(),
"should not be container for font size inflation"); "should not be container for font size inflation");
@ -5688,7 +5688,7 @@ nsLayoutUtils::MinISizeFromInline(nsIFrame* aFrame,
/* static */ nscoord /* static */ nscoord
nsLayoutUtils::PrefISizeFromInline(nsIFrame* aFrame, nsLayoutUtils::PrefISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext) gfxContext* aRenderingContext)
{ {
NS_ASSERTION(!aFrame->IsContainerForFontSizeInflation(), NS_ASSERTION(!aFrame->IsContainerForFontSizeInflation(),
"should not be container for font size inflation"); "should not be container for font size inflation");
@ -5821,7 +5821,7 @@ nsLayoutUtils::AppUnitWidthOfStringBidi(const char16_t* aString,
uint32_t aLength, uint32_t aLength,
const nsIFrame* aFrame, const nsIFrame* aFrame,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext& aContext) gfxContext& aContext)
{ {
nsPresContext* presContext = aFrame->PresContext(); nsPresContext* presContext = aFrame->PresContext();
if (presContext->BidiEnabled()) { if (presContext->BidiEnabled()) {
@ -5890,7 +5890,7 @@ nsLayoutUtils::AppUnitBoundsOfString(const char16_t* aString,
void void
nsLayoutUtils::DrawString(const nsIFrame* aFrame, nsLayoutUtils::DrawString(const nsIFrame* aFrame,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext* aContext, gfxContext* aContext,
const char16_t* aString, const char16_t* aString,
int32_t aLength, int32_t aLength,
nsPoint aPoint, nsPoint aPoint,
@ -5934,7 +5934,7 @@ nsLayoutUtils::DrawUniDirString(const char16_t* aString,
uint32_t aLength, uint32_t aLength,
nsPoint aPoint, nsPoint aPoint,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext& aContext) gfxContext& aContext)
{ {
nscoord x = aPoint.x; nscoord x = aPoint.x;
nscoord y = aPoint.y; nscoord y = aPoint.y;
@ -5972,7 +5972,7 @@ nsLayoutUtils::DrawUniDirString(const char16_t* aString,
/* static */ void /* static */ void
nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame, nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame,
nsRenderingContext* aContext, gfxContext* aContext,
const nsRect& aTextRect, const nsRect& aTextRect,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nscolor& aForegroundColor, const nscolor& aForegroundColor,
@ -5985,7 +5985,7 @@ nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame,
// Text shadow happens with the last value being painted at the back, // Text shadow happens with the last value being painted at the back,
// ie. it is painted first. // ie. it is painted first.
gfxContext* aDestCtx = aContext->ThebesContext(); gfxContext* aDestCtx = aContext;
for (uint32_t i = textStyle->mTextShadow->Length(); i > 0; --i) { for (uint32_t i = textStyle->mTextShadow->Length(); i > 0; --i) {
nsCSSShadowItem* shadowDetails = textStyle->mTextShadow->ShadowAt(i - 1); nsCSSShadowItem* shadowDetails = textStyle->mTextShadow->ShadowAt(i - 1);
nsPoint shadowOffset(shadowDetails->mXOffset, nsPoint shadowOffset(shadowDetails->mXOffset,
@ -6009,16 +6009,12 @@ nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame,
else else
shadowColor = aForegroundColor; shadowColor = aForegroundColor;
// Conjure an nsRenderingContext from a gfxContext for drawing the text
// to blur.
nsRenderingContext renderingContext(shadowContext);
aDestCtx->Save(); aDestCtx->Save();
aDestCtx->NewPath(); aDestCtx->NewPath();
aDestCtx->SetColor(Color::FromABGR(shadowColor)); aDestCtx->SetColor(Color::FromABGR(shadowColor));
// The callback will draw whatever we want to blur as a shadow. // The callback will draw whatever we want to blur as a shadow.
aCallback(&renderingContext, shadowOffset, shadowColor, aCallbackData); aCallback(shadowContext, shadowOffset, shadowColor, aCallbackData);
contextBoxBlur.DoPaint(); contextBoxBlur.DoPaint();
aDestCtx->Restore(); aDestCtx->Restore();

View File

@ -35,6 +35,7 @@
#include <limits> #include <limits>
#include <algorithm> #include <algorithm>
class gfxContext;
class nsPresContext; class nsPresContext;
class nsIContent; class nsIContent;
class nsIAtom; class nsIAtom;
@ -54,7 +55,6 @@ class nsView;
class nsIFrame; class nsIFrame;
class nsStyleCoord; class nsStyleCoord;
class nsStyleCorners; class nsStyleCorners;
class gfxContext;
class nsPIDOMWindowOuter; class nsPIDOMWindowOuter;
class imgIRequest; class imgIRequest;
class nsIDocument; class nsIDocument;
@ -1094,7 +1094,7 @@ public:
* necessarily correspond to what's visible in the window; we don't * necessarily correspond to what's visible in the window; we don't
* want to mess up the widget's layer tree. * want to mess up the widget's layer tree.
*/ */
static nsresult PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFrame, static nsresult PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
const nsRegion& aDirtyRegion, nscolor aBackstop, const nsRegion& aDirtyRegion, nscolor aBackstop,
nsDisplayListBuilderMode aBuilderMode, nsDisplayListBuilderMode aBuilderMode,
PaintFrameFlags aFlags = PaintFrameFlags(0)); PaintFrameFlags aFlags = PaintFrameFlags(0));
@ -1395,7 +1395,7 @@ public:
}; };
static nscoord static nscoord
IntrinsicForAxis(mozilla::PhysicalAxis aAxis, IntrinsicForAxis(mozilla::PhysicalAxis aAxis,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
const mozilla::Maybe<mozilla::LogicalSize>& aPercentageBasis = mozilla::Nothing(), const mozilla::Maybe<mozilla::LogicalSize>& aPercentageBasis = mozilla::Nothing(),
@ -1404,7 +1404,7 @@ public:
/** /**
* Calls IntrinsicForAxis with aFrame's parent's inline physical axis. * Calls IntrinsicForAxis with aFrame's parent's inline physical axis.
*/ */
static nscoord IntrinsicForContainer(nsRenderingContext* aRenderingContext, static nscoord IntrinsicForContainer(gfxContext* aRenderingContext,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
uint32_t aFlags = 0); uint32_t aFlags = 0);
@ -1427,7 +1427,7 @@ public:
* should be a grid/flex item. * should be a grid/flex item.
*/ */
static nscoord MinSizeContributionForAxis(mozilla::PhysicalAxis aAxis, static nscoord MinSizeContributionForAxis(mozilla::PhysicalAxis aAxis,
nsRenderingContext* aRC, gfxContext* aRC,
nsIFrame* aFrame, nsIFrame* aFrame,
IntrinsicISizeType aType, IntrinsicISizeType aType,
uint32_t aFlags = 0); uint32_t aFlags = 0);
@ -1539,11 +1539,11 @@ public:
// Implement nsIFrame::GetPrefISize in terms of nsIFrame::AddInlinePrefISize // Implement nsIFrame::GetPrefISize in terms of nsIFrame::AddInlinePrefISize
static nscoord PrefISizeFromInline(nsIFrame* aFrame, static nscoord PrefISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext); gfxContext* aRenderingContext);
// Implement nsIFrame::GetMinISize in terms of nsIFrame::AddInlineMinISize // Implement nsIFrame::GetMinISize in terms of nsIFrame::AddInlineMinISize
static nscoord MinISizeFromInline(nsIFrame* aFrame, static nscoord MinISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext); gfxContext* aRenderingContext);
// Get a suitable foreground color for painting aColor for aFrame. // Get a suitable foreground color for painting aColor for aFrame.
static nscolor DarkenColorIfNeeded(nsIFrame* aFrame, nscolor aColor); static nscolor DarkenColorIfNeeded(nsIFrame* aFrame, nscolor aColor);
@ -1584,7 +1584,7 @@ public:
static nscoord AppUnitWidthOfStringBidi(const nsString& aString, static nscoord AppUnitWidthOfStringBidi(const nsString& aString,
const nsIFrame* aFrame, const nsIFrame* aFrame,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext& aContext) { gfxContext& aContext) {
return nsLayoutUtils::AppUnitWidthOfStringBidi(aString.get(), return nsLayoutUtils::AppUnitWidthOfStringBidi(aString.get(),
aString.Length(), aFrame, aString.Length(), aFrame,
aFontMetrics, aContext); aFontMetrics, aContext);
@ -1593,7 +1593,7 @@ public:
uint32_t aLength, uint32_t aLength,
const nsIFrame* aFrame, const nsIFrame* aFrame,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext& aContext); gfxContext& aContext);
static bool StringWidthIsGreaterThan(const nsString& aString, static bool StringWidthIsGreaterThan(const nsString& aString,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
@ -1607,7 +1607,7 @@ public:
static void DrawString(const nsIFrame* aFrame, static void DrawString(const nsIFrame* aFrame,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext* aContext, gfxContext* aContext,
const char16_t* aString, const char16_t* aString,
int32_t aLength, int32_t aLength,
nsPoint aPoint, nsPoint aPoint,
@ -1625,19 +1625,19 @@ public:
uint32_t aLength, uint32_t aLength,
nsPoint aPoint, nsPoint aPoint,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsRenderingContext& aContext); gfxContext& aContext);
/** /**
* Helper function for drawing text-shadow. The callback's job * Helper function for drawing text-shadow. The callback's job
* is to draw whatever needs to be blurred onto the given context. * is to draw whatever needs to be blurred onto the given context.
*/ */
typedef void (* TextShadowCallback)(nsRenderingContext* aCtx, typedef void (* TextShadowCallback)(gfxContext* aCtx,
nsPoint aShadowOffset, nsPoint aShadowOffset,
const nscolor& aShadowColor, const nscolor& aShadowColor,
void* aData); void* aData);
static void PaintTextShadow(const nsIFrame* aFrame, static void PaintTextShadow(const nsIFrame* aFrame,
nsRenderingContext* aContext, gfxContext* aContext,
const nsRect& aTextRect, const nsRect& aTextRect,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nscolor& aForegroundColor, const nscolor& aForegroundColor,

View File

@ -88,7 +88,7 @@ public:
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
bool* aSnap) override; bool* aSnap) override;
NS_DISPLAY_DECL_NAME("ButtonBoxShadowOuter", TYPE_BUTTON_BOX_SHADOW_OUTER) NS_DISPLAY_DECL_NAME("ButtonBoxShadowOuter", TYPE_BUTTON_BOX_SHADOW_OUTER)
@ -102,7 +102,7 @@ nsDisplayButtonBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder, bool* a
void void
nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) { gfxContext* aCtx) {
nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetSize()); nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
nsCSSRendering::PaintBoxShadowOuter(mFrame->PresContext(), *aCtx, mFrame, nsCSSRendering::PaintBoxShadowOuter(mFrame->PresContext(), *aCtx, mFrame,
@ -127,7 +127,7 @@ public:
aOutFrames->AppendElement(mFrame); aOutFrames->AppendElement(mFrame);
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
bool* aSnap) override; bool* aSnap) override;
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override; virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override;
@ -243,7 +243,7 @@ nsDisplayButtonBorder::ComputeInvalidationRegion(
void void
nsDisplayButtonBorder::Paint(nsDisplayListBuilder* aBuilder, nsDisplayButtonBorder::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
NS_ASSERTION(mFrame, "No frame?"); NS_ASSERTION(mFrame, "No frame?");
nsPresContext* pc = mFrame->PresContext(); nsPresContext* pc = mFrame->PresContext();
@ -281,7 +281,7 @@ public:
const nsDisplayItemGeometry* aGeometry, const nsDisplayItemGeometry* aGeometry,
nsRegion *aInvalidRegion) override; nsRegion *aInvalidRegion) override;
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager, LayerManager* aManager,
const ContainerLayerParameters& aParameters) override; const ContainerLayerParameters& aParameters) override;
@ -323,7 +323,7 @@ nsDisplayButtonForeground::ComputeInvalidationRegion(
} }
void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nsPresContext *presContext = mFrame->PresContext(); nsPresContext *presContext = mFrame->PresContext();
const nsStyleDisplay *disp = mFrame->StyleDisplay(); const nsStyleDisplay *disp = mFrame->StyleDisplay();
@ -427,7 +427,7 @@ DrawResult
nsButtonFrameRenderer::PaintInnerFocusBorder( nsButtonFrameRenderer::PaintInnerFocusBorder(
nsDisplayListBuilder* aBuilder, nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect) const nsRect& aRect)
{ {
@ -457,7 +457,7 @@ Maybe<nsCSSBorderRenderer>
nsButtonFrameRenderer::CreateInnerFocusBorderRenderer( nsButtonFrameRenderer::CreateInnerFocusBorderRenderer(
nsDisplayListBuilder* aBuilder, nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect) const nsRect& aRect)
{ {
@ -481,7 +481,7 @@ DrawResult
nsButtonFrameRenderer::PaintBorder( nsButtonFrameRenderer::PaintBorder(
nsDisplayListBuilder* aBuilder, nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect) const nsRect& aRect)
{ {

View File

@ -10,12 +10,12 @@
#include "nsMargin.h" #include "nsMargin.h"
#include "nsCSSRenderingBorders.h" #include "nsCSSRenderingBorders.h"
class gfxContext;
class nsIFrame; class nsIFrame;
class nsFrame; class nsFrame;
class nsDisplayList; class nsDisplayList;
class nsDisplayListBuilder; class nsDisplayListBuilder;
class nsPresContext; class nsPresContext;
class nsRenderingContext;
struct nsRect; struct nsRect;
class nsStyleContext; class nsStyleContext;
@ -40,19 +40,19 @@ public:
DrawResult PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder, DrawResult PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect); const nsRect& aRect);
mozilla::Maybe<nsCSSBorderRenderer> CreateInnerFocusBorderRenderer(nsDisplayListBuilder* aBuilder, mozilla::Maybe<nsCSSBorderRenderer> CreateInnerFocusBorderRenderer(nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect); const nsRect& aRect);
DrawResult PaintBorder(nsDisplayListBuilder* aBuilder, DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsRect& aRect); const nsRect& aRect);

View File

@ -5,6 +5,7 @@
#include "nsComboboxControlFrame.h" #include "nsComboboxControlFrame.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h" #include "mozilla/gfx/PathHelpers.h"
@ -38,7 +39,6 @@
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsITheme.h" #include "nsITheme.h"
#include "nsThemeConstants.h" #include "nsThemeConstants.h"
#include "nsRenderingContext.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include <algorithm> #include <algorithm>
#include "nsTextNode.h" #include "nsTextNode.h"
@ -735,7 +735,7 @@ static void printSize(char * aDesc, nscoord aSize)
//------------------------------------------------------------------- //-------------------------------------------------------------------
nscoord nscoord
nsComboboxControlFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext, nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
nsLayoutUtils::IntrinsicISizeType aType) nsLayoutUtils::IntrinsicISizeType aType)
{ {
// get the scrollbar width, we'll use this later // get the scrollbar width, we'll use this later
@ -791,7 +791,7 @@ nsComboboxControlFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsComboboxControlFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsComboboxControlFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord minISize; nscoord minISize;
DISPLAY_MIN_WIDTH(this, minISize); DISPLAY_MIN_WIDTH(this, minISize);
@ -800,7 +800,7 @@ nsComboboxControlFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsComboboxControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsComboboxControlFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord prefISize; nscoord prefISize;
DISPLAY_PREF_WIDTH(this, prefISize); DISPLAY_PREF_WIDTH(this, prefISize);
@ -1539,12 +1539,12 @@ public:
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("ComboboxFocus", TYPE_COMBOBOX_FOCUS) NS_DISPLAY_DECL_NAME("ComboboxFocus", TYPE_COMBOBOX_FOCUS)
}; };
void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
static_cast<nsComboboxControlFrame*>(mFrame) static_cast<nsComboboxControlFrame*>(mFrame)
->PaintFocus(*aCtx->GetDrawTarget(), ToReferenceFrame()); ->PaintFocus(*aCtx->GetDrawTarget(), ToReferenceFrame());

View File

@ -77,9 +77,9 @@ public:
virtual mozilla::a11y::AccType AccessibleType() override; virtual mozilla::a11y::AccType AccessibleType() override;
#endif #endif
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aCX, virtual void Reflow(nsPresContext* aCX,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
@ -249,7 +249,7 @@ protected:
DropDownPositionState AbsolutelyPositionDropDown(); DropDownPositionState AbsolutelyPositionDropDown();
// Helper for GetMinISize/GetPrefISize // Helper for GetMinISize/GetPrefISize
nscoord GetIntrinsicISize(nsRenderingContext* aRenderingContext, nscoord GetIntrinsicISize(gfxContext* aRenderingContext,
nsLayoutUtils::IntrinsicISizeType aType); nsLayoutUtils::IntrinsicISizeType aType);
class RedisplayTextEvent : public mozilla::Runnable { class RedisplayTextEvent : public mozilla::Runnable {

View File

@ -126,7 +126,7 @@ nsDateTimeControlFrame::HandleBlurEvent()
} }
nscoord nscoord
nsDateTimeControlFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsDateTimeControlFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -144,7 +144,7 @@ nsDateTimeControlFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
nscoord nscoord
nsDateTimeControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsDateTimeControlFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -56,9 +56,9 @@ public:
} }
// Reflow // Reflow
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; nscoord GetMinISize(gfxContext* aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; nscoord GetPrefISize(gfxContext* aRenderingContext) override;
void Reflow(nsPresContext* aPresContext, void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,

View File

@ -6,6 +6,7 @@
#include "nsFieldSetFrame.h" #include "nsFieldSetFrame.h"
#include <algorithm> #include <algorithm>
#include "gfxContext.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
@ -16,7 +17,6 @@
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsLegendFrame.h" #include "nsLegendFrame.h"
#include "nsRenderingContext.h"
#include "nsStyleConsts.h" #include "nsStyleConsts.h"
using namespace mozilla; using namespace mozilla;
@ -91,7 +91,7 @@ public:
} }
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override; virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override;
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry, const nsDisplayItemGeometry* aGeometry,
@ -102,7 +102,7 @@ public:
void void
nsDisplayFieldSetBorder::Paint(nsDisplayListBuilder* aBuilder, nsDisplayFieldSetBorder::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
image::DrawResult result = static_cast<nsFieldSetFrame*>(mFrame)-> image::DrawResult result = static_cast<nsFieldSetFrame*>(mFrame)->
PaintBorder(aBuilder, *aCtx, ToReferenceFrame(), mVisibleRect); PaintBorder(aBuilder, *aCtx, ToReferenceFrame(), mVisibleRect);
@ -204,7 +204,7 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
image::DrawResult image::DrawResult
nsFieldSetFrame::PaintBorder( nsFieldSetFrame::PaintBorder(
nsDisplayListBuilder* aBuilder, nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
nsPoint aPt, nsPoint aPt,
const nsRect& aDirtyRect) const nsRect& aDirtyRect)
{ {
@ -255,14 +255,12 @@ nsFieldSetFrame::PaintBorder(
false); false);
RefPtr<Path> clipPath = pathBuilder->Finish(); RefPtr<Path> clipPath = pathBuilder->Finish();
gfxContext* gfx = aRenderingContext.ThebesContext(); aRenderingContext.Save();
aRenderingContext.Clip(clipPath);
gfx->Save();
gfx->Clip(clipPath);
result &= result &=
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this, nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
aDirtyRect, rect, mStyleContext, borderFlags); aDirtyRect, rect, mStyleContext, borderFlags);
gfx->Restore(); aRenderingContext.Restore();
} else { } else {
result &= result &=
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this, nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
@ -274,7 +272,7 @@ nsFieldSetFrame::PaintBorder(
} }
nscoord nscoord
nsFieldSetFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext, nsFieldSetFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
nsLayoutUtils::IntrinsicISizeType aType) nsLayoutUtils::IntrinsicISizeType aType)
{ {
nscoord legendWidth = 0; nscoord legendWidth = 0;
@ -298,7 +296,7 @@ nsFieldSetFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext,
nscoord nscoord
nsFieldSetFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsFieldSetFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -308,7 +306,7 @@ nsFieldSetFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
nscoord nscoord
nsFieldSetFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsFieldSetFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -20,10 +20,10 @@ public:
explicit nsFieldSetFrame(nsStyleContext* aContext); explicit nsFieldSetFrame(nsStyleContext* aContext);
nscoord nscoord
GetIntrinsicISize(nsRenderingContext* aRenderingContext, GetIntrinsicISize(gfxContext* aRenderingContext,
nsLayoutUtils::IntrinsicISizeType); nsLayoutUtils::IntrinsicISizeType);
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
/** /**
* The area to paint box-shadows around. It's the border rect except * The area to paint box-shadows around. It's the border rect except
@ -48,7 +48,7 @@ public:
const nsDisplayListSet& aLists) override; const nsDisplayListSet& aLists) override;
DrawResult PaintBorder(nsDisplayListBuilder* aBuilder, DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
nsPoint aPt, const nsRect& aDirtyRect); nsPoint aPt, const nsRect& aDirtyRect);
#ifdef DEBUG #ifdef DEBUG

View File

@ -422,7 +422,7 @@ nsFileControlFrame::DnDListener::CanDropTheseFiles(nsIDOMDataTransfer* aDOMDataT
} }
nscoord nscoord
nsFileControlFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsFileControlFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);

View File

@ -43,7 +43,7 @@ public:
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override; virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override;
virtual void SetFocus(bool aOn, bool aRepaint) override; virtual void SetFocus(bool aOn, bool aRepaint) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override; virtual void DestroyFrom(nsIFrame* aDestructRoot) override;

View File

@ -40,7 +40,7 @@ NS_QUERYFRAME_HEAD(nsFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsAtomicContainerFrame) NS_QUERYFRAME_TAIL_INHERITING(nsAtomicContainerFrame)
/* virtual */ nscoord /* virtual */ nscoord
nsFormControlFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsFormControlFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -53,7 +53,7 @@ nsFormControlFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsFormControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsFormControlFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);
@ -67,7 +67,7 @@ nsFormControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsFormControlFrame::ComputeAutoSize(nsRenderingContext* aRC, nsFormControlFrame::ComputeAutoSize(gfxContext* aRC,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -48,14 +48,14 @@ public:
* Both GetMinISize and GetPrefISize will return whatever GetIntrinsicISize * Both GetMinISize and GetPrefISize will return whatever GetIntrinsicISize
* returns. * returns.
*/ */
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
/** /**
* Our auto size is just intrinsic width and intrinsic height. * Our auto size is just intrinsic width and intrinsic height.
*/ */
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -5,12 +5,12 @@
#include "nsGfxCheckboxControlFrame.h" #include "nsGfxCheckboxControlFrame.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsRenderingContext.h"
#include "nsIDOMHTMLInputElement.h" #include "nsIDOMHTMLInputElement.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include <algorithm> #include <algorithm>

View File

@ -6,11 +6,11 @@
#include "nsGfxRadioControlFrame.h" #include "nsGfxRadioControlFrame.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h" #include "mozilla/gfx/PathHelpers.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsRenderingContext.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
using namespace mozilla; using namespace mozilla;

View File

@ -142,7 +142,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
nscoord nscoord
nsHTMLButtonControlFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsHTMLButtonControlFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -156,7 +156,7 @@ nsHTMLButtonControlFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
nscoord nscoord
nsHTMLButtonControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsHTMLButtonControlFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -11,7 +11,7 @@
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsButtonFrameRenderer.h" #include "nsButtonFrameRenderer.h"
class nsRenderingContext; class gfxContext;
class nsPresContext; class nsPresContext;
class nsHTMLButtonControlFrame : public nsContainerFrame, class nsHTMLButtonControlFrame : public nsContainerFrame,
@ -33,9 +33,9 @@ public:
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override; const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,

View File

@ -323,7 +323,7 @@ nsListControlFrame::CalcBSizeOfARow()
} }
nscoord nscoord
nsListControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsListControlFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);
@ -341,7 +341,7 @@ nsListControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsListControlFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsListControlFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);

View File

@ -65,8 +65,8 @@ public:
virtual void SetInitialChildList(ChildListID aListID, virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override; nsFrameList& aChildList) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aCX, virtual void Reflow(nsPresContext* aCX,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,

View File

@ -210,7 +210,7 @@ nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
} }
LogicalSize LogicalSize
nsMeterFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsMeterFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -236,7 +236,7 @@ nsMeterFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsMeterFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsMeterFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
RefPtr<nsFontMetrics> fontMet = RefPtr<nsFontMetrics> fontMet =
nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f); nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f);
@ -252,7 +252,7 @@ nsMeterFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsMeterFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsMeterFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
return GetMinISize(aRenderingContext); return GetMinISize(aRenderingContext);
} }

View File

@ -48,7 +48,7 @@ public:
int32_t aModType) override; int32_t aModType) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -57,8 +57,8 @@ public:
const mozilla::LogicalSize& aPadding, const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override; ComputeSizeFlags aFlags) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override virtual bool IsFrameOfType(uint32_t aFlags) const override
{ {

View File

@ -67,7 +67,7 @@ nsNumberControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
} }
nscoord nscoord
nsNumberControlFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsNumberControlFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -85,7 +85,7 @@ nsNumberControlFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
nscoord nscoord
nsNumberControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsNumberControlFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -53,9 +53,9 @@ public:
virtual mozilla::a11y::AccType AccessibleType() override; virtual mozilla::a11y::AccType AccessibleType() override;
#endif #endif
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,

View File

@ -224,7 +224,7 @@ nsProgressFrame::AttributeChanged(int32_t aNameSpaceID,
} }
LogicalSize LogicalSize
nsProgressFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsProgressFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -249,7 +249,7 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsProgressFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsProgressFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
RefPtr<nsFontMetrics> fontMet = RefPtr<nsFontMetrics> fontMet =
nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f); nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f);
@ -265,7 +265,7 @@ nsProgressFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsProgressFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsProgressFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
return GetMinISize(aRenderingContext); return GetMinISize(aRenderingContext);
} }

View File

@ -56,7 +56,7 @@ public:
int32_t aModType) override; int32_t aModType) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -65,8 +65,8 @@ public:
const mozilla::LogicalSize& aPadding, const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override; ComputeSizeFlags aFlags) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override virtual bool IsFrameOfType(uint32_t aFlags) const override
{ {

View File

@ -8,6 +8,7 @@
#include "mozilla/EventStates.h" #include "mozilla/EventStates.h"
#include "mozilla/TouchEvents.h" #include "mozilla/TouchEvents.h"
#include "gfxContext.h"
#include "nsContentCreatorFunctions.h" #include "nsContentCreatorFunctions.h"
#include "nsContentList.h" #include "nsContentList.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
@ -22,7 +23,6 @@
#include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/HTMLInputElement.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsNodeInfoManager.h" #include "nsNodeInfoManager.h"
#include "nsRenderingContext.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/StyleSetHandle.h" #include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h" #include "mozilla/StyleSetHandleInlines.h"
@ -188,7 +188,7 @@ public:
const nsDisplayItemGeometry* aGeometry, const nsDisplayItemGeometry* aGeometry,
nsRegion *aInvalidRegion) override; nsRegion *aInvalidRegion) override;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override; virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override;
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override; virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("RangeFocusRing", TYPE_RANGE_FOCUS_RING) NS_DISPLAY_DECL_NAME("RangeFocusRing", TYPE_RANGE_FOCUS_RING)
}; };
@ -234,7 +234,7 @@ nsDisplayRangeFocusRing::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
void void
nsDisplayRangeFocusRing::Paint(nsDisplayListBuilder* aBuilder, nsDisplayRangeFocusRing::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
bool unused; bool unused;
nsStyleContext* styleContext = nsStyleContext* styleContext =
@ -768,7 +768,7 @@ nsRangeFrame::AttributeChanged(int32_t aNameSpaceID,
} }
LogicalSize LogicalSize
nsRangeFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsRangeFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -803,7 +803,7 @@ nsRangeFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsRangeFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsRangeFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
// nsFrame::ComputeSize calls GetMinimumWidgetSize to prevent us from being // nsFrame::ComputeSize calls GetMinimumWidgetSize to prevent us from being
// given too small a size when we're natively themed. If we aren't native // given too small a size when we're natively themed. If we aren't native
@ -812,7 +812,7 @@ nsRangeFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsRangeFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsRangeFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
bool isInline = IsInlineOriented(); bool isInline = IsInlineOriented();

View File

@ -70,7 +70,7 @@ public:
int32_t aModType) override; int32_t aModType) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -79,8 +79,8 @@ public:
const mozilla::LogicalSize& aPadding, const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override; ComputeSizeFlags aFlags) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override virtual bool IsFrameOfType(uint32_t aFlags) const override
{ {

View File

@ -115,7 +115,7 @@ public:
listFrame->GetOffsetToCrossDoc(ReferenceFrame()); listFrame->GetOffsetToCrossDoc(ReferenceFrame());
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override { gfxContext* aCtx) override {
nsListControlFrame* listFrame = GetEnclosingListFrame(Frame()); nsListControlFrame* listFrame = GetEnclosingListFrame(Frame());
// listFrame must be non-null or we wouldn't get called. // listFrame must be non-null or we wouldn't get called.
listFrame->PaintFocus(aCtx->GetDrawTarget(), listFrame->PaintFocus(aCtx->GetDrawTarget(),

View File

@ -5,6 +5,7 @@
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "gfxContext.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
#include "nsTextControlFrame.h" #include "nsTextControlFrame.h"
@ -20,7 +21,6 @@
#include "nsIContent.h" #include "nsIContent.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
@ -138,7 +138,7 @@ nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
} }
LogicalSize LogicalSize
nsTextControlFrame::CalcIntrinsicSize(nsRenderingContext* aRenderingContext, nsTextControlFrame::CalcIntrinsicSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
float aFontSizeInflation) const float aFontSizeInflation) const
{ {
@ -431,7 +431,7 @@ nsTextControlFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
} }
nscoord nscoord
nsTextControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsTextControlFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);
@ -442,7 +442,7 @@ nsTextControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
} }
nscoord nscoord
nsTextControlFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsTextControlFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
// Our min width is just our preferred width if we have auto width. // Our min width is just our preferred width if we have auto width.
nscoord result; nscoord result;
@ -452,7 +452,7 @@ nsTextControlFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
LogicalSize LogicalSize
nsTextControlFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsTextControlFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -44,11 +44,11 @@ public:
return do_QueryFrame(PrincipalChildList().FirstChild()); return do_QueryFrame(PrincipalChildList().FirstChild());
} }
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -300,7 +300,7 @@ protected:
// Compute our intrinsic size. This does not include any borders, paddings, // Compute our intrinsic size. This does not include any borders, paddings,
// etc. Just the size of our actual area for the text (and the scrollbars, // etc. Just the size of our actual area for the text (and the scrollbars,
// for <textarea>). // for <textarea>).
mozilla::LogicalSize CalcIntrinsicSize(nsRenderingContext* aRenderingContext, mozilla::LogicalSize CalcIntrinsicSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
float aFontSizeInflation) const; float aFontSizeInflation) const;

View File

@ -5,6 +5,7 @@
/* rendering object for HTML <br> elements */ /* rendering object for HTML <br> elements */
#include "gfxContext.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsContainerFrame.h" #include "nsContainerFrame.h"
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
@ -13,7 +14,6 @@
#include "nsLineLayout.h" #include "nsLineLayout.h"
#include "nsStyleConsts.h" #include "nsStyleConsts.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsRenderingContext.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
//FOR SELECTION //FOR SELECTION
@ -44,12 +44,12 @@ public:
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override; nsReflowStatus& aStatus) override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override; virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override virtual bool IsFrameOfType(uint32_t aFlags) const override
@ -175,7 +175,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
} }
/* virtual */ void /* virtual */ void
BRFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext, BRFrame::AddInlineMinISize(gfxContext *aRenderingContext,
nsIFrame::InlineMinISizeData *aData) nsIFrame::InlineMinISizeData *aData)
{ {
if (!GetParent()->StyleContext()->ShouldSuppressLineBreak()) { if (!GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
@ -184,7 +184,7 @@ BRFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
} }
/* virtual */ void /* virtual */ void
BRFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext, BRFrame::AddInlinePrefISize(gfxContext *aRenderingContext,
nsIFrame::InlinePrefISizeData *aData) nsIFrame::InlinePrefISizeData *aData)
{ {
if (!GetParent()->StyleContext()->ShouldSuppressLineBreak()) { if (!GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
@ -195,7 +195,7 @@ BRFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
} }
/* virtual */ nscoord /* virtual */ nscoord
BRFrame::GetMinISize(nsRenderingContext *aRenderingContext) BRFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -203,7 +203,7 @@ BRFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
BRFrame::GetPrefISize(nsRenderingContext *aRenderingContext) BRFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -201,7 +201,7 @@ BlockReflowInput::ComputeReplacedBlockOffsetsForFloats(
static nscoord static nscoord
GetBEndMarginClone(nsIFrame* aFrame, GetBEndMarginClone(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const LogicalRect& aContentArea, const LogicalRect& aContentArea,
WritingMode aWritingMode) WritingMode aWritingMode)
{ {

View File

@ -55,7 +55,7 @@ static eNormalLineHeightControl sNormalLineHeightControl = eUninitialized;
// use for measuring things. // use for measuring things.
ReflowInput::ReflowInput(nsPresContext* aPresContext, ReflowInput::ReflowInput(nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const LogicalSize& aAvailableSpace, const LogicalSize& aAvailableSpace,
uint32_t aFlags) uint32_t aFlags)
: SizeComputationInput(aFrame, aRenderingContext) : SizeComputationInput(aFrame, aRenderingContext)
@ -160,7 +160,7 @@ FontSizeInflationListMarginAdjustment(const nsIFrame* aFrame)
// block-direction percent margins and padding against the // block-direction percent margins and padding against the
// containing-block block-size, rather than its inline-size. // containing-block block-size, rather than its inline-size.
SizeComputationInput::SizeComputationInput(nsIFrame *aFrame, SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
nsRenderingContext *aRenderingContext, gfxContext *aRenderingContext,
WritingMode aContainingBlockWritingMode, WritingMode aContainingBlockWritingMode,
nscoord aContainingBlockISize) nscoord aContainingBlockISize)
: mFrame(aFrame) : mFrame(aFrame)

View File

@ -14,13 +14,13 @@
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h"
#include <algorithm> #include <algorithm>
class gfxContext;
class nsFloatManager; class nsFloatManager;
struct nsHypotheticalPosition; struct nsHypotheticalPosition;
class nsIPercentBSizeObserver; class nsIPercentBSizeObserver;
class nsLineLayout; class nsLineLayout;
class nsPlaceholderFrame; class nsPlaceholderFrame;
class nsPresContext; class nsPresContext;
class nsRenderingContext;
/** /**
* @return aValue clamped to [aMinValue, aMaxValue]. * @return aValue clamped to [aMinValue, aMaxValue].
@ -108,7 +108,7 @@ public:
nsIFrame* mFrame; nsIFrame* mFrame;
// Rendering context to use for measurement. // Rendering context to use for measurement.
nsRenderingContext* mRenderingContext; gfxContext* mRenderingContext;
const nsMargin& ComputedPhysicalMargin() const { return mComputedMargin; } const nsMargin& ComputedPhysicalMargin() const { return mComputedMargin; }
const nsMargin& ComputedPhysicalBorderPadding() const { return mComputedBorderPadding; } const nsMargin& ComputedPhysicalBorderPadding() const { return mComputedBorderPadding; }
@ -165,14 +165,14 @@ protected:
public: public:
// Callers using this constructor must call InitOffsets on their own. // Callers using this constructor must call InitOffsets on their own.
SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext) SizeComputationInput(nsIFrame *aFrame, gfxContext *aRenderingContext)
: mFrame(aFrame) : mFrame(aFrame)
, mRenderingContext(aRenderingContext) , mRenderingContext(aRenderingContext)
, mWritingMode(aFrame->GetWritingMode()) , mWritingMode(aFrame->GetWritingMode())
{ {
} }
SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext, SizeComputationInput(nsIFrame *aFrame, gfxContext *aRenderingContext,
mozilla::WritingMode aContainingBlockWritingMode, mozilla::WritingMode aContainingBlockWritingMode,
nscoord aContainingBlockISize); nscoord aContainingBlockISize);
@ -685,7 +685,7 @@ public:
*/ */
ReflowInput(nsPresContext* aPresContext, ReflowInput(nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const mozilla::LogicalSize& aAvailableSpace, const mozilla::LogicalSize& aAvailableSpace,
uint32_t aFlags = 0); uint32_t aFlags = 0);

View File

@ -8,6 +8,7 @@
#include <algorithm> #include <algorithm>
// Please maintain alphabetical order below // Please maintain alphabetical order below
#include "gfxContext.h"
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "nsCaret.h" #include "nsCaret.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
@ -18,7 +19,6 @@
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRect.h" #include "nsRect.h"
#include "nsRenderingContext.h"
#include "nsTextFrame.h" #include "nsTextFrame.h"
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "mozilla/ArrayUtils.h" #include "mozilla/ArrayUtils.h"
@ -199,12 +199,12 @@ public:
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual uint32_t GetPerFrameKey() override { virtual uint32_t GetPerFrameKey() override {
return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey();
} }
void PaintTextToContext(nsRenderingContext* aCtx, void PaintTextToContext(gfxContext* aCtx,
nsPoint aOffsetFromRect); nsPoint aOffsetFromRect);
NS_DISPLAY_DECL_NAME("TextOverflow", TYPE_TEXT_OVERFLOW) NS_DISPLAY_DECL_NAME("TextOverflow", TYPE_TEXT_OVERFLOW)
private: private:
@ -215,7 +215,7 @@ private:
}; };
static void static void
PaintTextShadowCallback(nsRenderingContext* aCtx, PaintTextShadowCallback(gfxContext* aCtx,
nsPoint aShadowOffset, nsPoint aShadowOffset,
const nscolor& aShadowColor, const nscolor& aShadowColor,
void* aData) void* aData)
@ -226,7 +226,7 @@ PaintTextShadowCallback(nsRenderingContext* aCtx,
void void
nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder, nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nscolor foregroundColor = nsLayoutUtils:: nscolor foregroundColor = nsLayoutUtils::
GetColor(mFrame, &nsStyleText::mWebkitTextFillColor); GetColor(mFrame, &nsStyleText::mWebkitTextFillColor);
@ -235,12 +235,12 @@ nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
nsLayoutUtils::PaintTextShadow(mFrame, aCtx, mRect, mVisibleRect, nsLayoutUtils::PaintTextShadow(mFrame, aCtx, mRect, mVisibleRect,
foregroundColor, PaintTextShadowCallback, foregroundColor, PaintTextShadowCallback,
(void*)this); (void*)this);
aCtx->ThebesContext()->SetColor(gfx::Color::FromABGR(foregroundColor)); aCtx->SetColor(gfx::Color::FromABGR(foregroundColor));
PaintTextToContext(aCtx, nsPoint(0, 0)); PaintTextToContext(aCtx, nsPoint(0, 0));
} }
void void
nsDisplayTextOverflowMarker::PaintTextToContext(nsRenderingContext* aCtx, nsDisplayTextOverflowMarker::PaintTextToContext(gfxContext* aCtx,
nsPoint aOffsetFromRect) nsPoint aOffsetFromRect)
{ {
WritingMode wm = mFrame->GetWritingMode(); WritingMode wm = mFrame->GetWritingMode();
@ -248,14 +248,14 @@ nsDisplayTextOverflowMarker::PaintTextToContext(nsRenderingContext* aCtx,
if (wm.IsVertical()) { if (wm.IsVertical()) {
if (wm.IsVerticalLR()) { if (wm.IsVerticalLR()) {
pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX( pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX(
mFrame, aCtx->ThebesContext(), pt.x, mAscent)); mFrame, aCtx, pt.x, mAscent));
} else { } else {
pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX( pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX(
mFrame, aCtx->ThebesContext(), pt.x + mRect.width, -mAscent)); mFrame, aCtx, pt.x + mRect.width, -mAscent));
} }
} else { } else {
pt.y = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineY( pt.y = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineY(
mFrame, aCtx->ThebesContext(), pt.y, mAscent)); mFrame, aCtx, pt.y, mAscent));
} }
pt += aOffsetFromRect; pt += aOffsetFromRect;
@ -266,7 +266,7 @@ nsDisplayTextOverflowMarker::PaintTextToContext(nsRenderingContext* aCtx,
"Ellipsis textruns should always be LTR!"); "Ellipsis textruns should always be LTR!");
gfxPoint gfxPt(pt.x, pt.y); gfxPoint gfxPt(pt.x, pt.y);
textRun->Draw(gfxTextRun::Range(textRun), gfxPt, textRun->Draw(gfxTextRun::Range(textRun), gfxPt,
gfxTextRun::DrawParams(aCtx->ThebesContext())); gfxTextRun::DrawParams(aCtx));
} }
} else { } else {
RefPtr<nsFontMetrics> fm = RefPtr<nsFontMetrics> fm =
@ -852,12 +852,12 @@ TextOverflow::Marker::SetupString(nsIFrame* aFrame)
mISize = 0; mISize = 0;
} }
} else { } else {
nsRenderingContext rc( RefPtr<gfxContext> rc =
aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext()); aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
RefPtr<nsFontMetrics> fm = RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(aFrame); nsLayoutUtils::GetInflatedFontMetricsForFrame(aFrame);
mISize = nsLayoutUtils::AppUnitWidthOfStringBidi(mStyle->mString, aFrame, mISize = nsLayoutUtils::AppUnitWidthOfStringBidi(mStyle->mString, aFrame,
*fm, rc); *fm, *rc);
} }
mIntrinsicISize = mISize; mIntrinsicISize = mISize;
mInitialized = true; mInitialized = true;

View File

@ -211,7 +211,7 @@ ViewportFrame::RemoveFrame(ChildListID aListID,
#endif #endif
/* virtual */ nscoord /* virtual */ nscoord
ViewportFrame::GetMinISize(nsRenderingContext *aRenderingContext) ViewportFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -224,7 +224,7 @@ ViewportFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
ViewportFrame::GetPrefISize(nsRenderingContext *aRenderingContext) ViewportFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -55,8 +55,8 @@ public:
void BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder, void BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList); nsDisplayList* aList);
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,

View File

@ -50,7 +50,7 @@ nsBackdropFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
/* virtual */ LogicalSize /* virtual */ LogicalSize
nsBackdropFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsBackdropFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -29,7 +29,7 @@ public:
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override; const nsDisplayListSet& aLists) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -11,6 +11,8 @@
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "gfxContext.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
@ -47,7 +49,6 @@
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsCSSAnonBoxes.h" #include "nsCSSAnonBoxes.h"
#include "nsCSSFrameConstructor.h" #include "nsCSSFrameConstructor.h"
#include "nsRenderingContext.h"
#include "TextOverflow.h" #include "TextOverflow.h"
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "CounterStyleManager.h" #include "CounterStyleManager.h"
@ -695,7 +696,7 @@ nsBlockFrame::CheckIntrinsicCacheAgainstShrinkWrapState()
} }
/* virtual */ nscoord /* virtual */ nscoord
nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsBlockFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nsIFrame* firstInFlow = FirstContinuation(); nsIFrame* firstInFlow = FirstContinuation();
if (firstInFlow != this) if (firstInFlow != this)
@ -783,7 +784,7 @@ nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsBlockFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsBlockFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nsIFrame* firstInFlow = FirstContinuation(); nsIFrame* firstInFlow = FirstContinuation();
if (firstInFlow != this) if (firstInFlow != this)
@ -893,7 +894,7 @@ nsBlockFrame::ComputeTightBounds(DrawTarget* aDrawTarget) const
} }
/* virtual */ nsresult /* virtual */ nsresult
nsBlockFrame::GetPrefWidthTightBounds(nsRenderingContext* aRenderingContext, nsBlockFrame::GetPrefWidthTightBounds(gfxContext* aRenderingContext,
nscoord* aX, nscoord* aX,
nscoord* aXMost) nscoord* aXMost)
{ {

View File

@ -274,12 +274,12 @@ public:
private: private:
void CheckIntrinsicCacheAgainstShrinkWrapState(); void CheckIntrinsicCacheAgainstShrinkWrapState();
public: public:
nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; nscoord GetMinISize(gfxContext *aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; nscoord GetPrefISize(gfxContext *aRenderingContext) override;
nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override; nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
nsresult GetPrefWidthTightBounds(nsRenderingContext* aContext, nsresult GetPrefWidthTightBounds(gfxContext* aContext,
nscoord* aX, nscoord* aX,
nscoord* aXMost) override; nscoord* aXMost) override;

View File

@ -8,6 +8,7 @@
#include "nsBulletFrame.h" #include "nsBulletFrame.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
@ -26,7 +27,6 @@
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsRenderingContext.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsCounterManager.h" #include "nsCounterManager.h"
#include "nsBidiUtils.h" #include "nsBidiUtils.h"
@ -230,7 +230,7 @@ public:
layers::WebRenderDisplayItemLayer* aLayer); layers::WebRenderDisplayItemLayer* aLayer);
DrawResult DrawResult
Paint(nsRenderingContext& aRenderingContext, nsPoint aPt, Paint(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA, nsIFrame* aFrame); bool aDisableSubpixelAA, nsIFrame* aFrame);
@ -333,13 +333,13 @@ BulletRenderer::CreateWebRenderCommands(nsDisplayItem* aItem,
} }
DrawResult DrawResult
BulletRenderer::Paint(nsRenderingContext& aRenderingContext, nsPoint aPt, BulletRenderer::Paint(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA, nsIFrame* aFrame) bool aDisableSubpixelAA, nsIFrame* aFrame)
{ {
if (IsImageType()) { if (IsImageType()) {
SamplingFilter filter = nsLayoutUtils::GetSamplingFilterForFrame(aFrame); SamplingFilter filter = nsLayoutUtils::GetSamplingFilterForFrame(aFrame);
return nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(), return nsLayoutUtils::DrawSingleImage(aRenderingContext,
aFrame->PresContext(), mImage, filter, aFrame->PresContext(), mImage, filter,
mDest, aDirtyRect, mDest, aDirtyRect,
/* no SVGImageContext */ Nothing(), /* no SVGImageContext */ Nothing(),
@ -370,8 +370,7 @@ BulletRenderer::Paint(nsRenderingContext& aRenderingContext, nsPoint aPt,
DrawTargetAutoDisableSubpixelAntialiasing DrawTargetAutoDisableSubpixelAntialiasing
disable(drawTarget, aDisableSubpixelAA); disable(drawTarget, aDisableSubpixelAA);
aRenderingContext.ThebesContext()->SetColor( aRenderingContext.SetColor(Color::FromABGR(mColor));
Color::FromABGR(mColor));
nsPresContext* presContext = aFrame->PresContext(); nsPresContext* presContext = aFrame->PresContext();
if (!presContext->BidiEnabled() && HasRTLChars(mText)) { if (!presContext->BidiEnabled() && HasRTLChars(mText)) {
@ -392,13 +391,12 @@ BulletRenderer::BuildGlyphForText(nsDisplayItem* aItem, bool disableSubpixelAA)
RefPtr<DrawTargetCapture> capture = RefPtr<DrawTargetCapture> capture =
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreateCaptureDT(IntSize()); gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreateCaptureDT(IntSize());
RefPtr<gfxContext> captureCtx = gfxContext::CreateOrNull(capture); RefPtr<gfxContext> captureCtx = gfxContext::CreateOrNull(capture);
nsRenderingContext ctx(captureCtx);
{ {
DrawTargetAutoDisableSubpixelAntialiasing DrawTargetAutoDisableSubpixelAntialiasing
disable(capture, disableSubpixelAA); disable(capture, disableSubpixelAA);
ctx.ThebesContext()->SetColor( captureCtx->SetColor(
Color::FromABGR(mColor)); Color::FromABGR(mColor));
nsPresContext* presContext = aItem->Frame()->PresContext(); nsPresContext* presContext = aItem->Frame()->PresContext();
@ -406,7 +404,7 @@ BulletRenderer::BuildGlyphForText(nsDisplayItem* aItem, bool disableSubpixelAA)
presContext->SetBidiEnabled(); presContext->SetBidiEnabled();
} }
nsLayoutUtils::DrawString(aItem->Frame(), *mFontMetrics, &ctx, nsLayoutUtils::DrawString(aItem->Frame(), *mFontMetrics, captureCtx,
mText.get(), mText.Length(), mPoint); mText.get(), mText.Length(), mPoint);
} }
@ -553,7 +551,7 @@ public:
aOutFrames->AppendElement(mFrame); aOutFrames->AppendElement(mFrame);
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("Bullet", TYPE_BULLET) NS_DISPLAY_DECL_NAME("Bullet", TYPE_BULLET)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) override virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) override
@ -610,10 +608,9 @@ nsDisplayBullet::GetLayerState(nsDisplayListBuilder* aBuilder,
RefPtr<gfxContext> screenRefCtx = RefPtr<gfxContext> screenRefCtx =
gfxContext::CreateOrNull(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()); gfxContext::CreateOrNull(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget());
nsRenderingContext ctx(screenRefCtx);
Maybe<BulletRenderer> br = static_cast<nsBulletFrame*>(mFrame)-> Maybe<BulletRenderer> br = static_cast<nsBulletFrame*>(mFrame)->
CreateBulletRenderer(ctx, ToReferenceFrame()); CreateBulletRenderer(*screenRefCtx, ToReferenceFrame());
if (!br) { if (!br) {
return LAYER_NONE; return LAYER_NONE;
@ -664,7 +661,7 @@ nsDisplayBullet::CreateWebRenderCommands(wr::DisplayListBuilder& aBuilder,
} }
void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
uint32_t flags = imgIContainer::FLAG_NONE; uint32_t flags = imgIContainer::FLAG_NONE;
if (aBuilder->ShouldSyncDecodeImages()) { if (aBuilder->ShouldSyncDecodeImages()) {
@ -693,7 +690,7 @@ nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
Maybe<BulletRenderer> Maybe<BulletRenderer>
nsBulletFrame::CreateBulletRenderer(nsRenderingContext& aRenderingContext, nsPoint aPt) nsBulletFrame::CreateBulletRenderer(gfxContext& aRenderingContext, nsPoint aPt)
{ {
const nsStyleList* myList = StyleList(); const nsStyleList* myList = StyleList();
CounterStyle* listStyleType = myList->mCounterStyle; CounterStyle* listStyleType = myList->mCounterStyle;
@ -829,19 +826,18 @@ nsBulletFrame::CreateBulletRenderer(nsRenderingContext& aRenderingContext, nsPoi
nscoord ascent = wm.IsLineInverted() nscoord ascent = wm.IsLineInverted()
? fm->MaxDescent() : fm->MaxAscent(); ? fm->MaxDescent() : fm->MaxAscent();
aPt.MoveBy(padding.left, padding.top); aPt.MoveBy(padding.left, padding.top);
gfxContext *ctx = aRenderingContext.ThebesContext();
if (wm.IsVertical()) { if (wm.IsVertical()) {
if (wm.IsVerticalLR()) { if (wm.IsVerticalLR()) {
aPt.x = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineX( aPt.x = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineX(
this, ctx, aPt.x, ascent)); this, &aRenderingContext, aPt.x, ascent));
} else { } else {
aPt.x = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineX( aPt.x = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineX(
this, ctx, aPt.x + mRect.width, this, &aRenderingContext, aPt.x + mRect.width,
-ascent)); -ascent));
} }
} else { } else {
aPt.y = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineY( aPt.y = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineY(
this, ctx, aPt.y, ascent)); this, &aRenderingContext, aPt.y, ascent));
} }
BulletRenderer br(text, fm, color, aPt, listStyleType->GetStyle()); BulletRenderer br(text, fm, color, aPt, listStyleType->GetStyle());
@ -854,7 +850,7 @@ nsBulletFrame::CreateBulletRenderer(nsRenderingContext& aRenderingContext, nsPoi
} }
DrawResult DrawResult
nsBulletFrame::PaintBullet(nsRenderingContext& aRenderingContext, nsPoint aPt, nsBulletFrame::PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA) bool aDisableSubpixelAA)
{ {
@ -944,7 +940,7 @@ nsBulletFrame::AppendSpacingToPadding(nsFontMetrics* aFontMetrics,
void void
nsBulletFrame::GetDesiredSize(nsPresContext* aCX, nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
nsRenderingContext *aRenderingContext, gfxContext *aRenderingContext,
ReflowOutput& aMetrics, ReflowOutput& aMetrics,
float aFontSizeInflation, float aFontSizeInflation,
LogicalMargin* aPadding) LogicalMargin* aPadding)
@ -1080,7 +1076,7 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext,
} }
/* virtual */ nscoord /* virtual */ nscoord
nsBulletFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsBulletFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
WritingMode wm = GetWritingMode(); WritingMode wm = GetWritingMode();
ReflowOutput reflowOutput(wm); ReflowOutput reflowOutput(wm);
@ -1092,7 +1088,7 @@ nsBulletFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsBulletFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsBulletFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
WritingMode wm = GetWritingMode(); WritingMode wm = GetWritingMode();
ReflowOutput metrics(wm); ReflowOutput metrics(wm);
@ -1118,7 +1114,7 @@ IsIgnoreable(const nsIFrame* aFrame, nscoord aISize)
} }
/* virtual */ void /* virtual */ void
nsBulletFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext, nsBulletFrame::AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) nsIFrame::InlineMinISizeData* aData)
{ {
nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
@ -1129,7 +1125,7 @@ nsBulletFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext,
} }
/* virtual */ void /* virtual */ void
nsBulletFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext, nsBulletFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) nsIFrame::InlinePrefISizeData* aData)
{ {
nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,

View File

@ -81,11 +81,11 @@ public:
ReflowOutput& aMetrics, ReflowOutput& aMetrics,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override; nsReflowStatus& aStatus) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
void AddInlineMinISize(nsRenderingContext* aRenderingContext, void AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) override; nsIFrame::InlineMinISizeData* aData) override;
void AddInlinePrefISize(nsRenderingContext* aRenderingContext, void AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) override; nsIFrame::InlinePrefISizeData* aData) override;
// nsBulletFrame // nsBulletFrame
@ -98,8 +98,8 @@ public:
void GetSpokenText(nsAString& aText); void GetSpokenText(nsAString& aText);
Maybe<BulletRenderer> Maybe<BulletRenderer>
CreateBulletRenderer(nsRenderingContext& aRenderingContext, nsPoint aPt); CreateBulletRenderer(gfxContext& aRenderingContext, nsPoint aPt);
DrawResult PaintBullet(nsRenderingContext& aRenderingContext, nsPoint aPt, DrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA); bool aDisableSubpixelAA);
@ -123,7 +123,7 @@ protected:
void AppendSpacingToPadding(nsFontMetrics* aFontMetrics, void AppendSpacingToPadding(nsFontMetrics* aFontMetrics,
mozilla::LogicalMargin* aPadding); mozilla::LogicalMargin* aPadding);
void GetDesiredSize(nsPresContext* aPresContext, void GetDesiredSize(nsPresContext* aPresContext,
nsRenderingContext *aRenderingContext, gfxContext *aRenderingContext,
ReflowOutput& aMetrics, ReflowOutput& aMetrics,
float aFontSizeInflation, float aFontSizeInflation,
mozilla::LogicalMargin* aPadding); mozilla::LogicalMargin* aPadding);

View File

@ -8,12 +8,12 @@
#include "nsCanvasFrame.h" #include "nsCanvasFrame.h"
#include "AccessibleCaretEventHub.h" #include "AccessibleCaretEventHub.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "nsContainerFrame.h" #include "nsContainerFrame.h"
#include "nsCSSRendering.h" #include "nsCSSRendering.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "nsRenderingContext.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
@ -253,7 +253,7 @@ nsRect nsCanvasFrame::CanvasArea() const
void void
nsDisplayCanvasBackgroundColor::Paint(nsDisplayListBuilder* aBuilder, nsDisplayCanvasBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame); nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
nsPoint offset = ToReferenceFrame(); nsPoint offset = ToReferenceFrame();
@ -347,14 +347,14 @@ static void BlitSurface(DrawTarget* aDest, const gfxRect& aRect, DrawTarget* aSo
void void
nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder, nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame); nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
nsPoint offset = ToReferenceFrame(); nsPoint offset = ToReferenceFrame();
nsRect bgClipRect = frame->CanvasArea() + offset; nsRect bgClipRect = frame->CanvasArea() + offset;
#ifndef MOZ_GFX_OPTIMIZE_MOBILE #ifndef MOZ_GFX_OPTIMIZE_MOBILE
RefPtr<gfxContext> dest = aCtx->ThebesContext(); RefPtr<gfxContext> dest = aCtx;
gfxRect destRect; gfxRect destRect;
if (IsSingleFixedPositionImage(aBuilder, bgClipRect, &destRect) && if (IsSingleFixedPositionImage(aBuilder, bgClipRect, &destRect) &&
aBuilder->IsPaintingToWindow() && !aBuilder->IsCompositingCheap() && aBuilder->IsPaintingToWindow() && !aBuilder->IsCompositingCheap() &&
@ -378,8 +378,7 @@ nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(dt); RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(dt);
MOZ_ASSERT(ctx); // already checked draw target above MOZ_ASSERT(ctx); // already checked draw target above
ctx->SetMatrix(ctx->CurrentMatrix().Translate(-destRect.x, -destRect.y)); ctx->SetMatrix(ctx->CurrentMatrix().Translate(-destRect.x, -destRect.y));
nsRenderingContext context(ctx); PaintInternal(aBuilder, ctx, bgClipRect, &bgClipRect);
PaintInternal(aBuilder, &context, bgClipRect, &bgClipRect);
BlitSurface(dest->GetDrawTarget(), destRect, dt); BlitSurface(dest->GetDrawTarget(), destRect, dt);
frame->SetProperty(nsIFrame::CachedBackgroundImageDT(), frame->SetProperty(nsIFrame::CachedBackgroundImageDT(),
dt.forget().take()); dt.forget().take());
@ -428,7 +427,7 @@ nsDisplayCanvasBackgroundImage::IsSingleFixedPositionImage(nsDisplayListBuilder*
void void
nsDisplayCanvasThemedBackground::Paint(nsDisplayListBuilder* aBuilder, nsDisplayCanvasThemedBackground::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame); nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
nsPoint offset = ToReferenceFrame(); nsPoint offset = ToReferenceFrame();
@ -463,7 +462,7 @@ public:
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override gfxContext* aCtx) override
{ {
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame); nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
frame->PaintFocus(aCtx->GetDrawTarget(), ToReferenceFrame()); frame->PaintFocus(aCtx->GetDrawTarget(), ToReferenceFrame());
@ -645,7 +644,7 @@ nsCanvasFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsCanvasFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsCanvasFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -657,7 +656,7 @@ nsCanvasFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsCanvasFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsCanvasFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -17,7 +17,7 @@
#include "gfxPrefs.h" #include "gfxPrefs.h"
class nsPresContext; class nsPresContext;
class nsRenderingContext; class gfxContext;
/** /**
* Root frame class. * Root frame class.
@ -57,8 +57,8 @@ public:
nsIFrame* aOldFrame) override; nsIFrame* aOldFrame) override;
#endif #endif
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
@ -174,7 +174,7 @@ public:
return mozilla::LAYER_NONE; return mozilla::LAYER_NONE;
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
void SetExtraBackgroundColor(nscolor aColor) void SetExtraBackgroundColor(nscolor aColor)
{ {
@ -194,7 +194,7 @@ public:
{ {
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override; virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
virtual void NotifyRenderingChanged() override virtual void NotifyRenderingChanged() override
{ {
@ -220,7 +220,7 @@ public:
aFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(aFrame)) aFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(aFrame))
{} {}
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override; virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("CanvasThemedBackground", TYPE_CANVAS_THEMED_BACKGROUND) NS_DISPLAY_DECL_NAME("CanvasThemedBackground", TYPE_CANVAS_THEMED_BACKGROUND)
}; };

View File

@ -48,7 +48,7 @@ public:
nsTArray<WebRenderParentCommand>& aParentCommands, nsTArray<WebRenderParentCommand>& aParentCommands,
mozilla::layers::WebRenderDisplayItemLayer* aLayer) override; mozilla::layers::WebRenderDisplayItemLayer* aLayer) override;
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("ColumnRule", nsDisplayItem::TYPE_COLUMN_RULE); NS_DISPLAY_DECL_NAME("ColumnRule", nsDisplayItem::TYPE_COLUMN_RULE);
@ -58,7 +58,7 @@ private:
void void
nsDisplayColumnRule::Paint(nsDisplayListBuilder* aBuilder, nsDisplayColumnRule::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
static_cast<nsColumnSetFrame*>(mFrame)-> static_cast<nsColumnSetFrame*>(mFrame)->
CreateBorderRenderers(mBorderRenderers, aCtx, mVisibleRect, ToReferenceFrame()); CreateBorderRenderers(mBorderRenderers, aCtx, mVisibleRect, ToReferenceFrame());
@ -78,10 +78,9 @@ nsDisplayColumnRule::GetLayerState(nsDisplayListBuilder* aBuilder,
RefPtr<gfxContext> screenRefCtx = RefPtr<gfxContext> screenRefCtx =
gfxContext::CreateOrNull(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()); gfxContext::CreateOrNull(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget());
nsRenderingContext ctx(screenRefCtx);
static_cast<nsColumnSetFrame*>(mFrame)-> static_cast<nsColumnSetFrame*>(mFrame)->
CreateBorderRenderers(mBorderRenderers, &ctx, mVisibleRect, ToReferenceFrame()); CreateBorderRenderers(mBorderRenderers, screenRefCtx, mVisibleRect, ToReferenceFrame());
if (mBorderRenderers.IsEmpty()) { if (mBorderRenderers.IsEmpty()) {
return LAYER_NONE; return LAYER_NONE;
@ -211,7 +210,7 @@ nsColumnSetFrame::CalculateBounds(const nsPoint& aOffset)
void void
nsColumnSetFrame::CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers, nsColumnSetFrame::CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers,
nsRenderingContext* aCtx, gfxContext* aCtx,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsPoint& aPt) const nsPoint& aPt)
{ {
@ -504,7 +503,7 @@ static void MoveChildTo(nsIFrame* aChild, LogicalPoint aOrigin,
} }
nscoord nscoord
nsColumnSetFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsColumnSetFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord iSize = 0; nscoord iSize = 0;
DISPLAY_MIN_WIDTH(this, iSize); DISPLAY_MIN_WIDTH(this, iSize);
@ -539,7 +538,7 @@ nsColumnSetFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
nscoord nscoord
nsColumnSetFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsColumnSetFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
// Our preferred width is our desired column width, if specified, otherwise // Our preferred width is our desired column width, if specified, otherwise
// the child's preferred width, times the number of columns, plus the width // the child's preferred width, times the number of columns, plus the width

View File

@ -41,8 +41,8 @@ public:
nsIFrame* aOldFrame) override; nsIFrame* aOldFrame) override;
#endif #endif
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
/** /**
* Retrieve the available height for content of this frame. The available content * Retrieve the available height for content of this frame. The available content
@ -92,7 +92,7 @@ public:
nsRect CalculateBounds(const nsPoint& aOffset); nsRect CalculateBounds(const nsPoint& aOffset);
void CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers, void CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers,
nsRenderingContext* aCtx, gfxContext* aCtx,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsPoint& aPt); const nsPoint& aPt);

View File

@ -588,7 +588,7 @@ void
nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext, nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsView* aView, nsView* aView,
nsRenderingContext* aRC, gfxContext* aRC,
uint32_t aFlags) uint32_t aFlags)
{ {
#ifdef MOZ_XUL #ifdef MOZ_XUL
@ -727,7 +727,7 @@ static nscoord GetCoord(const nsStyleCoord& aCoord, nscoord aIfNotCoord)
} }
void void
nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext, nsContainerFrame::DoInlineIntrinsicISize(gfxContext *aRenderingContext,
InlineIntrinsicISizeData *aData, InlineIntrinsicISizeData *aData,
nsLayoutUtils::IntrinsicISizeType aType) nsLayoutUtils::IntrinsicISizeType aType)
{ {
@ -824,7 +824,7 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsContainerFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsContainerFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -184,7 +184,7 @@ public:
static void SyncWindowProperties(nsPresContext* aPresContext, static void SyncWindowProperties(nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsView* aView, nsView* aView,
nsRenderingContext* aRC, gfxContext* aRC,
uint32_t aFlags); uint32_t aFlags);
/** /**
@ -202,7 +202,7 @@ public:
const nsSize& aMaxSize); const nsSize& aMaxSize);
// Used by both nsInlineFrame and nsFirstLetterFrame. // Used by both nsInlineFrame and nsFirstLetterFrame.
void DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext, void DoInlineIntrinsicISize(gfxContext *aRenderingContext,
InlineIntrinsicISizeData *aData, InlineIntrinsicISizeData *aData,
nsLayoutUtils::IntrinsicISizeType aType); nsLayoutUtils::IntrinsicISizeType aType);
@ -211,7 +211,7 @@ public:
* classes derived from nsContainerFrame want. * classes derived from nsContainerFrame want.
*/ */
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -105,7 +105,7 @@ nsFirstLetterFrame::GetChildFrameContainingOffset(int32_t inContentOffset,
// Needed for non-floating first-letter frames and for the continuations // Needed for non-floating first-letter frames and for the continuations
// following the first-letter that we also use nsFirstLetterFrame for. // following the first-letter that we also use nsFirstLetterFrame for.
/* virtual */ void /* virtual */ void
nsFirstLetterFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext, nsFirstLetterFrame::AddInlineMinISize(gfxContext *aRenderingContext,
nsIFrame::InlineMinISizeData *aData) nsIFrame::InlineMinISizeData *aData)
{ {
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE); DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE);
@ -114,7 +114,7 @@ nsFirstLetterFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
// Needed for non-floating first-letter frames and for the continuations // Needed for non-floating first-letter frames and for the continuations
// following the first-letter that we also use nsFirstLetterFrame for. // following the first-letter that we also use nsFirstLetterFrame for.
/* virtual */ void /* virtual */ void
nsFirstLetterFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext, nsFirstLetterFrame::AddInlinePrefISize(gfxContext *aRenderingContext,
nsIFrame::InlinePrefISizeData *aData) nsIFrame::InlinePrefISizeData *aData)
{ {
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE); DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE);
@ -123,21 +123,21 @@ nsFirstLetterFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
// Needed for floating first-letter frames. // Needed for floating first-letter frames.
/* virtual */ nscoord /* virtual */ nscoord
nsFirstLetterFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsFirstLetterFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
return nsLayoutUtils::MinISizeFromInline(this, aRenderingContext); return nsLayoutUtils::MinISizeFromInline(this, aRenderingContext);
} }
// Needed for floating first-letter frames. // Needed for floating first-letter frames.
/* virtual */ nscoord /* virtual */ nscoord
nsFirstLetterFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsFirstLetterFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
return nsLayoutUtils::PrefISizeFromInline(this, aRenderingContext); return nsLayoutUtils::PrefISizeFromInline(this, aRenderingContext);
} }
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsFirstLetterFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsFirstLetterFrame::ComputeSize(gfxContext *aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -43,15 +43,15 @@ public:
~(nsIFrame::eBidiInlineContainer)); ~(nsIFrame::eBidiInlineContainer));
} }
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -15,11 +15,11 @@
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsPlaceholderFrame.h" #include "nsPlaceholderFrame.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "mozilla/CSSOrderAwareFrameIterator.h" #include "mozilla/CSSOrderAwareFrameIterator.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include <algorithm> #include <algorithm>
#include "gfxContext.h"
#include "mozilla/LinkedList.h" #include "mozilla/LinkedList.h"
#include "mozilla/FloatingPoint.h" #include "mozilla/FloatingPoint.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
@ -4631,7 +4631,7 @@ nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
} }
/* virtual */ nscoord /* virtual */ nscoord
nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext) nsFlexContainerFrame::GetMinISize(gfxContext* aRenderingContext)
{ {
nscoord minISize = 0; nscoord minISize = 0;
DISPLAY_MIN_WIDTH(this, minISize); DISPLAY_MIN_WIDTH(this, minISize);
@ -4661,7 +4661,7 @@ nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsFlexContainerFrame::GetPrefISize(nsRenderingContext* aRenderingContext) nsFlexContainerFrame::GetPrefISize(gfxContext* aRenderingContext)
{ {
nscoord prefISize = 0; nscoord prefISize = 0;
DISPLAY_PREF_WIDTH(this, prefISize); DISPLAY_PREF_WIDTH(this, prefISize);

View File

@ -74,8 +74,8 @@ public:
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override; nsReflowStatus& aStatus) override;
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; nscoord GetMinISize(gfxContext* aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; nscoord GetPrefISize(gfxContext* aRenderingContext) override;
#ifdef DEBUG_FRAME_DUMP #ifdef DEBUG_FRAME_DUMP
nsresult GetFrameName(nsAString& aResult) const override; nsresult GetFrameName(nsAString& aResult) const override;

View File

@ -82,7 +82,6 @@
#include "SVGTextFrame.h" #include "SVGTextFrame.h"
#include "gfxContext.h" #include "gfxContext.h"
#include "nsRenderingContext.h"
#include "nsAbsoluteContainingBlock.h" #include "nsAbsoluteContainingBlock.h"
#include "StickyScrollContainer.h" #include "StickyScrollContainer.h"
#include "nsFontInflationData.h" #include "nsFontInflationData.h"
@ -1957,14 +1956,14 @@ public:
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("SelectionOverlay", TYPE_SELECTION_OVERLAY) NS_DISPLAY_DECL_NAME("SelectionOverlay", TYPE_SELECTION_OVERLAY)
private: private:
int16_t mSelectionValue; int16_t mSelectionValue;
}; };
void nsDisplaySelectionOverlay::Paint(nsDisplayListBuilder* aBuilder, void nsDisplaySelectionOverlay::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
DrawTarget& aDrawTarget = *aCtx->GetDrawTarget(); DrawTarget& aDrawTarget = *aCtx->GetDrawTarget();
@ -4721,7 +4720,7 @@ nsFrame::MarkIntrinsicISizesDirty()
} }
/* virtual */ nscoord /* virtual */ nscoord
nsFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -4729,7 +4728,7 @@ nsFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);
@ -4737,7 +4736,7 @@ nsFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ void /* virtual */ void
nsFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext, nsFrame::AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) nsIFrame::InlineMinISizeData* aData)
{ {
nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
@ -4746,7 +4745,7 @@ nsFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext,
} }
/* virtual */ void /* virtual */ void
nsFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext, nsFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) nsIFrame::InlinePrefISizeData* aData)
{ {
nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
@ -5045,7 +5044,7 @@ nsFrame::GetIntrinsicRatio()
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsFrame::ComputeSize(nsRenderingContext* aRenderingContext, nsFrame::ComputeSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -5306,7 +5305,7 @@ nsFrame::ComputeSize(nsRenderingContext* aRenderingContext,
} }
LogicalSize LogicalSize
nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext* aRenderingContext, nsFrame::ComputeSizeWithIntrinsicDimensions(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const IntrinsicSize& aIntrinsicSize, const IntrinsicSize& aIntrinsicSize,
nsSize aIntrinsicRatio, nsSize aIntrinsicRatio,
@ -5756,7 +5755,7 @@ nsFrame::ComputeSimpleTightBounds(DrawTarget* aDrawTarget) const
} }
/* virtual */ nsresult /* virtual */ nsresult
nsIFrame::GetPrefWidthTightBounds(nsRenderingContext* aContext, nsIFrame::GetPrefWidthTightBounds(gfxContext* aContext,
nscoord* aX, nscoord* aX,
nscoord* aXMost) nscoord* aXMost)
{ {
@ -5765,7 +5764,7 @@ nsIFrame::GetPrefWidthTightBounds(nsRenderingContext* aContext,
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -5787,7 +5786,7 @@ nsFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsFrame::ShrinkWidthToFit(nsRenderingContext* aRenderingContext, nsFrame::ShrinkWidthToFit(gfxContext* aRenderingContext,
nscoord aISizeInCB, nscoord aISizeInCB,
ComputeSizeFlags aFlags) ComputeSizeFlags aFlags)
{ {
@ -5812,7 +5811,7 @@ nsFrame::ShrinkWidthToFit(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsIFrame::ComputeISizeValue(nsRenderingContext* aRenderingContext, nsIFrame::ComputeISizeValue(gfxContext* aRenderingContext,
nscoord aContainingBlockISize, nscoord aContainingBlockISize,
nscoord aContentEdgeToBoxSizing, nscoord aContentEdgeToBoxSizing,
nscoord aBoxSizingToMarginEdge, nscoord aBoxSizingToMarginEdge,
@ -9644,7 +9643,7 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
// line height. This can be done with the line iterator. // line height. This can be done with the line iterator.
// if we do have a rendering context // if we do have a rendering context
nsRenderingContext* rendContext = aState.GetRenderingContext(); gfxContext* rendContext = aState.GetRenderingContext();
if (rendContext) { if (rendContext) {
nsPresContext* presContext = aState.PresContext(); nsPresContext* presContext = aState.PresContext();
@ -9859,7 +9858,7 @@ nsFrame::DoXULLayout(nsBoxLayoutState& aState)
{ {
nsRect ourRect(mRect); nsRect ourRect(mRect);
nsRenderingContext* rendContext = aState.GetRenderingContext(); gfxContext* rendContext = aState.GetRenderingContext();
nsPresContext* presContext = aState.PresContext(); nsPresContext* presContext = aState.PresContext();
WritingMode ourWM = GetWritingMode(); WritingMode ourWM = GetWritingMode();
const WritingMode outerWM = aState.OuterReflowInput() ? const WritingMode outerWM = aState.OuterReflowInput() ?
@ -9940,7 +9939,7 @@ void
nsFrame::BoxReflow(nsBoxLayoutState& aState, nsFrame::BoxReflow(nsBoxLayoutState& aState,
nsPresContext* aPresContext, nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nscoord aX, nscoord aX,
nscoord aY, nscoord aY,
nscoord aWidth, nscoord aWidth,

View File

@ -265,18 +265,18 @@ public:
bool IsSelfEmpty() override; bool IsSelfEmpty() override;
void MarkIntrinsicISizesDirty() override; void MarkIntrinsicISizesDirty() override;
nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; nscoord GetMinISize(gfxContext *aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; nscoord GetPrefISize(gfxContext *aRenderingContext) override;
void AddInlineMinISize(nsRenderingContext *aRenderingContext, void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
void AddInlinePrefISize(nsRenderingContext *aRenderingContext, void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
IntrinsicISizeOffsetData IntrinsicISizeOffsets() override; IntrinsicISizeOffsetData IntrinsicISizeOffsets() override;
mozilla::IntrinsicSize GetIntrinsicSize() override; mozilla::IntrinsicSize GetIntrinsicSize() override;
nsSize GetIntrinsicRatio() override; nsSize GetIntrinsicRatio() override;
mozilla::LogicalSize mozilla::LogicalSize
ComputeSize(nsRenderingContext* aRenderingContext, ComputeSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -291,7 +291,7 @@ public:
*/ */
mozilla::LogicalSize mozilla::LogicalSize
ComputeSizeWithIntrinsicDimensions( ComputeSizeWithIntrinsicDimensions(
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::IntrinsicSize& aIntrinsicSize, const mozilla::IntrinsicSize& aIntrinsicSize,
nsSize aIntrinsicRatio, nsSize aIntrinsicRatio,
@ -321,7 +321,7 @@ public:
* to be unused. * to be unused.
*/ */
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -334,7 +334,7 @@ public:
* Utility function for ComputeAutoSize implementations. Return * Utility function for ComputeAutoSize implementations. Return
* max(GetMinISize(), min(aISizeInCB, GetPrefISize())) * max(GetMinISize(), min(aISizeInCB, GetPrefISize()))
*/ */
nscoord ShrinkWidthToFit(nsRenderingContext* aRenderingContext, nscoord ShrinkWidthToFit(gfxContext* aRenderingContext,
nscoord aISizeInCB, nscoord aISizeInCB,
ComputeSizeFlags aFlags); ComputeSizeFlags aFlags);
@ -712,7 +712,7 @@ private:
void BoxReflow(nsBoxLayoutState& aState, void BoxReflow(nsBoxLayoutState& aState,
nsPresContext* aPresContext, nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
nscoord aX, nscoord aX,
nscoord aY, nscoord aY,
nscoord aWidth, nscoord aWidth,

View File

@ -25,7 +25,6 @@
#include "nsStyleConsts.h" #include "nsStyleConsts.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "nsHTMLParts.h" #include "nsHTMLParts.h"
#include "nsRenderingContext.h"
#include "nsIDOMMutationEvent.h" #include "nsIDOMMutationEvent.h"
#include "nsNameSpaceManager.h" #include "nsNameSpaceManager.h"
#include "nsCSSAnonBoxes.h" #include "nsCSSAnonBoxes.h"
@ -1408,12 +1407,12 @@ public:
aOutFrames->AppendElement(mFrame); aOutFrames->AppendElement(mFrame);
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("FramesetBorder", TYPE_FRAMESET_BORDER) NS_DISPLAY_DECL_NAME("FramesetBorder", TYPE_FRAMESET_BORDER)
}; };
void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
static_cast<nsHTMLFramesetBorderFrame*>(mFrame)-> static_cast<nsHTMLFramesetBorderFrame*>(mFrame)->
PaintBorder(aCtx->GetDrawTarget(), ToReferenceFrame()); PaintBorder(aCtx->GetDrawTarget(), ToReferenceFrame());
@ -1616,12 +1615,12 @@ public:
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("FramesetBlank", TYPE_FRAMESET_BLANK) NS_DISPLAY_DECL_NAME("FramesetBlank", TYPE_FRAMESET_BLANK)
}; };
void nsDisplayFramesetBlank::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayFramesetBlank::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
DrawTarget* drawTarget = aCtx->GetDrawTarget(); DrawTarget* drawTarget = aCtx->GetDrawTarget();
int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel(); int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();

View File

@ -778,7 +778,7 @@ nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
} }
nscoord nscoord
nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext) nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(gfxContext *aRenderingContext)
{ {
ScrollbarStyles ss = GetScrollbarStyles(); ScrollbarStyles ss = GetScrollbarStyles();
if (ss.mVertical != NS_STYLE_OVERFLOW_SCROLL || !mHelper.mVScrollbarBox) if (ss.mVertical != NS_STYLE_OVERFLOW_SCROLL || !mHelper.mVScrollbarBox)
@ -794,7 +794,7 @@ nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingCon
} }
/* virtual */ nscoord /* virtual */ nscoord
nsHTMLScrollFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsHTMLScrollFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result = mHelper.mScrolledFrame->GetMinISize(aRenderingContext); nscoord result = mHelper.mScrolledFrame->GetMinISize(aRenderingContext);
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -802,7 +802,7 @@ nsHTMLScrollFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsHTMLScrollFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsHTMLScrollFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result = mHelper.mScrolledFrame->GetPrefISize(aRenderingContext); nscoord result = mHelper.mScrolledFrame->GetPrefISize(aRenderingContext);
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);

View File

@ -704,15 +704,15 @@ public:
const ReflowOutput& aDesiredSize); const ReflowOutput& aDesiredSize);
void PlaceScrollArea(ScrollReflowInput& aState, void PlaceScrollArea(ScrollReflowInput& aState,
const nsPoint& aScrollPosition); const nsPoint& aScrollPosition);
nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext); nscoord GetIntrinsicVScrollbarWidth(gfxContext *aRenderingContext);
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea, virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const override { Sides aSkipSides, nscoord aRadii[8]) const override {
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii); return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
} }
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual nsresult GetXULPadding(nsMargin& aPadding) override; virtual nsresult GetXULPadding(nsMargin& aPadding) override;
virtual bool IsXULCollapsed() override; virtual bool IsXULCollapsed() override;
@ -789,12 +789,12 @@ public:
return mHelper.GetDesiredScrollbarSizes(aState); return mHelper.GetDesiredScrollbarSizes(aState);
} }
virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext, virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext,
nsRenderingContext* aRC) override { gfxContext* aRC) override {
nsBoxLayoutState bls(aPresContext, aRC, 0); nsBoxLayoutState bls(aPresContext, aRC, 0);
return GetDesiredScrollbarSizes(&bls); return GetDesiredScrollbarSizes(&bls);
} }
virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext,
nsRenderingContext* aRC, mozilla::WritingMode aWM) override { gfxContext* aRC, mozilla::WritingMode aWM) override {
nsBoxLayoutState bls(aPresContext, aRC, 0); nsBoxLayoutState bls(aPresContext, aRC, 0);
return mHelper.GetNondisappearingScrollbarWidth(&bls, aWM); return mHelper.GetNondisappearingScrollbarWidth(&bls, aWM);
} }
@ -1126,7 +1126,7 @@ public:
// XXXldb Is this actually used? // XXXldb Is this actually used?
#if 0 #if 0
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
#endif #endif
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override { virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override {
@ -1230,12 +1230,12 @@ public:
return mHelper.GetDesiredScrollbarSizes(aState); return mHelper.GetDesiredScrollbarSizes(aState);
} }
virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext, virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext,
nsRenderingContext* aRC) override { gfxContext* aRC) override {
nsBoxLayoutState bls(aPresContext, aRC, 0); nsBoxLayoutState bls(aPresContext, aRC, 0);
return GetDesiredScrollbarSizes(&bls); return GetDesiredScrollbarSizes(&bls);
} }
virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext,
nsRenderingContext* aRC, mozilla::WritingMode aWM) override { gfxContext* aRC, mozilla::WritingMode aWM) override {
nsBoxLayoutState bls(aPresContext, aRC, 0); nsBoxLayoutState bls(aPresContext, aRC, 0);
return mHelper.GetNondisappearingScrollbarWidth(&bls, aWM); return mHelper.GetNondisappearingScrollbarWidth(&bls, aWM);
} }

View File

@ -11,6 +11,7 @@
#include <algorithm> // for std::stable_sort #include <algorithm> // for std::stable_sort
#include <functional> #include <functional>
#include <limits> #include <limits>
#include "gfxContext.h"
#include "mozilla/CSSAlignUtils.h" #include "mozilla/CSSAlignUtils.h"
#include "mozilla/CSSOrderAwareFrameIterator.h" #include "mozilla/CSSOrderAwareFrameIterator.h"
#include "mozilla/dom/GridBinding.h" #include "mozilla/dom/GridBinding.h"
@ -27,7 +28,6 @@
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "nsRenderingContext.h"
#include "nsRuleNode.h" #include "nsRuleNode.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "nsTableWrapperFrame.h" #include "nsTableWrapperFrame.h"
@ -1729,7 +1729,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowInput
aRI.GetWritingMode()) aRI.GetWritingMode())
{} {}
GridReflowInput(nsGridContainerFrame* aFrame, GridReflowInput(nsGridContainerFrame* aFrame,
nsRenderingContext& aRC) gfxContext& aRC)
: GridReflowInput(aFrame, aRC, nullptr, aFrame->StylePosition(), : GridReflowInput(aFrame, aRC, nullptr, aFrame->StylePosition(),
aFrame->GetWritingMode()) aFrame->GetWritingMode())
{} {}
@ -1896,7 +1896,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowInput
* min/max-content contributions when sizing tracks. * min/max-content contributions when sizing tracks.
*/ */
const ReflowInput* const mReflowInput; const ReflowInput* const mReflowInput;
nsRenderingContext& mRenderingContext; gfxContext& mRenderingContext;
nsGridContainerFrame* const mFrame; nsGridContainerFrame* const mFrame;
SharedGridData* mSharedGridData; // [weak] owned by mFrame's first-in-flow. SharedGridData* mSharedGridData; // [weak] owned by mFrame's first-in-flow.
/** Computed border+padding with mSkipSides applied. */ /** Computed border+padding with mSkipSides applied. */
@ -1922,7 +1922,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowInput
private: private:
GridReflowInput(nsGridContainerFrame* aFrame, GridReflowInput(nsGridContainerFrame* aFrame,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const ReflowInput* aReflowInput, const ReflowInput* aReflowInput,
const nsStylePosition* aGridStyle, const nsStylePosition* aGridStyle,
const WritingMode& aWM) const WritingMode& aWM)
@ -3446,7 +3446,7 @@ nsGridContainerFrame::Tracks::Initialize(
static nscoord static nscoord
MeasuringReflow(nsIFrame* aChild, MeasuringReflow(nsIFrame* aChild,
const ReflowInput* aReflowInput, const ReflowInput* aReflowInput,
nsRenderingContext* aRC, gfxContext* aRC,
const LogicalSize& aAvailableSize, const LogicalSize& aAvailableSize,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aIMinSizeClamp = NS_MAXSIZE, nscoord aIMinSizeClamp = NS_MAXSIZE,
@ -3515,7 +3515,7 @@ MeasuringReflow(nsIFrame* aChild,
static nscoord static nscoord
ContentContribution(const GridItemInfo& aGridItem, ContentContribution(const GridItemInfo& aGridItem,
const GridReflowInput& aState, const GridReflowInput& aState,
nsRenderingContext* aRC, gfxContext* aRC,
WritingMode aCBWM, WritingMode aCBWM,
LogicalAxis aAxis, LogicalAxis aAxis,
const Maybe<LogicalSize>& aPercentageBasis, const Maybe<LogicalSize>& aPercentageBasis,
@ -3612,7 +3612,7 @@ struct CachedIntrinsicSizes
static nscoord static nscoord
MinContentContribution(const GridItemInfo& aGridItem, MinContentContribution(const GridItemInfo& aGridItem,
const GridReflowInput& aState, const GridReflowInput& aState,
nsRenderingContext* aRC, gfxContext* aRC,
WritingMode aCBWM, WritingMode aCBWM,
LogicalAxis aAxis, LogicalAxis aAxis,
CachedIntrinsicSizes* aCache) CachedIntrinsicSizes* aCache)
@ -3634,7 +3634,7 @@ MinContentContribution(const GridItemInfo& aGridItem,
static nscoord static nscoord
MaxContentContribution(const GridItemInfo& aGridItem, MaxContentContribution(const GridItemInfo& aGridItem,
const GridReflowInput& aState, const GridReflowInput& aState,
nsRenderingContext* aRC, gfxContext* aRC,
WritingMode aCBWM, WritingMode aCBWM,
LogicalAxis aAxis, LogicalAxis aAxis,
CachedIntrinsicSizes* aCache) CachedIntrinsicSizes* aCache)
@ -3658,7 +3658,7 @@ MaxContentContribution(const GridItemInfo& aGridItem,
static nscoord static nscoord
MinSize(const GridItemInfo& aGridItem, MinSize(const GridItemInfo& aGridItem,
const GridReflowInput& aState, const GridReflowInput& aState,
nsRenderingContext* aRC, gfxContext* aRC,
WritingMode aCBWM, WritingMode aCBWM,
LogicalAxis aAxis, LogicalAxis aAxis,
CachedIntrinsicSizes* aCache) CachedIntrinsicSizes* aCache)
@ -3788,7 +3788,7 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSizeStep1(
aGridItem.mState[mAxis] |= ItemState::eClampMarginBoxMinSize; aGridItem.mState[mAxis] |= ItemState::eClampMarginBoxMinSize;
} }
// min sizing // min sizing
nsRenderingContext* rc = &aState.mRenderingContext; gfxContext* rc = &aState.mRenderingContext;
if (sz.mState & TrackSize::eAutoMinSizing) { if (sz.mState & TrackSize::eAutoMinSizing) {
nscoord s; nscoord s;
if (aConstraint == SizingConstraint::eMinContent) { if (aConstraint == SizingConstraint::eMinContent) {
@ -4167,7 +4167,7 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize(
AutoTArray<TrackSize::StateBits, 16> stateBitsPerSpan; AutoTArray<TrackSize::StateBits, 16> stateBitsPerSpan;
nsTArray<Step2ItemData> step2Items; nsTArray<Step2ItemData> step2Items;
CSSOrderAwareFrameIterator& iter = aState.mIter; CSSOrderAwareFrameIterator& iter = aState.mIter;
nsRenderingContext* rc = &aState.mRenderingContext; gfxContext* rc = &aState.mRenderingContext;
WritingMode wm = aState.mWM; WritingMode wm = aState.mWM;
uint32_t maxSpan = 0; // max span of the step2Items items uint32_t maxSpan = 0; // max span of the step2Items items
// Setup track selector for step 2.2: // Setup track selector for step 2.2:
@ -4509,7 +4509,7 @@ nsGridContainerFrame::Tracks::FindUsedFlexFraction(
fr = std::max(fr, possiblyDividedBaseSize); fr = std::max(fr, possiblyDividedBaseSize);
} }
WritingMode wm = aState.mWM; WritingMode wm = aState.mWM;
nsRenderingContext* rc = &aState.mRenderingContext; gfxContext* rc = &aState.mRenderingContext;
CSSOrderAwareFrameIterator& iter = aState.mIter; CSSOrderAwareFrameIterator& iter = aState.mIter;
iter.Reset(); iter.Reset();
// ... the result of 'finding the size of an fr' for each item that spans // ... the result of 'finding the size of an fr' for each item that spans
@ -6304,7 +6304,7 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
} }
nscoord nscoord
nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext, nsGridContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
IntrinsicISizeType aType) IntrinsicISizeType aType)
{ {
RenumberList(); RenumberList();
@ -6373,7 +6373,7 @@ nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext,
} }
nscoord nscoord
nsGridContainerFrame::GetMinISize(nsRenderingContext* aRC) nsGridContainerFrame::GetMinISize(gfxContext* aRC)
{ {
DISPLAY_MIN_WIDTH(this, mCachedMinISize); DISPLAY_MIN_WIDTH(this, mCachedMinISize);
if (mCachedMinISize == NS_INTRINSIC_WIDTH_UNKNOWN) { if (mCachedMinISize == NS_INTRINSIC_WIDTH_UNKNOWN) {
@ -6383,7 +6383,7 @@ nsGridContainerFrame::GetMinISize(nsRenderingContext* aRC)
} }
nscoord nscoord
nsGridContainerFrame::GetPrefISize(nsRenderingContext* aRC) nsGridContainerFrame::GetPrefISize(gfxContext* aRC)
{ {
DISPLAY_PREF_WIDTH(this, mCachedPrefISize); DISPLAY_PREF_WIDTH(this, mCachedPrefISize);
if (mCachedPrefISize == NS_INTRINSIC_WIDTH_UNKNOWN) { if (mCachedPrefISize == NS_INTRINSIC_WIDTH_UNKNOWN) {

View File

@ -94,8 +94,8 @@ public:
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override; nsReflowStatus& aStatus) override;
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override; nscoord GetMinISize(gfxContext* aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override; nscoord GetPrefISize(gfxContext* aRenderingContext) override;
void MarkIntrinsicISizesDirty() override; void MarkIntrinsicISizesDirty() override;
bool IsFrameOfType(uint32_t aFlags) const override bool IsFrameOfType(uint32_t aFlags) const override
{ {
@ -289,7 +289,7 @@ protected:
/** /**
* Helper for GetMinISize / GetPrefISize. * Helper for GetMinISize / GetPrefISize.
*/ */
nscoord IntrinsicISize(nsRenderingContext* aRenderingContext, nscoord IntrinsicISize(gfxContext* aRenderingContext,
IntrinsicISizeType aConstraint); IntrinsicISizeType aConstraint);
// Helper for AppendFrames / InsertFrames. // Helper for AppendFrames / InsertFrames.

View File

@ -182,7 +182,7 @@ nsHTMLCanvasFrame::GetCanvasSize()
} }
/* virtual */ nscoord /* virtual */ nscoord
nsHTMLCanvasFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsHTMLCanvasFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
// XXX The caller doesn't account for constraints of the height, // XXX The caller doesn't account for constraints of the height,
// min-height, and max-height properties. // min-height, and max-height properties.
@ -194,7 +194,7 @@ nsHTMLCanvasFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsHTMLCanvasFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsHTMLCanvasFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
// XXX The caller doesn't account for constraints of the height, // XXX The caller doesn't account for constraints of the height,
// min-height, and max-height properties. // min-height, and max-height properties.
@ -219,7 +219,7 @@ nsHTMLCanvasFrame::GetIntrinsicRatio()
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsHTMLCanvasFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsHTMLCanvasFrame::ComputeSize(gfxContext *aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -56,13 +56,13 @@ public:
/* get the size of the canvas's image */ /* get the size of the canvas's image */
nsIntSize GetCanvasSize(); nsIntSize GetCanvasSize();
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual mozilla::IntrinsicSize GetIntrinsicSize() override; virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
virtual nsSize GetIntrinsicRatio() override; virtual nsSize GetIntrinsicRatio() override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -66,7 +66,6 @@
class nsIAtom; class nsIAtom;
class nsPresContext; class nsPresContext;
class nsIPresShell; class nsIPresShell;
class nsRenderingContext;
class nsView; class nsView;
class nsIWidget; class nsIWidget;
class nsISelectionController; class nsISelectionController;
@ -2104,7 +2103,7 @@ public:
* *
* This method must not return a negative value. * This method must not return a negative value.
*/ */
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) = 0; virtual nscoord GetMinISize(gfxContext *aRenderingContext) = 0;
/** /**
* Get the max-content intrinsic inline size of the frame. This must be * Get the max-content intrinsic inline size of the frame. This must be
@ -2112,7 +2111,7 @@ public:
* *
* Otherwise, all the comments for |GetMinISize| above apply. * Otherwise, all the comments for |GetMinISize| above apply.
*/ */
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) = 0; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) = 0;
/** /**
* |InlineIntrinsicISize| represents the intrinsic width information * |InlineIntrinsicISize| represents the intrinsic width information
@ -2271,7 +2270,7 @@ public:
* which calls |GetMinISize|. * which calls |GetMinISize|.
*/ */
virtual void virtual void
AddInlineMinISize(nsRenderingContext *aRenderingContext, AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) = 0; InlineMinISizeData *aData) = 0;
/** /**
@ -2285,7 +2284,7 @@ public:
* based on using all *mandatory* breakpoints within the frame. * based on using all *mandatory* breakpoints within the frame.
*/ */
virtual void virtual void
AddInlinePrefISize(nsRenderingContext *aRenderingContext, AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) = 0; InlinePrefISizeData *aData) = 0;
/** /**
@ -2397,7 +2396,7 @@ public:
* @param aFlags Flags to further customize behavior (definitions above). * @param aFlags Flags to further customize behavior (definitions above).
*/ */
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -2437,7 +2436,7 @@ public:
* @param aXMost computed intrinsic width of the tight bounding rectangle * @param aXMost computed intrinsic width of the tight bounding rectangle
* *
*/ */
virtual nsresult GetPrefWidthTightBounds(nsRenderingContext* aContext, virtual nsresult GetPrefWidthTightBounds(gfxContext* aContext,
nscoord* aX, nscoord* aX,
nscoord* aXMost); nscoord* aXMost);
@ -3897,7 +3896,7 @@ public:
/** /**
* Helper function - computes the content-box inline size for aCoord. * Helper function - computes the content-box inline size for aCoord.
*/ */
nscoord ComputeISizeValue(nsRenderingContext* aRenderingContext, nscoord ComputeISizeValue(gfxContext* aRenderingContext,
nscoord aContainingBlockISize, nscoord aContainingBlockISize,
nscoord aContentEdgeToBoxSizing, nscoord aContentEdgeToBoxSizing,
nscoord aBoxSizingToMarginEdge, nscoord aBoxSizingToMarginEdge,

View File

@ -22,12 +22,12 @@
#define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3 #define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3
#define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5 #define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5
class gfxContext;
class nsBoxLayoutState; class nsBoxLayoutState;
class nsIScrollPositionListener; class nsIScrollPositionListener;
class nsIFrame; class nsIFrame;
class nsPresContext; class nsPresContext;
class nsIContent; class nsIContent;
class nsRenderingContext;
class nsIAtom; class nsIAtom;
class nsDisplayListBuilder; class nsDisplayListBuilder;
@ -97,13 +97,13 @@ public:
* of the scrolled contents. * of the scrolled contents.
*/ */
virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext, virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext,
nsRenderingContext* aRC) = 0; gfxContext* aRC) = 0;
/** /**
* Return the width for non-disappearing scrollbars. * Return the width for non-disappearing scrollbars.
*/ */
virtual nscoord virtual nscoord
GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, GetNondisappearingScrollbarWidth(nsPresContext* aPresContext,
nsRenderingContext* aRC, gfxContext* aRC,
mozilla::WritingMode aWM) = 0; mozilla::WritingMode aWM) = 0;
/** /**
* GetScrolledRect is designed to encapsulate deciding which * GetScrolledRect is designed to encapsulate deciding which

View File

@ -8,6 +8,7 @@
#include "nsImageFrame.h" #include "nsImageFrame.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/EventStates.h" #include "mozilla/EventStates.h"
@ -23,7 +24,6 @@
#include "nsString.h" #include "nsString.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIDocument.h" #include "nsIDocument.h"
@ -837,7 +837,7 @@ nsImageFrame::EnsureIntrinsicSizeAndRatio()
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsImageFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsImageFrame::ComputeSize(gfxContext *aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -922,7 +922,7 @@ nsImageFrame::GetContinuationOffset() const
} }
/* virtual */ nscoord /* virtual */ nscoord
nsImageFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsImageFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
// XXX The caller doesn't account for constraints of the height, // XXX The caller doesn't account for constraints of the height,
// min-height, and max-height properties. // min-height, and max-height properties.
@ -934,7 +934,7 @@ nsImageFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsImageFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsImageFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
// XXX The caller doesn't account for constraints of the height, // XXX The caller doesn't account for constraints of the height,
// min-height, and max-height properties. // min-height, and max-height properties.
@ -1104,7 +1104,7 @@ nsImageFrame::MeasureString(const char16_t* aString,
int32_t aLength, int32_t aLength,
nscoord aMaxWidth, nscoord aMaxWidth,
uint32_t& aMaxFit, uint32_t& aMaxFit,
nsRenderingContext& aContext, gfxContext& aContext,
nsFontMetrics& aFontMetrics) nsFontMetrics& aFontMetrics)
{ {
nscoord totalWidth = 0; nscoord totalWidth = 0;
@ -1165,13 +1165,12 @@ nsImageFrame::MeasureString(const char16_t* aString,
// between words if a word would extend past the edge of the rectangle // between words if a word would extend past the edge of the rectangle
void void
nsImageFrame::DisplayAltText(nsPresContext* aPresContext, nsImageFrame::DisplayAltText(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsString& aAltText, const nsString& aAltText,
const nsRect& aRect) const nsRect& aRect)
{ {
// Set font and color // Set font and color
aRenderingContext.ThebesContext()-> aRenderingContext.SetColor(Color::FromABGR(StyleColor()->mColor));
SetColor(Color::FromABGR(StyleColor()->mColor));
RefPtr<nsFontMetrics> fm = RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(this); nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
@ -1322,7 +1321,7 @@ public:
} }
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override gfxContext* aCtx) override
{ {
// Always sync decode, because these icons are UI, and since they're not // Always sync decode, because these icons are UI, and since they're not
// discardable we'll pay the price of sync decoding at most once. // discardable we'll pay the price of sync decoding at most once.
@ -1342,7 +1341,7 @@ public:
}; };
DrawResult DrawResult
nsImageFrame::DisplayAltFeedback(nsRenderingContext& aRenderingContext, nsImageFrame::DisplayAltFeedback(gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
nsPoint aPt, nsPoint aPt,
uint32_t aFlags) uint32_t aFlags)
@ -1395,12 +1394,11 @@ nsImageFrame::DisplayAltFeedback(nsRenderingContext& aRenderingContext,
} }
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget(); DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
gfxContext* gfx = aRenderingContext.ThebesContext();
// Clip so we don't render outside the inner rect // Clip so we don't render outside the inner rect
gfx->Save(); aRenderingContext.Save();
gfx->Clip(NSRectToSnappedRect(inner, PresContext()->AppUnitsPerDevPixel(), aRenderingContext.Clip(
*drawTarget)); NSRectToSnappedRect(inner, PresContext()->AppUnitsPerDevPixel(), *drawTarget));
DrawResult result = DrawResult::NOT_READY; DrawResult result = DrawResult::NOT_READY;
@ -1437,7 +1435,7 @@ nsImageFrame::DisplayAltFeedback(nsRenderingContext& aRenderingContext,
MOZ_ASSERT(imgCon, "Load complete, but no image container?"); MOZ_ASSERT(imgCon, "Load complete, but no image container?");
nsRect dest(flushRight ? inner.XMost() - size : inner.x, nsRect dest(flushRight ? inner.XMost() - size : inner.x,
inner.y, size, size); inner.y, size, size);
result = nsLayoutUtils::DrawSingleImage(*gfx, PresContext(), imgCon, result = nsLayoutUtils::DrawSingleImage(aRenderingContext, PresContext(), imgCon,
nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect, nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect,
/* no SVGImageContext */ Nothing(), aFlags); /* no SVGImageContext */ Nothing(), aFlags);
} }
@ -1493,7 +1491,7 @@ nsImageFrame::DisplayAltFeedback(nsRenderingContext& aRenderingContext,
} }
} }
aRenderingContext.ThebesContext()->Restore(); aRenderingContext.Restore();
return result; return result;
} }
@ -1517,7 +1515,7 @@ static void PaintDebugImageMap(nsIFrame* aFrame, DrawTarget* aDrawTarget,
void void
nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder, nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
uint32_t flags = imgIContainer::FLAG_NONE; uint32_t flags = imgIContainer::FLAG_NONE;
if (aBuilder->ShouldSyncDecodeImages()) { if (aBuilder->ShouldSyncDecodeImages()) {
@ -1690,7 +1688,7 @@ nsDisplayImage::BuildLayer(nsDisplayListBuilder* aBuilder,
} }
DrawResult DrawResult
nsImageFrame::PaintImage(nsRenderingContext& aRenderingContext, nsPoint aPt, nsImageFrame::PaintImage(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, imgIContainer* aImage, const nsRect& aDirtyRect, imgIContainer* aImage,
uint32_t aFlags) uint32_t aFlags)
{ {
@ -1723,7 +1721,7 @@ nsImageFrame::PaintImage(nsRenderingContext& aRenderingContext, nsPoint aPt,
SVGImageContext::MaybeStoreContextPaint(svgContext, this, aImage); SVGImageContext::MaybeStoreContextPaint(svgContext, this, aImage);
DrawResult result = DrawResult result =
nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(), nsLayoutUtils::DrawSingleImage(aRenderingContext,
PresContext(), aImage, PresContext(), aImage,
nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect, nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect,
svgContext, flags, &anchorPoint); svgContext, flags, &anchorPoint);
@ -2462,7 +2460,7 @@ IsInAutoWidthTableCellForQuirk(nsIFrame *aFrame)
} }
/* virtual */ void /* virtual */ void
nsImageFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext, nsImageFrame::AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) nsIFrame::InlineMinISizeData* aData)
{ {
nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord isize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,

View File

@ -81,8 +81,8 @@ public:
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override; const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual mozilla::IntrinsicSize GetIntrinsicSize() override; virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
virtual nsSize GetIntrinsicRatio() override; virtual nsSize GetIntrinsicRatio() override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
@ -147,7 +147,7 @@ public:
static bool ShouldCreateImageFrameFor(mozilla::dom::Element* aElement, static bool ShouldCreateImageFrameFor(mozilla::dom::Element* aElement,
nsStyleContext* aStyleContext); nsStyleContext* aStyleContext);
DrawResult DisplayAltFeedback(nsRenderingContext& aRenderingContext, DrawResult DisplayAltFeedback(gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
nsPoint aPt, nsPoint aPt,
uint32_t aFlags); uint32_t aFlags);
@ -167,7 +167,7 @@ public:
nsImageMap* GetImageMap(); nsImageMap* GetImageMap();
nsImageMap* GetExistingImageMap() const { return mImageMap; } nsImageMap* GetExistingImageMap() const { return mImageMap; }
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
void DisconnectMap(); void DisconnectMap();
@ -188,7 +188,7 @@ protected:
void EnsureIntrinsicSizeAndRatio(); void EnsureIntrinsicSizeAndRatio();
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,
@ -217,15 +217,15 @@ protected:
int32_t aLength, int32_t aLength,
nscoord aMaxWidth, nscoord aMaxWidth,
uint32_t& aMaxFit, uint32_t& aMaxFit,
nsRenderingContext& aContext, gfxContext& aContext,
nsFontMetrics& aFontMetrics); nsFontMetrics& aFontMetrics);
void DisplayAltText(nsPresContext* aPresContext, void DisplayAltText(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsString& aAltText, const nsString& aAltText,
const nsRect& aRect); const nsRect& aRect);
DrawResult PaintImage(nsRenderingContext& aRenderingContext, nsPoint aPt, DrawResult PaintImage(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, imgIContainer* aImage, const nsRect& aDirtyRect, imgIContainer* aImage,
uint32_t aFlags); uint32_t aFlags);
@ -427,7 +427,7 @@ public:
const nsDisplayItemGeometry* aGeometry, const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) override; nsRegion* aInvalidRegion) override;
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual already_AddRefed<imgIContainer> GetImage() override; virtual already_AddRefed<imgIContainer> GetImage() override;

View File

@ -5,6 +5,7 @@
/* rendering object for CSS display:inline objects */ /* rendering object for CSS display:inline objects */
#include "gfxContext.h"
#include "nsInlineFrame.h" #include "nsInlineFrame.h"
#include "nsLineLayout.h" #include "nsLineLayout.h"
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
@ -12,7 +13,6 @@
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsCSSAnonBoxes.h" #include "nsCSSAnonBoxes.h"
#include "mozilla/RestyleManager.h" #include "mozilla/RestyleManager.h"
#include "mozilla/RestyleManagerInlines.h" #include "mozilla/RestyleManagerInlines.h"
@ -256,14 +256,14 @@ nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Reflow methods // Reflow methods
/* virtual */ void /* virtual */ void
nsInlineFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext, nsInlineFrame::AddInlineMinISize(gfxContext *aRenderingContext,
nsIFrame::InlineMinISizeData *aData) nsIFrame::InlineMinISizeData *aData)
{ {
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE); DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE);
} }
/* virtual */ void /* virtual */ void
nsInlineFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext, nsInlineFrame::AddInlinePrefISize(gfxContext *aRenderingContext,
nsIFrame::InlinePrefISizeData *aData) nsIFrame::InlinePrefISizeData *aData)
{ {
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE); DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE);
@ -272,7 +272,7 @@ nsInlineFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsInlineFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsInlineFrame::ComputeSize(gfxContext *aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -63,12 +63,12 @@ public:
virtual nsresult StealFrame(nsIFrame* aChild) override; virtual nsresult StealFrame(nsIFrame* aChild) override;
// nsIHTMLReflow overrides // nsIHTMLReflow overrides
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -15,7 +15,7 @@ nsLeafFrame::~nsLeafFrame()
} }
/* virtual */ nscoord /* virtual */ nscoord
nsLeafFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsLeafFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
@ -24,7 +24,7 @@ nsLeafFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsLeafFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsLeafFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
nscoord result; nscoord result;
DISPLAY_PREF_WIDTH(this, result); DISPLAY_PREF_WIDTH(this, result);
@ -34,7 +34,7 @@ nsLeafFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
/* virtual */ /* virtual */
LogicalSize LogicalSize
nsLeafFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext, nsLeafFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -34,14 +34,14 @@ public:
* Both GetMinISize and GetPrefISize will return whatever GetIntrinsicISize * Both GetMinISize and GetPrefISize will return whatever GetIntrinsicISize
* returns. * returns.
*/ */
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
/** /**
* Our auto size is just intrinsic width and intrinsic height. * Our auto size is just intrinsic width and intrinsic height.
*/ */
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext, ComputeAutoSize(gfxContext* aRenderingContext,
mozilla::WritingMode aWM, mozilla::WritingMode aWM,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -6,11 +6,11 @@
#include "nsPageFrame.h" #include "nsPageFrame.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "gfxContext.h"
#include "nsDeviceContext.h" #include "nsDeviceContext.h"
#include "nsFontMetrics.h" #include "nsFontMetrics.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsPageContentFrame.h" #include "nsPageContentFrame.h"
@ -231,7 +231,7 @@ nsPageFrame::ProcessSpecialCodes(const nsString& aStr, nsString& aNewStr)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
nscoord nsPageFrame::GetXPosition(nsRenderingContext& aRenderingContext, nscoord nsPageFrame::GetXPosition(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
const nsRect& aRect, const nsRect& aRect,
int32_t aJust, int32_t aJust,
@ -268,7 +268,7 @@ nscoord nsPageFrame::GetXPosition(nsRenderingContext& aRenderingContext,
// @param aAscent - the ascent of the font // @param aAscent - the ascent of the font
// @param aHeight - the height of the font // @param aHeight - the height of the font
void void
nsPageFrame::DrawHeaderFooter(nsRenderingContext& aRenderingContext, nsPageFrame::DrawHeaderFooter(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsHeaderFooterEnum aHeaderFooter, nsHeaderFooterEnum aHeaderFooter,
const nsString& aStrLeft, const nsString& aStrLeft,
@ -313,7 +313,7 @@ nsPageFrame::DrawHeaderFooter(nsRenderingContext& aRenderingContext,
// @param aAscent - the ascent of the font // @param aAscent - the ascent of the font
// @param aWidth - available width for the string // @param aWidth - available width for the string
void void
nsPageFrame::DrawHeaderFooter(nsRenderingContext& aRenderingContext, nsPageFrame::DrawHeaderFooter(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsHeaderFooterEnum aHeaderFooter, nsHeaderFooterEnum aHeaderFooter,
int32_t aJust, int32_t aJust,
@ -326,7 +326,6 @@ nsPageFrame::DrawHeaderFooter(nsRenderingContext& aRenderingContext,
nscoord contentWidth = aWidth - (mPD->mEdgePaperMargin.left + mPD->mEdgePaperMargin.right); nscoord contentWidth = aWidth - (mPD->mEdgePaperMargin.left + mPD->mEdgePaperMargin.right);
gfxContext* gfx = aRenderingContext.ThebesContext();
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget(); DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
if ((aHeaderFooter == eHeader && aHeight < mPageContentMargin.top) || if ((aHeaderFooter == eHeader && aHeight < mPageContentMargin.top) ||
@ -381,16 +380,16 @@ nsPageFrame::DrawHeaderFooter(nsRenderingContext& aRenderingContext,
} }
// set up new clip and draw the text // set up new clip and draw the text
gfx->Save(); aRenderingContext.Save();
gfx->Clip(NSRectToSnappedRect(aRect, PresContext()->AppUnitsPerDevPixel(), aRenderingContext.Clip(
*drawTarget)); NSRectToSnappedRect(aRect, PresContext()->AppUnitsPerDevPixel(), *drawTarget));
gfx->SetColor(Color(0.f, 0.f, 0.f)); aRenderingContext.SetColor(Color(0.f, 0.f, 0.f));
nsLayoutUtils::DrawString(this, aFontMetrics, &aRenderingContext, nsLayoutUtils::DrawString(this, aFontMetrics, &aRenderingContext,
str.get(), str.Length(), str.get(), str.Length(),
nsPoint(x, y + aAscent), nsPoint(x, y + aAscent),
nullptr, nullptr,
DrawStringFlags::eForceHorizontal); DrawStringFlags::eForceHorizontal);
gfx->Restore(); aRenderingContext.Restore();
} }
} }
@ -488,7 +487,7 @@ public:
#endif #endif
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override { gfxContext* aCtx) override {
#ifdef DEBUG #ifdef DEBUG
nsPageFrame* pageFrame = do_QueryFrame(mFrame); nsPageFrame* pageFrame = do_QueryFrame(mFrame);
MOZ_ASSERT(pageFrame, "We should have an nsPageFrame"); MOZ_ASSERT(pageFrame, "We should have an nsPageFrame");
@ -607,7 +606,7 @@ nsPageFrame::SetPageNumInfo(int32_t aPageNumber, int32_t aTotalPages)
void void
nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext, nsPageFrame::PaintHeaderFooter(gfxContext& aRenderingContext,
nsPoint aPt, bool aDisableSubpixelAA) nsPoint aPt, bool aDisableSubpixelAA)
{ {
nsPresContext* pc = PresContext(); nsPresContext* pc = PresContext();
@ -620,7 +619,7 @@ nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext,
} }
nsRect rect(aPt, mRect.Size()); nsRect rect(aPt, mRect.Size());
aRenderingContext.ThebesContext()->SetColor(Color(0.f, 0.f, 0.f)); aRenderingContext.SetColor(Color(0.f, 0.f, 0.f));
DrawTargetAutoDisableSubpixelAntialiasing DrawTargetAutoDisableSubpixelAntialiasing
disable(aRenderingContext.GetDrawTarget(), aDisableSubpixelAA); disable(aRenderingContext.GetDrawTarget(), aDisableSubpixelAA);

View File

@ -48,7 +48,7 @@ public:
// user's settings // user's settings
virtual bool HonorPrintBackgroundSettings() override { return false; } virtual bool HonorPrintBackgroundSettings() override { return false; }
void PaintHeaderFooter(nsRenderingContext& aRenderingContext, void PaintHeaderFooter(gfxContext& aRenderingContext,
nsPoint aPt, bool aSubpixelAA); nsPoint aPt, bool aSubpixelAA);
protected: protected:
@ -60,13 +60,13 @@ protected:
eFooter eFooter
} nsHeaderFooterEnum; } nsHeaderFooterEnum;
nscoord GetXPosition(nsRenderingContext& aRenderingContext, nscoord GetXPosition(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
const nsRect& aRect, const nsRect& aRect,
int32_t aJust, int32_t aJust,
const nsString& aStr); const nsString& aStr);
void DrawHeaderFooter(nsRenderingContext& aRenderingContext, void DrawHeaderFooter(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsHeaderFooterEnum aHeaderFooter, nsHeaderFooterEnum aHeaderFooter,
int32_t aJust, int32_t aJust,
@ -76,7 +76,7 @@ protected:
nscoord aAscent, nscoord aAscent,
nscoord aWidth); nscoord aWidth);
void DrawHeaderFooter(nsRenderingContext& aRenderingContext, void DrawHeaderFooter(gfxContext& aRenderingContext,
nsFontMetrics& aFontMetrics, nsFontMetrics& aFontMetrics,
nsHeaderFooterEnum aHeaderFooter, nsHeaderFooterEnum aHeaderFooter,
const nsString& aStrLeft, const nsString& aStrLeft,

View File

@ -10,13 +10,13 @@
#include "nsPlaceholderFrame.h" #include "nsPlaceholderFrame.h"
#include "gfxContext.h"
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "nsFrameManager.h" #include "nsFrameManager.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsIFrameInlines.h" #include "nsIFrameInlines.h"
#include "nsIContentInlines.h" #include "nsIContentInlines.h"
@ -63,7 +63,7 @@ nsPlaceholderFrame::GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState)
} }
/* virtual */ void /* virtual */ void
nsPlaceholderFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext, nsPlaceholderFrame::AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) nsIFrame::InlineMinISizeData* aData)
{ {
// Override AddInlineMinWith so that *nothing* happens. In // Override AddInlineMinWith so that *nothing* happens. In
@ -84,7 +84,7 @@ nsPlaceholderFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext,
} }
/* virtual */ void /* virtual */ void
nsPlaceholderFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext, nsPlaceholderFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) nsIFrame::InlinePrefISizeData* aData)
{ {
// Override AddInlinePrefWith so that *nothing* happens. In // Override AddInlinePrefWith so that *nothing* happens. In

View File

@ -90,9 +90,9 @@ public:
// nsIFrame overrides // nsIFrame overrides
// We need to override GetXULMinSize and GetXULPrefSize because XUL uses // We need to override GetXULMinSize and GetXULPrefSize because XUL uses
// placeholders not within lines. // placeholders not within lines.
virtual void AddInlineMinISize(nsRenderingContext* aRenderingContext, virtual void AddInlineMinISize(gfxContext* aRenderingContext,
InlineMinISizeData* aData) override; InlineMinISizeData* aData) override;
virtual void AddInlinePrefISize(nsRenderingContext* aRenderingContext, virtual void AddInlinePrefISize(gfxContext* aRenderingContext,
InlinePrefISizeData* aData) override; InlinePrefISizeData* aData) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override; virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override; virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;

View File

@ -9,6 +9,7 @@
#include "nsPluginFrame.h" #include "nsPluginFrame.h"
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxMatrix.h" #include "gfxMatrix.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/BasicEvents.h" #include "mozilla/BasicEvents.h"
@ -30,7 +31,6 @@
#include "nsIPluginInstanceOwner.h" #include "nsIPluginInstanceOwner.h"
#include "nsNPAPIPluginInstance.h" #include "nsNPAPIPluginInstance.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsRenderingContext.h"
#include "npapi.h" #include "npapi.h"
#include "nsIObjectLoadingContent.h" #include "nsIObjectLoadingContent.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
@ -374,7 +374,7 @@ nsPluginFrame::PrepForDrawing(nsIWidget *aWidget)
#define EMBED_DEF_HEIGHT 200 #define EMBED_DEF_HEIGHT 200
/* virtual */ nscoord /* virtual */ nscoord
nsPluginFrame::GetMinISize(nsRenderingContext *aRenderingContext) nsPluginFrame::GetMinISize(gfxContext *aRenderingContext)
{ {
nscoord result = 0; nscoord result = 0;
@ -392,7 +392,7 @@ nsPluginFrame::GetMinISize(nsRenderingContext *aRenderingContext)
} }
/* virtual */ nscoord /* virtual */ nscoord
nsPluginFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nsPluginFrame::GetPrefISize(gfxContext *aRenderingContext)
{ {
return nsPluginFrame::GetMinISize(aRenderingContext); return nsPluginFrame::GetMinISize(aRenderingContext);
} }
@ -871,18 +871,16 @@ nsPluginFrame::DidReflow(nsPresContext* aPresContext,
} }
/* static */ void /* static */ void
nsPluginFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx, nsPluginFrame::PaintPrintPlugin(nsIFrame* aFrame, gfxContext* aCtx,
const nsRect& aDirtyRect, nsPoint aPt) const nsRect& aDirtyRect, nsPoint aPt)
{ {
gfxContext* ctx = aCtx->ThebesContext();
// Translate the context: // Translate the context:
nsPoint pt = aPt + aFrame->GetContentRectRelativeToSelf().TopLeft(); nsPoint pt = aPt + aFrame->GetContentRectRelativeToSelf().TopLeft();
gfxPoint devPixelPt = gfxPoint devPixelPt =
nsLayoutUtils::PointToGfxPoint(pt, aFrame->PresContext()->AppUnitsPerDevPixel()); nsLayoutUtils::PointToGfxPoint(pt, aFrame->PresContext()->AppUnitsPerDevPixel());
gfxContextMatrixAutoSaveRestore autoSR(ctx); gfxContextMatrixAutoSaveRestore autoSR(aCtx);
ctx->SetMatrix(ctx->CurrentMatrix().Translate(devPixelPt)); aCtx->SetMatrix(aCtx->CurrentMatrix().Translate(devPixelPt));
// FIXME - Bug 385435: Doesn't aDirtyRect need translating too? // FIXME - Bug 385435: Doesn't aDirtyRect need translating too?
@ -1000,7 +998,7 @@ nsDisplayPlugin::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
void void
nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder, nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) gfxContext* aCtx)
{ {
nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame); nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame);
bool snap; bool snap;
@ -1272,7 +1270,7 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
void void
nsPluginFrame::PrintPlugin(nsRenderingContext& aRenderingContext, nsPluginFrame::PrintPlugin(gfxContext& aRenderingContext,
const nsRect& aDirtyRect) const nsRect& aDirtyRect)
{ {
nsCOMPtr<nsIObjectLoadingContent> obj(do_QueryInterface(mContent)); nsCOMPtr<nsIObjectLoadingContent> obj(do_QueryInterface(mContent));
@ -1343,17 +1341,15 @@ nsPluginFrame::PrintPlugin(nsRenderingContext& aRenderingContext,
window.width = presContext->AppUnitsToDevPixels(contentSize.width); window.width = presContext->AppUnitsToDevPixels(contentSize.width);
window.height = presContext->AppUnitsToDevPixels(contentSize.height); window.height = presContext->AppUnitsToDevPixels(contentSize.height);
gfxContext *ctx = aRenderingContext.ThebesContext(); aRenderingContext.Save();
ctx->Save();
/* Make sure plugins don't do any damage outside of where they're supposed to */ /* Make sure plugins don't do any damage outside of where they're supposed to */
ctx->NewPath(); aRenderingContext.NewPath();
gfxRect r(window.x, window.y, window.width, window.height); gfxRect r(window.x, window.y, window.width, window.height);
ctx->Rectangle(r); aRenderingContext.Rectangle(r);
ctx->Clip(); aRenderingContext.Clip();
gfxWindowsNativeDrawing nativeDraw(ctx, r); gfxWindowsNativeDrawing nativeDraw(&aRenderingContext, r);
do { do {
HDC dc = nativeDraw.BeginNativeDrawing(); HDC dc = nativeDraw.BeginNativeDrawing();
if (!dc) if (!dc)
@ -1369,7 +1365,7 @@ nsPluginFrame::PrintPlugin(nsRenderingContext& aRenderingContext,
} while (nativeDraw.ShouldRenderAgain()); } while (nativeDraw.ShouldRenderAgain());
nativeDraw.PaintToContext(); nativeDraw.PaintToContext();
ctx->Restore(); aRenderingContext.Restore();
#endif #endif
// XXX Nav 4.x always sent a SetWindow call after print. Should we do the same? // XXX Nav 4.x always sent a SetWindow call after print. Should we do the same?
@ -1603,7 +1599,7 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
void void
nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aPluginRect) const nsRect& aDirtyRect, const nsRect& aPluginRect)
{ {
#if defined(MOZ_WIDGET_ANDROID) #if defined(MOZ_WIDGET_ANDROID)
@ -1613,9 +1609,7 @@ nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
gfxRect dirtyGfxRect = gfxRect dirtyGfxRect =
PresContext()->AppUnitsToGfxUnits(aDirtyRect); PresContext()->AppUnitsToGfxUnits(aDirtyRect);
gfxContext* ctx = aRenderingContext.ThebesContext(); mInstanceOwner->Paint(&aRenderingContext, frameGfxRect, dirtyGfxRect);
mInstanceOwner->Paint(ctx, frameGfxRect, dirtyGfxRect);
return; return;
} }
#else #else

View File

@ -70,8 +70,8 @@ public:
virtual void Init(nsIContent* aContent, virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override; nsIFrame* aPrevInFlow) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, const ReflowInput& aReflowInput,
@ -252,12 +252,12 @@ protected:
LayoutDeviceIntPoint GetRemoteTabChromeOffset(); LayoutDeviceIntPoint GetRemoteTabChromeOffset();
static void PaintPrintPlugin(nsIFrame* aFrame, static void PaintPrintPlugin(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext, gfxContext* aRenderingContext,
const nsRect& aDirtyRect, nsPoint aPt); const nsRect& aDirtyRect, nsPoint aPt);
void PrintPlugin(nsRenderingContext& aRenderingContext, void PrintPlugin(gfxContext& aRenderingContext,
const nsRect& aDirtyRect); const nsRect& aDirtyRect);
void PaintPlugin(nsDisplayListBuilder* aBuilder, void PaintPlugin(nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext, gfxContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aPluginRect); const nsRect& aDirtyRect, const nsRect& aPluginRect);
void NotifyPluginReflowObservers(); void NotifyPluginReflowObservers();
@ -352,7 +352,7 @@ public:
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder, virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) override; bool* aSnap) override;
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override; gfxContext* aCtx) override;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder, virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion) override; nsRegion* aVisibleRegion) override;

View File

@ -131,7 +131,7 @@ GetIsLineBreakAllowed(nsIFrame* aFrame, bool aIsLineBreakable,
* happens across the boundary of those frames. * happens across the boundary of those frames.
*/ */
static nscoord static nscoord
CalculateColumnPrefISize(nsRenderingContext* aRenderingContext, CalculateColumnPrefISize(gfxContext* aRenderingContext,
const RubyColumnEnumerator& aEnumerator, const RubyColumnEnumerator& aEnumerator,
nsIFrame::InlineIntrinsicISizeData* aBaseISizeData) nsIFrame::InlineIntrinsicISizeData* aBaseISizeData)
{ {
@ -167,7 +167,7 @@ CalculateColumnPrefISize(nsRenderingContext* aRenderingContext,
// See bug 1134945. // See bug 1134945.
/* virtual */ void /* virtual */ void
nsRubyBaseContainerFrame::AddInlineMinISize( nsRubyBaseContainerFrame::AddInlineMinISize(
nsRenderingContext *aRenderingContext, nsIFrame::InlineMinISizeData *aData) gfxContext *aRenderingContext, nsIFrame::InlineMinISizeData *aData)
{ {
AutoRubyTextContainerArray textContainers(this); AutoRubyTextContainerArray textContainers(this);
@ -222,7 +222,7 @@ nsRubyBaseContainerFrame::AddInlineMinISize(
/* virtual */ void /* virtual */ void
nsRubyBaseContainerFrame::AddInlinePrefISize( nsRubyBaseContainerFrame::AddInlinePrefISize(
nsRenderingContext *aRenderingContext, nsIFrame::InlinePrefISizeData *aData) gfxContext *aRenderingContext, nsIFrame::InlinePrefISizeData *aData)
{ {
AutoRubyTextContainerArray textContainers(this); AutoRubyTextContainerArray textContainers(this);
@ -263,7 +263,7 @@ nsRubyBaseContainerFrame::CanContinueTextRun() const
} }
/* virtual */ LogicalSize /* virtual */ LogicalSize
nsRubyBaseContainerFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsRubyBaseContainerFrame::ComputeSize(gfxContext *aRenderingContext,
WritingMode aWM, WritingMode aWM,
const LogicalSize& aCBSize, const LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -28,12 +28,12 @@ public:
// nsIFrame overrides // nsIFrame overrides
virtual bool IsFrameOfType(uint32_t aFlags) const override; virtual bool IsFrameOfType(uint32_t aFlags) const override;
virtual bool CanContinueTextRun() const override; virtual bool CanContinueTextRun() const override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
virtual mozilla::LogicalSize virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext, ComputeSize(gfxContext *aRenderingContext,
mozilla::WritingMode aWritingMode, mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize, nscoord aAvailableISize,

View File

@ -60,7 +60,7 @@ nsRubyFrame::GetFrameName(nsAString& aResult) const
#endif #endif
/* virtual */ void /* virtual */ void
nsRubyFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext, nsRubyFrame::AddInlineMinISize(gfxContext *aRenderingContext,
nsIFrame::InlineMinISizeData *aData) nsIFrame::InlineMinISizeData *aData)
{ {
for (nsIFrame* frame = this; frame; frame = frame->GetNextInFlow()) { for (nsIFrame* frame = this; frame; frame = frame->GetNextInFlow()) {
@ -72,7 +72,7 @@ nsRubyFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
} }
/* virtual */ void /* virtual */ void
nsRubyFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext, nsRubyFrame::AddInlinePrefISize(gfxContext *aRenderingContext,
nsIFrame::InlinePrefISizeData *aData) nsIFrame::InlinePrefISizeData *aData)
{ {
for (nsIFrame* frame = this; frame; frame = frame->GetNextInFlow()) { for (nsIFrame* frame = this; frame; frame = frame->GetNextInFlow()) {

View File

@ -27,9 +27,9 @@ public:
// nsIFrame overrides // nsIFrame overrides
virtual bool IsFrameOfType(uint32_t aFlags) const override; virtual bool IsFrameOfType(uint32_t aFlags) const override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext, virtual void AddInlineMinISize(gfxContext *aRenderingContext,
InlineMinISizeData *aData) override; InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
InlinePrefISizeData *aData) override; InlinePrefISizeData *aData) override;
virtual void Reflow(nsPresContext* aPresContext, virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize, ReflowOutput& aDesiredSize,

Some files were not shown because too many files have changed in this diff Show More