Bug 757380 - Check clip before creating group target. r=Bas

This commit is contained in:
Oleg Romashin 2012-05-23 20:56:40 -04:00
Родитель d1e9a97fc8
Коммит 7cae773939
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -1976,7 +1976,8 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
nsRefPtr<gfxContext> groupTarget;
nsRefPtr<gfxASurface> untransformedSurface;
if (!is2D) {
bool clipIsEmpty = aTarget->GetClipExtents().IsEmpty();
if (!is2D && !clipIsEmpty) {
untransformedSurface =
gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(bounds.width, bounds.height),
gfxASurface::CONTENT_COLOR_ALPHA);
@ -1994,7 +1995,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
}
untransformedSurface->SetDeviceOffset(gfxPoint(-bounds.x, -bounds.y));
groupTarget = new gfxContext(untransformedSurface);
} else if (needsGroup) {
} else if (needsGroup && !clipIsEmpty) {
groupTarget = PushGroupForLayer(aTarget, aLayer, aLayer->GetEffectiveVisibleRegion(),
&needsClipToVisibleRegion);
} else {
@ -2051,9 +2052,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
// Temporary fast fix for bug 725886
// Revert these changes when 725886 is ready
gfxRect clipExtents;
clipExtents = aTarget->GetClipExtents();
if (!clipExtents.IsEmpty()) {
if (!clipIsEmpty) {
gfxPoint offset;
bool dontBlit = needsClipToVisibleRegion || mTransactionIncomplete ||
aLayer->GetEffectiveOpacity() != 1.0f;