Bug 593839. Part 1: Use nsDisplayListBuilder::IsPaintingToWindow instead of gfxContext::DESTINED_FOR_SCREEN. r=tnikkel

This commit is contained in:
Robert O'Callahan 2010-10-25 16:38:09 +02:00
Родитель c14bad8dae
Коммит 92b4269cac
5 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -2495,8 +2495,7 @@ PaintBackgroundLayer(nsPresContext* aPresContext,
}
}
if (aRenderingContext.ThebesContext()->GetFlags() &
gfxContext::FLAG_DESTINED_FOR_SCREEN) {
if (aFlags & nsCSSRendering::PAINTBG_TO_WINDOW) {
// Clip background-attachment:fixed backgrounds to the viewport, if we're
// painting to the screen. This avoids triggering tiling in common cases,
// without affecting output since drawing is always clipped to the viewport

Просмотреть файл

@ -224,8 +224,14 @@ struct nsCSSRendering {
*/
PAINTBG_WILL_PAINT_BORDER = 0x01,
/**
* When this flag is passed, images are synchronously decoded. */
PAINTBG_SYNC_DECODE_IMAGES = 0x02
* When this flag is passed, images are synchronously decoded.
*/
PAINTBG_SYNC_DECODE_IMAGES = 0x02,
/**
* When this flag is passed, painting will go to the screen so we can
* take advantage of the fact that it will be clipped to the viewport.
*/
PAINTBG_TO_WINDOW = 0x04
};
static void PaintBackground(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,

Просмотреть файл

@ -161,6 +161,9 @@ nsDisplayListBuilder::GetBackgroundPaintFlags() {
if (mSyncDecodeImages) {
flags |= nsCSSRendering::PAINTBG_SYNC_DECODE_IMAGES;
}
if (mIsPaintingToWindow) {
flags |= nsCSSRendering::PAINTBG_TO_WINDOW;
}
return flags;
}

Просмотреть файл

@ -1255,7 +1255,7 @@ nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx)
{
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
f->PaintPlugin(*aCtx, mVisibleRect, GetBounds(aBuilder));
f->PaintPlugin(aBuilder, *aCtx, mVisibleRect, GetBounds(aBuilder));
}
PRBool
@ -1779,7 +1779,8 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
}
void
nsObjectFrame::PaintPlugin(nsIRenderingContext& aRenderingContext,
nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aPluginRect)
{
// Screen painting code
@ -2014,7 +2015,7 @@ nsObjectFrame::PaintPlugin(nsIRenderingContext& aRenderingContext,
nativeDraw.EndNativeDrawing();
} while (nativeDraw.ShouldRenderAgain());
nativeDraw.PaintToContext();
} else if (!(ctx->GetFlags() & gfxContext::FLAG_DESTINED_FOR_SCREEN)) {
} else if (!aBuilder->IsPaintingToWindow()) {
// Get PrintWindow dynamically since it's not present on Win2K,
// which we still support
typedef BOOL (WINAPI * PrintWindowPtr)

Просмотреть файл

@ -239,7 +239,8 @@ protected:
const nsRect& aDirtyRect, nsPoint aPt);
void PrintPlugin(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
void PaintPlugin(nsIRenderingContext& aRenderingContext,
void PaintPlugin(nsDisplayListBuilder* aBuilder,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aPluginRect);
/**