mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 867758 - Add imgIContainer::SetAnimationStartTime, which lets us explicitly set the time animation starts (rather than using TimeStamp::Now()). r=seth
--HG-- extra : rebase_source : 4660937d5eb06bf83b749826d2f13da29583e9e7
This commit is contained in:
parent
06e2a4c09b
commit
5495bbbd03
@ -57,7 +57,7 @@ native nsSize(nsSize);
|
||||
*
|
||||
* Internally, imgIContainer also manages animation of images.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(4c04b27c-7a4b-4676-b04f-402ace3c3dca)]
|
||||
[scriptable, builtinclass, uuid(b56906e9-830c-45f4-b572-8c71e7619dad)]
|
||||
interface imgIContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -303,4 +303,17 @@ interface imgIContainer : nsISupports
|
||||
* animated), returns -1.
|
||||
*/
|
||||
[notxpcom] int32_t getFirstFrameDelay();
|
||||
|
||||
/*
|
||||
* If this is an animated image that hasn't started animating already, this
|
||||
* sets the animation's start time to the indicated time.
|
||||
*
|
||||
* This has no effect if the image isn't animated or it has started animating
|
||||
* already; it also has no effect if the image format doesn't care about
|
||||
* animation start time.
|
||||
*
|
||||
* In all cases, animation does not actually begin until startAnimation(),
|
||||
* resetAnimation(), or requestRefresh() is called for the first time.
|
||||
*/
|
||||
[notxpcom] void setAnimationStartTime([const] in TimeStamp aTime);
|
||||
};
|
||||
|
@ -285,5 +285,11 @@ ImageWrapper::GetFirstFrameDelay()
|
||||
return mInnerImage->GetFirstFrameDelay();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
ImageWrapper::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
|
||||
{
|
||||
mInnerImage->SetAnimationStartTime(aTime);
|
||||
}
|
||||
|
||||
} // namespace image
|
||||
} // namespace mozilla
|
||||
|
@ -1560,7 +1560,9 @@ RasterImage::StartAnimation()
|
||||
|
||||
// We need to set the time that this initial frame was first displayed, as
|
||||
// this is used in AdvanceFrame().
|
||||
mAnim->currentAnimationFrameTime = TimeStamp::Now();
|
||||
if (mAnim->currentAnimationFrameTime.IsNull()) {
|
||||
mAnim->currentAnimationFrameTime = TimeStamp::Now();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -1619,6 +1621,17 @@ RasterImage::ResetAnimation()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// [notxpcom] void requestRefresh ([const] in TimeStamp aTime);
|
||||
NS_IMETHODIMP_(void)
|
||||
RasterImage::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
|
||||
{
|
||||
if (mError || mAnimating || !mAnim)
|
||||
return;
|
||||
|
||||
mAnim->currentAnimationFrameTime = aTime;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(float)
|
||||
RasterImage::GetFrameIndex(uint32_t aWhichFrame)
|
||||
{
|
||||
|
@ -438,6 +438,12 @@ VectorImage::ShouldAnimate()
|
||||
return ImageResource::ShouldAnimate() && mIsFullyLoaded && mHaveAnimations;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
VectorImage::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
|
||||
{
|
||||
// We don't care about animation start time.
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// imgIContainer methods
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user