Bug 579276. Part 13: Use CONTENT_COLOR for temporary surface in nonretained path, if possible. r=cjones

This commit is contained in:
Robert O'Callahan 2010-09-03 14:31:42 +12:00
Родитель f843ab6d56
Коммит afdeb3f001
1 изменённых файлов: 7 добавлений и 6 удалений

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

@ -397,6 +397,12 @@ BasicThebesLayer::Paint(gfxContext* aContext,
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
PRBool canUseOpaqueSurface = CanUseOpaqueSurface();
PRBool opaqueBuffer = canUseOpaqueSurface &&
targetSurface->AreSimilarSurfacesSensitiveToContentType();
Buffer::ContentType contentType =
opaqueBuffer ? gfxASurface::CONTENT_COLOR :
gfxASurface::CONTENT_COLOR_ALPHA;
if (!BasicManager()->IsRetained() ||
(aOpacity == 1.0 && !canUseOpaqueSurface &&
!ShouldRetainTransparentSurface(mContentFlags, targetSurface))) {
@ -406,7 +412,7 @@ BasicThebesLayer::Paint(gfxContext* aContext,
target->Save();
gfxUtils::ClipToRegionSnapped(target, mVisibleRegion);
if (aOpacity != 1.0) {
target->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
target->PushGroup(contentType);
}
aCallback(this, target, mVisibleRegion, nsIntRegion(), aCallbackData);
if (aOpacity != 1.0) {
@ -418,11 +424,6 @@ BasicThebesLayer::Paint(gfxContext* aContext,
}
{
PRBool opaqueBuffer = canUseOpaqueSurface &&
targetSurface->AreSimilarSurfacesSensitiveToContentType();
Buffer::ContentType contentType =
opaqueBuffer ? gfxASurface::CONTENT_COLOR :
gfxASurface::CONTENT_COLOR_ALPHA;
Buffer::PaintState state = mBuffer.BeginPaint(this, contentType);
mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);