mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 809181 - SVGDocumentWrapper::UpdateViewportBounds() should check if anything has changed instead of relying on callers. r=dholbert
This commit is contained in:
parent
2f4c5183a5
commit
292e3a2a66
@ -122,8 +122,16 @@ SVGDocumentWrapper::UpdateViewportBounds(const nsIntSize& aViewportSize)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!mIgnoreInvalidation, "shouldn't be reentrant");
|
||||
mIgnoreInvalidation = true;
|
||||
mViewer->SetBounds(nsIntRect(nsIntPoint(0, 0), aViewportSize));
|
||||
FlushLayout();
|
||||
|
||||
nsIntRect currentBounds;
|
||||
mViewer->GetBounds(currentBounds);
|
||||
|
||||
// If the bounds have changed, we need to do a layout flush.
|
||||
if (currentBounds.Size() != aViewportSize) {
|
||||
mViewer->SetBounds(nsIntRect(nsIntPoint(0, 0), aViewportSize));
|
||||
FlushLayout();
|
||||
}
|
||||
|
||||
mIgnoreInvalidation = false;
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,6 @@ NS_IMPL_ISUPPORTS3(VectorImage,
|
||||
VectorImage::VectorImage(imgStatusTracker* aStatusTracker) :
|
||||
Image(aStatusTracker), // invoke superclass's constructor
|
||||
mRestrictedRegion(0, 0, 0, 0),
|
||||
mLastRenderedSize(0, 0),
|
||||
mIsInitialized(false),
|
||||
mIsFullyLoaded(false),
|
||||
mIsDrawing(false),
|
||||
@ -526,10 +525,7 @@ VectorImage::Draw(gfxContext* aContext,
|
||||
}
|
||||
mIsDrawing = true;
|
||||
|
||||
if (aViewportSize != mLastRenderedSize) {
|
||||
mSVGDocumentWrapper->UpdateViewportBounds(aViewportSize);
|
||||
mLastRenderedSize = aViewportSize;
|
||||
}
|
||||
mSVGDocumentWrapper->UpdateViewportBounds(aViewportSize);
|
||||
mSVGDocumentWrapper->FlushImageTransformInvalidation();
|
||||
|
||||
nsIntSize imageSize = mHaveRestrictedRegion ?
|
||||
|
@ -65,11 +65,6 @@ private:
|
||||
// that we're restricted to using.
|
||||
// Otherwise, this is ignored.
|
||||
|
||||
nsIntSize mLastRenderedSize; // The viewport-size that we've
|
||||
// most recently passed to
|
||||
// mSVGDocumentWrapper as its
|
||||
// viewport-bounds.
|
||||
|
||||
bool mIsInitialized:1; // Have we been initalized?
|
||||
bool mIsFullyLoaded:1; // Has OnStopRequest been called?
|
||||
bool mIsDrawing:1; // Are we currently drawing?
|
||||
|
Loading…
x
Reference in New Issue
Block a user