mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1304011 - Part 7. Fix several coding convention violations. r=mstange
MozReview-Commit-ID: BYhiQnlfR3a --HG-- extra : rebase_source : eba1a5fcec8f502cfaf4ff0e1d09a321e533131c
This commit is contained in:
parent
447951cfbc
commit
f42e498549
@ -592,41 +592,42 @@ class gfxContextMatrixAutoSaveRestore
|
||||
{
|
||||
public:
|
||||
gfxContextMatrixAutoSaveRestore() :
|
||||
mContext(nullptr)
|
||||
mContext(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
explicit gfxContextMatrixAutoSaveRestore(gfxContext *aContext) :
|
||||
mContext(aContext), mMatrix(aContext->CurrentMatrix())
|
||||
mContext(aContext), mMatrix(aContext->CurrentMatrix())
|
||||
{
|
||||
}
|
||||
|
||||
~gfxContextMatrixAutoSaveRestore()
|
||||
{
|
||||
if (mContext) {
|
||||
mContext->SetMatrix(mMatrix);
|
||||
}
|
||||
if (mContext) {
|
||||
mContext->SetMatrix(mMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
void SetContext(gfxContext *aContext)
|
||||
{
|
||||
NS_ASSERTION(!mContext, "Not going to restore the matrix on some context!");
|
||||
mContext = aContext;
|
||||
mMatrix = aContext->CurrentMatrix();
|
||||
NS_ASSERTION(!mContext,
|
||||
"Not going to restore the matrix on some context!");
|
||||
mContext = aContext;
|
||||
mMatrix = aContext->CurrentMatrix();
|
||||
}
|
||||
|
||||
void Restore()
|
||||
{
|
||||
if (mContext) {
|
||||
mContext->SetMatrix(mMatrix);
|
||||
mContext = nullptr;
|
||||
}
|
||||
if (mContext) {
|
||||
mContext->SetMatrix(mMatrix);
|
||||
mContext = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const gfxMatrix& Matrix()
|
||||
{
|
||||
MOZ_ASSERT(mContext, "mMatrix doesn't contain a useful matrix");
|
||||
return mMatrix;
|
||||
MOZ_ASSERT(mContext, "mMatrix doesn't contain a useful matrix");
|
||||
return mMatrix;
|
||||
}
|
||||
|
||||
bool HasMatrix() const { return !!mContext; }
|
||||
|
@ -3238,7 +3238,8 @@ nsCSSRendering::PaintBackgroundWithSC(const PaintBGParams& aParams,
|
||||
clipSet = true;
|
||||
if (!clipBorderArea.IsEqualEdges(aParams.borderArea)) {
|
||||
// We're drawing the background for the joined continuation boxes
|
||||
// so we need to clip that to the slice that we want for this frame.
|
||||
// so we need to clip that to the slice that we want for this
|
||||
// frame.
|
||||
gfxRect clip =
|
||||
nsLayoutUtils::RectToGfxRect(aParams.borderArea, appUnitsPerPixel);
|
||||
autoSR.EnsureSaved(ctx);
|
||||
@ -3259,7 +3260,8 @@ nsCSSRendering::PaintBackgroundWithSC(const PaintBGParams& aParams,
|
||||
if (!state.mFillArea.IsEmpty()) {
|
||||
if (co != CompositionOp::OP_OVER) {
|
||||
NS_ASSERTION(ctx->CurrentOp() == CompositionOp::OP_OVER,
|
||||
"It is assumed the initial op is OP_OVER, when it is restored later");
|
||||
"It is assumed the initial op is OP_OVER, when it is "
|
||||
"restored later");
|
||||
ctx->SetOp(co);
|
||||
}
|
||||
|
||||
|
@ -6832,18 +6832,22 @@ bool nsDisplayMask::TryMerge(nsDisplayItem* aItem)
|
||||
// items for the same content element should be merged into a single
|
||||
// compositing group
|
||||
// aItem->GetUnderlyingFrame() returns non-null because it's nsDisplaySVGEffects
|
||||
if (aItem->Frame()->GetContent() != mFrame->GetContent())
|
||||
if (aItem->Frame()->GetContent() != mFrame->GetContent()) {
|
||||
return false;
|
||||
if (aItem->GetClip() != GetClip())
|
||||
}
|
||||
if (aItem->GetClip() != GetClip()) {
|
||||
return false;
|
||||
if (aItem->ScrollClip() != ScrollClip())
|
||||
}
|
||||
if (aItem->ScrollClip() != ScrollClip()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do not merge if mFrame has mask. Continuation frames should apply mask
|
||||
// independently(just like nsDisplayBackgroundImage).
|
||||
const nsStyleSVGReset *style = mFrame->StyleSVGReset();
|
||||
if (style->mMask.HasLayerWithImage())
|
||||
if (style->mMask.HasLayerWithImage()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsDisplayMask* other = static_cast<nsDisplayMask*>(aItem);
|
||||
MergeFromTrackingMergedFrames(other);
|
||||
@ -6894,7 +6898,7 @@ nsDisplayMask::GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
bool nsDisplayMask::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
nsRegion* aVisibleRegion)
|
||||
nsRegion* aVisibleRegion)
|
||||
{
|
||||
// Our children may be made translucent or arbitrarily deformed so we should
|
||||
// not allow them to subtract area from aVisibleRegion.
|
||||
|
@ -680,8 +680,9 @@ SetupContextMatrix(nsIFrame* aFrame, const PaintFramesParams& aParams,
|
||||
aFrame->PresContext()->RoundAppUnitsToNearestDevPixels(aOffsetToBoundingBox.y));
|
||||
}
|
||||
|
||||
// After applying only "aOffsetToBoundingBox", aCtx would have its origin at
|
||||
// the top left corner of frame's bounding box (over all continuations).
|
||||
// After applying only "aOffsetToBoundingBox", aParams.ctx would have its
|
||||
// origin at the top left corner of frame's bounding box (over all
|
||||
// continuations).
|
||||
// However, SVG painting needs the origin to be located at the origin of the
|
||||
// SVG frame's "user space", i.e. the space in which, for example, the
|
||||
// frame's BBox lives.
|
||||
@ -946,7 +947,7 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
|
||||
RefPtr<gfxContext> oldCtx = basic->GetTarget();
|
||||
basic->SetTarget(target);
|
||||
aParams.layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
|
||||
aParams.builder);
|
||||
aParams.builder);
|
||||
basic->SetTarget(oldCtx);
|
||||
|
||||
if (shouldApplyClipPath || shouldApplyBasicShape) {
|
||||
|
Loading…
Reference in New Issue
Block a user