зеркало из https://github.com/mozilla/gecko-dev.git
Bug 716140 - Create and Send OnStartFrame when a frame starts. r=seth
--HG-- extra : rebase_source : 7af770a5cc28c2a6d199e632c706330a0d582659
This commit is contained in:
Родитель
70decf9aee
Коммит
9f889623b9
|
@ -227,6 +227,11 @@ Decoder::PostFrameStart()
|
|||
// reported by the Image.
|
||||
NS_ABORT_IF_FALSE(mFrameCount == mImage.GetNumFrames(),
|
||||
"Decoder frame count doesn't match image's!");
|
||||
|
||||
// Fire notifications
|
||||
if (mObserver) {
|
||||
mObserver->OnStartFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -65,6 +65,13 @@ public:
|
|||
*/
|
||||
virtual void OnStartContainer() = 0;
|
||||
|
||||
/**
|
||||
* Decode notification.
|
||||
*
|
||||
* Called when we know a frame has begun decoding.
|
||||
*/
|
||||
virtual void OnStartFrame() = 0;
|
||||
|
||||
/**
|
||||
* Decode notification.
|
||||
*
|
||||
|
|
|
@ -76,6 +76,18 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void OnStartFrame()
|
||||
{
|
||||
LOG_SCOPE(GetImgLog(), "imgStatusTrackerObserver::OnStartFrame");
|
||||
NS_ABORT_IF_FALSE(mTracker->GetImage(),
|
||||
"OnStartFrame callback before we've created our image");
|
||||
|
||||
mTracker->RecordStartFrame();
|
||||
|
||||
// This is not observed below the imgStatusTracker level, so we don't need
|
||||
// to SendStartFrame.
|
||||
}
|
||||
|
||||
virtual void FrameChanged(const nsIntRect* dirtyRect)
|
||||
{
|
||||
LOG_SCOPE(GetImgLog(), "imgStatusTrackerObserver::FrameChanged");
|
||||
|
@ -492,6 +504,13 @@ imgStatusTracker::SendStartContainer(imgRequestProxy* aProxy)
|
|||
aProxy->OnStartContainer();
|
||||
}
|
||||
|
||||
void
|
||||
imgStatusTracker::RecordStartFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// No SendStartFrame since it's not observed below us.
|
||||
|
||||
void
|
||||
imgStatusTracker::RecordStopFrame()
|
||||
{
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
void SendStartDecode(imgRequestProxy* aProxy);
|
||||
void RecordStartContainer(imgIContainer* aContainer);
|
||||
void SendStartContainer(imgRequestProxy* aProxy);
|
||||
void RecordStartFrame();
|
||||
// No SendStartFrame since it's not observed below us.
|
||||
void RecordFrameChanged(const nsIntRect* aDirtyRect);
|
||||
void SendFrameChanged(imgRequestProxy* aProxy, const nsIntRect* aDirtyRect);
|
||||
void RecordStopFrame();
|
||||
|
|
Загрузка…
Ссылка в новой задаче