зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1210560 - Part 2: Convert some simple users to use PushGroupForBlendBack. r=jrmuizel
This commit is contained in:
Родитель
752a87fbd2
Коммит
d4041dbed1
|
@ -531,7 +531,6 @@ HasNonOpaqueNonTransparentColor(gfxContext *aContext, Color& aCurrentColorOut)
|
|||
struct BufferAlphaColor {
|
||||
explicit BufferAlphaColor(gfxContext *aContext)
|
||||
: mContext(aContext)
|
||||
, mAlpha(0.0)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -548,21 +547,17 @@ struct BufferAlphaColor {
|
|||
aBounds.Height() / appsPerDevUnit), true);
|
||||
mContext->Clip();
|
||||
mContext->SetColor(Color(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
|
||||
mContext->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
mAlpha = aAlphaColor.a;
|
||||
mContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aAlphaColor.a);
|
||||
}
|
||||
|
||||
void PopAlpha()
|
||||
{
|
||||
// pop the text, using the color alpha as the opacity
|
||||
mContext->PopGroupToSource();
|
||||
mContext->SetOp(CompositionOp::OP_OVER);
|
||||
mContext->Paint(mAlpha);
|
||||
mContext->PopGroupAndBlend();
|
||||
mContext->Restore();
|
||||
}
|
||||
|
||||
gfxContext *mContext;
|
||||
gfxFloat mAlpha;
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -508,7 +508,7 @@ struct MOZ_STACK_CLASS AutoCairoPixmanBugWorkaround
|
|||
bounds.RoundOut();
|
||||
mContext->Clip(bounds);
|
||||
mContext->SetMatrix(currentMatrix);
|
||||
mContext->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
mContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA);
|
||||
mContext->SetOp(CompositionOp::OP_OVER);
|
||||
|
||||
mPushedGroup = true;
|
||||
|
@ -517,8 +517,7 @@ struct MOZ_STACK_CLASS AutoCairoPixmanBugWorkaround
|
|||
~AutoCairoPixmanBugWorkaround()
|
||||
{
|
||||
if (mPushedGroup) {
|
||||
mContext->PopGroupToSource();
|
||||
mContext->Paint();
|
||||
mContext->PopGroupAndBlend();
|
||||
mContext->Restore();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2974,7 +2974,7 @@ SVGTextDrawPathCallbacks::FillAndStrokeGeometry()
|
|||
bool pushedGroup = false;
|
||||
if (mColor == NS_40PERCENT_FOREGROUND_COLOR) {
|
||||
pushedGroup = true;
|
||||
gfx->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
gfx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, 0.4f);
|
||||
}
|
||||
|
||||
uint32_t paintOrder = mFrame->StyleSVG()->mPaintOrder;
|
||||
|
@ -2998,8 +2998,7 @@ SVGTextDrawPathCallbacks::FillAndStrokeGeometry()
|
|||
}
|
||||
|
||||
if (pushedGroup) {
|
||||
gfx->PopGroupToSource();
|
||||
gfx->Paint(0.4);
|
||||
gfx->PopGroupAndBlend();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ nsSVGImageFrame::PaintSVG(gfxContext& aContext,
|
|||
}
|
||||
|
||||
if (opacity != 1.0f || StyleDisplay()->mMixBlendMode != NS_STYLE_BLEND_NORMAL) {
|
||||
aContext.PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
aContext.PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, opacity);
|
||||
}
|
||||
|
||||
nscoord appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel();
|
||||
|
@ -404,9 +404,7 @@ nsSVGImageFrame::PaintSVG(gfxContext& aContext,
|
|||
}
|
||||
|
||||
if (opacity != 1.0f || StyleDisplay()->mMixBlendMode != NS_STYLE_BLEND_NORMAL) {
|
||||
aContext.PopGroupToSource();
|
||||
aContext.SetOp(CompositionOp::OP_OVER);
|
||||
aContext.Paint(opacity);
|
||||
aContext.PopGroupAndBlend();
|
||||
}
|
||||
// gfxContextAutoSaveRestore goes out of scope & cleans up our gfxContext
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget,
|
|||
|
||||
if (aGraphicOpacity != 1.0f) {
|
||||
gfx->Save();
|
||||
gfx->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
gfx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aGraphicOpacity);
|
||||
}
|
||||
|
||||
// OK, now render -- note that we use "firstKid", which
|
||||
|
@ -417,8 +417,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget,
|
|||
patternWithChildren->mSource = nullptr;
|
||||
|
||||
if (aGraphicOpacity != 1.0f) {
|
||||
gfx->PopGroupToSource();
|
||||
gfx->Paint(aGraphicOpacity);
|
||||
gfx->PopGroupAndBlend();
|
||||
gfx->Restore();
|
||||
}
|
||||
|
||||
|
|
|
@ -3639,7 +3639,7 @@ nsTreeBodyFrame::PaintImage(int32_t aRowIndex,
|
|||
|
||||
gfxContext* ctx = aRenderingContext.ThebesContext();
|
||||
if (opacity != 1.0f) {
|
||||
ctx->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
ctx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, opacity);
|
||||
}
|
||||
|
||||
result &=
|
||||
|
@ -3649,8 +3649,7 @@ nsTreeBodyFrame::PaintImage(int32_t aRowIndex,
|
|||
imgIContainer::FLAG_NONE);
|
||||
|
||||
if (opacity != 1.0f) {
|
||||
ctx->PopGroupToSource();
|
||||
ctx->Paint(opacity);
|
||||
ctx->PopGroupAndBlend();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3776,7 +3775,7 @@ nsTreeBodyFrame::PaintText(int32_t aRowIndex,
|
|||
|
||||
gfxContext* ctx = aRenderingContext.ThebesContext();
|
||||
if (opacity != 1.0f) {
|
||||
ctx->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
ctx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, opacity);
|
||||
}
|
||||
|
||||
ctx->SetColor(Color::FromABGR(textContext->StyleColor()->mColor));
|
||||
|
@ -3786,8 +3785,7 @@ nsTreeBodyFrame::PaintText(int32_t aRowIndex,
|
|||
cellContext);
|
||||
|
||||
if (opacity != 1.0f) {
|
||||
ctx->PopGroupToSource();
|
||||
ctx->Paint(opacity);
|
||||
ctx->PopGroupAndBlend();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче