зеркало из https://github.com/mozilla/pjs.git
Bug 473398. nsCSSRendering::PaintBackground should not try to fix up the canvas background color to be opaque. r+sr=roc
--HG-- extra : rebase_source : f2883c704bee9a4ba70c57598704ed7ba30628dc
This commit is contained in:
Родитель
ed9150bebf
Коммит
9a4b44c69d
|
@ -1159,7 +1159,6 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
||||||
|
|
||||||
PRBool isCanvas;
|
PRBool isCanvas;
|
||||||
const nsStyleBackground *color;
|
const nsStyleBackground *color;
|
||||||
const nsStyleBorder* border = aForFrame->GetStyleBorder();
|
|
||||||
|
|
||||||
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
|
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
|
||||||
// we don't want to bail out of moz-appearance is set on a root
|
// we don't want to bail out of moz-appearance is set on a root
|
||||||
|
@ -1178,40 +1177,16 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
||||||
|
|
||||||
color = aForFrame->GetStyleBackground();
|
color = aForFrame->GetStyleBackground();
|
||||||
}
|
}
|
||||||
if (!isCanvas) {
|
|
||||||
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
|
if (isCanvas && NS_GET_A(color->mBackgroundColor) == 255) {
|
||||||
aDirtyRect, aBorderArea, *color, *border,
|
nsIViewManager* vm = aPresContext->GetViewManager();
|
||||||
aUsePrintSettings, aBGClipRect);
|
vm->SetDefaultBackgroundColor(color->mBackgroundColor);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsStyleBackground canvasColor(*color);
|
|
||||||
|
|
||||||
nsIViewManager* vm = aPresContext->GetViewManager();
|
|
||||||
|
|
||||||
if (NS_GET_A(canvasColor.mBackgroundColor) < 255) {
|
|
||||||
// If the window is intended to be opaque, ensure that we always
|
|
||||||
// paint an opaque color for its root element, in case there's no
|
|
||||||
// background at all or a partly transparent image.
|
|
||||||
nsIView* rView;
|
|
||||||
vm->GetRootView(rView);
|
|
||||||
if (!rView->GetParent() &&
|
|
||||||
(!rView->HasWidget() ||
|
|
||||||
rView->GetWidget()->GetTransparencyMode() == eTransparencyOpaque)) {
|
|
||||||
nscolor backColor = aPresContext->DefaultBackgroundColor();
|
|
||||||
NS_ASSERTION(NS_GET_A(backColor) == 255,
|
|
||||||
"default background color is not opaque");
|
|
||||||
|
|
||||||
canvasColor.mBackgroundColor =
|
|
||||||
NS_ComposeColors(backColor, canvasColor.mBackgroundColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vm->SetDefaultBackgroundColor(canvasColor.mBackgroundColor);
|
|
||||||
|
|
||||||
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
|
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
|
||||||
aDirtyRect, aBorderArea, canvasColor,
|
aDirtyRect, aBorderArea, *color,
|
||||||
*border, aUsePrintSettings, aBGClipRect);
|
*aForFrame->GetStyleBorder(),
|
||||||
|
aUsePrintSettings, aBGClipRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PRBool
|
static PRBool
|
||||||
|
|
Загрузка…
Ссылка в новой задаче