Bug 593839. Part 2: Remove DESTINED_FOR_SCREEN flag now that it's no longer used. r=vlad a=blocking-betaN

This commit is contained in:
Robert O'Callahan 2010-10-25 16:39:27 +02:00
parent 92b4269cac
commit f77d26e905
4 changed files with 1 additions and 24 deletions

View File

@ -390,16 +390,6 @@ ClipToContain(gfxContext* aContext, const nsIntRect& aRect)
aContext->SetMatrix(currentMatrix); aContext->SetMatrix(currentMatrix);
} }
static void
InheritContextFlags(gfxContext* aSource, gfxContext* aDest)
{
if (aSource->GetFlags() & gfxContext::FLAG_DESTINED_FOR_SCREEN) {
aDest->SetFlag(gfxContext::FLAG_DESTINED_FOR_SCREEN);
} else {
aDest->ClearFlag(gfxContext::FLAG_DESTINED_FOR_SCREEN);
}
}
static PRBool static PRBool
ShouldRetainTransparentSurface(PRUint32 aContentFlags, ShouldRetainTransparentSurface(PRUint32 aContentFlags,
gfxASurface* aTargetSurface) gfxASurface* aTargetSurface)
@ -493,7 +483,6 @@ BasicThebesLayer::Paint(gfxContext* aContext,
// from RGB to RGBA, because we might need to repaint with // from RGB to RGBA, because we might need to repaint with
// subpixel AA) // subpixel AA)
state.mRegionToInvalidate.And(state.mRegionToInvalidate, mVisibleRegion); state.mRegionToInvalidate.And(state.mRegionToInvalidate, mVisibleRegion);
InheritContextFlags(target, state.mContext);
mXResolution = paintXRes; mXResolution = paintXRes;
mYResolution = paintYRes; mYResolution = paintYRes;
PaintBuffer(state.mContext, PaintBuffer(state.mContext,
@ -1016,7 +1005,6 @@ BasicLayerManager::PushGroupWithCachedSurface(gfxContext *aTarget,
mCachedSurface.Get(aContent, mCachedSurface.Get(aContent,
gfxIntSize(clip.size.width, clip.size.height), gfxIntSize(clip.size.width, clip.size.height),
currentSurf); currentSurf);
InheritContextFlags(aTarget, ctx);
/* Align our buffer for the original surface */ /* Align our buffer for the original surface */
ctx->Translate(-clip.pos); ctx->Translate(-clip.pos);
*aSavedOffset = clip.pos; *aSavedOffset = clip.pos;

View File

@ -637,15 +637,7 @@ public:
* When this flag is set, snapping to device pixels is disabled. * When this flag is set, snapping to device pixels is disabled.
* It simply never does anything. * It simply never does anything.
*/ */
FLAG_DISABLE_SNAPPING = (1 << 1), FLAG_DISABLE_SNAPPING = (1 << 1)
/**
* When this flag is set, rendering through this context
* is destined to be (eventually) drawn on the screen. It can be
* useful to know this, for example so that windowed plugins are
* not unnecessarily rendered (since they will already appear
* on the screen, thanks to their windows).
*/
FLAG_DESTINED_FOR_SCREEN = (1 << 2)
}; };
void SetFlag(PRInt32 aFlag) { mFlags |= aFlag; } void SetFlag(PRInt32 aFlag) { mFlags |= aFlag; }

View File

@ -2074,7 +2074,6 @@ do {
nsPaintEvent event(PR_TRUE, NS_PAINT, this); nsPaintEvent event(PR_TRUE, NS_PAINT, this);
InitEvent(event); InitEvent(event);
nsRefPtr<gfxContext> thebesContext = new gfxContext(mThebesSurface); nsRefPtr<gfxContext> thebesContext = new gfxContext(mThebesSurface);
thebesContext->SetFlag(gfxContext::FLAG_DESTINED_FOR_SCREEN);
// Intersect the update region with the paint rectangle to clip areas // Intersect the update region with the paint rectangle to clip areas
// that aren't visible (e.g. offscreen or covered by another window). // that aren't visible (e.g. offscreen or covered by another window).

View File

@ -523,7 +523,6 @@ DDRAW_FAILED:
} }
nsRefPtr<gfxContext> thebesContext = new gfxContext(targetSurface); nsRefPtr<gfxContext> thebesContext = new gfxContext(targetSurface);
thebesContext->SetFlag(gfxContext::FLAG_DESTINED_FOR_SCREEN);
if (IsRenderMode(gfxWindowsPlatform::RENDER_DIRECT2D)) { if (IsRenderMode(gfxWindowsPlatform::RENDER_DIRECT2D)) {
const nsIntRect* r; const nsIntRect* r;
for (nsIntRegionRectIterator iter(event.region); for (nsIntRegionRectIterator iter(event.region);
@ -1045,7 +1044,6 @@ PRBool nsWindow::OnPaintImageDDraw16()
targetSurfaceImage->SetDeviceOffset(gfxPoint(-brx, -bry)); targetSurfaceImage->SetDeviceOffset(gfxPoint(-brx, -bry));
thebesContext = new gfxContext(targetSurfaceImage); thebesContext = new gfxContext(targetSurfaceImage);
thebesContext->SetFlag(gfxContext::FLAG_DESTINED_FOR_SCREEN);
thebesContext->SetFlag(gfxContext::FLAG_SIMPLIFY_OPERATORS); thebesContext->SetFlag(gfxContext::FLAG_SIMPLIFY_OPERATORS);
{ {