Bug 1143575. Remove ClearAllImagesExceptFront because it doesn't do anything. r=nical

ImageBridgeChild::FlushAllImages with aExceptFront==true does absolutely
nothing, so remove the parameter and remove all callers which pass true.

--HG--
extra : commitid : D7XjM7QaYjQ
extra : rebase_source : 6c8db683a98a2a340202a88d00d6d70f44a9f374
This commit is contained in:
Robert O'Callahan 2015-03-26 14:08:30 +13:00
parent dad7a2fa50
commit 84a4b59472
8 changed files with 15 additions and 47 deletions

View File

@ -1054,14 +1054,6 @@ MediaCodecReader::Seek(int64_t aTime, int64_t aEndTime)
mVideoTrack.mOutputEndOfStream = false;
mVideoTrack.mFlushed = false;
VideoFrameContainer* videoframe = mDecoder->GetVideoFrameContainer();
if (videoframe) {
layers::ImageContainer* image = videoframe->GetImageContainer();
if (image) {
image->ClearAllImagesExceptFront();
}
}
MediaBuffer* source_buffer = nullptr;
MediaSource::ReadOptions options;
options.setSeekTo(aTime, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);

View File

@ -529,11 +529,6 @@ MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime)
EnsureActive();
nsRefPtr<SeekPromise> p = mSeekPromise.Ensure(__func__);
VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
if (container && container->GetImageContainer()) {
container->GetImageContainer()->ClearAllImagesExceptFront();
}
if (mHasAudio && mHasVideo) {
// The OMXDecoder seeks/demuxes audio and video streams separately. So if
// we seek both audio and video to aTarget, the audio stream can typically

View File

@ -269,7 +269,7 @@ ImageContainer::ClearAllImages()
{
if (IsAsync()) {
// Let ImageClient release all TextureClients.
ImageBridgeChild::FlushAllImages(mImageClient, this, false);
ImageBridgeChild::FlushAllImages(mImageClient, this);
return;
}
@ -277,15 +277,6 @@ ImageContainer::ClearAllImages()
SetCurrentImageInternal(nullptr);
}
void
ImageContainer::ClearAllImagesExceptFront()
{
if (IsAsync()) {
// Let ImageClient release all TextureClients except front one.
ImageBridgeChild::FlushAllImages(mImageClient, this, true);
}
}
void
ImageContainer::SetCurrentImageInTransaction(Image *aImage)
{
@ -295,7 +286,8 @@ ImageContainer::SetCurrentImageInTransaction(Image *aImage)
SetCurrentImageInternal(aImage);
}
bool ImageContainer::IsAsync() const {
bool ImageContainer::IsAsync() const
{
return mImageClient != nullptr;
}

View File

@ -334,12 +334,6 @@ public:
*/
void ClearAllImages();
/**
* Clear all images except current one.
* Let ImageClient release all TextureClients except front one.
*/
void ClearAllImagesExceptFront();
/**
* Clear the current image.
* This function is expect to be called only from a CompositableClient

View File

@ -110,15 +110,12 @@ TextureInfo ImageClientSingle::GetTextureInfo() const
}
void
ImageClientSingle::FlushAllImages(bool aExceptFront,
AsyncTransactionWaiter* aAsyncTransactionWaiter)
ImageClientSingle::FlushAllImages(AsyncTransactionWaiter* aAsyncTransactionWaiter)
{
if (!aExceptFront) {
for (auto& b : mBuffers) {
RemoveTextureWithWaiter(b.mTextureClient, aAsyncTransactionWaiter);
}
mBuffers.Clear();
for (auto& b : mBuffers) {
RemoveTextureWithWaiter(b.mTextureClient, aAsyncTransactionWaiter);
}
mBuffers.Clear();
}
bool

View File

@ -65,8 +65,7 @@ public:
* asynchronously remove all the textures used by the image client.
*
*/
virtual void FlushAllImages(bool aExceptFront,
AsyncTransactionWaiter* aAsyncTransactionWaiter) {}
virtual void FlushAllImages(AsyncTransactionWaiter* aAsyncTransactionWaiter) {}
virtual void RemoveTexture(TextureClient* aTexture) override;
@ -102,8 +101,7 @@ public:
virtual already_AddRefed<Image> CreateImage(ImageFormat aFormat) override;
virtual void FlushAllImages(bool aExceptFront,
AsyncTransactionWaiter* aAsyncTransactionWaiter) override;
virtual void FlushAllImages(AsyncTransactionWaiter* aAsyncTransactionWaiter) override;
protected:
struct Buffer {

View File

@ -430,14 +430,14 @@ void ImageBridgeChild::DispatchImageClientUpdate(ImageClient* aClient,
}
static void FlushAllImagesSync(ImageClient* aClient, ImageContainer* aContainer,
bool aExceptFront, AsyncTransactionWaiter* aWaiter)
AsyncTransactionWaiter* aWaiter)
{
MOZ_ASSERT(aClient);
sImageBridgeChildSingleton->BeginTransaction();
if (aContainer && !aExceptFront) {
if (aContainer) {
aContainer->ClearCurrentImage();
}
aClient->FlushAllImages(aExceptFront, aWaiter);
aClient->FlushAllImages(aWaiter);
sImageBridgeChildSingleton->EndTransaction();
// This decrement is balanced by the increment in FlushAllImages.
// If any AsyncTransactionTrackers were created by FlushAllImages and attached
@ -448,7 +448,7 @@ static void FlushAllImagesSync(ImageClient* aClient, ImageContainer* aContainer,
//static
void ImageBridgeChild::FlushAllImages(ImageClient* aClient,
ImageContainer* aContainer, bool aExceptFront)
ImageContainer* aContainer)
{
if (!IsCreated()) {
return;
@ -467,7 +467,7 @@ void ImageBridgeChild::FlushAllImages(ImageClient* aClient,
sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
FROM_HERE,
NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, waiter));
NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, waiter));
waiter->WaitComplete();
}

View File

@ -219,7 +219,7 @@ public:
/**
* Flush all Images sent to CompositableHost.
*/
static void FlushAllImages(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront);
static void FlushAllImages(ImageClient* aClient, ImageContainer* aContainer);
// CompositableForwarder