Bug 934860 - Move paint region clipping into DrawThebesLayer. r=roc

This commit is contained in:
Matt Woodrow
2013-11-07 08:10:50 +13:00
parent fe2ca5848d
commit ee60cbef45
19 changed files with 52 additions and 86 deletions

View File

@@ -3268,6 +3268,7 @@ FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
gfxContext* aContext,
const nsIntRegion& aRegionToDraw,
DrawRegionClip aClip,
const nsIntRegion& aRegionToInvalidate,
void* aCallbackData)
{
@@ -3276,6 +3277,12 @@ FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
nsDisplayListBuilder* builder = static_cast<nsDisplayListBuilder*>
(aCallbackData);
if (aClip == CLIP_DRAW_SNAPPED) {
gfxUtils::ClipToRegionSnapped(aContext, aRegionToDraw);
} else if (aClip == CLIP_DRAW) {
gfxUtils::ClipToRegion(aContext, aRegionToDraw);
}
FrameLayerBuilder *layerBuilder = aLayer->Manager()->GetLayerBuilder();
NS_ASSERTION(layerBuilder, "Unexpectedly null layer builder!");