void ImageContainerChild::SetIdleNow() { if (mStop) return; SendFlush(); ClearSharedImagePool(); mImageQueue.Clear(); }
void ImageContainerChild::DestroyNow() { NS_ABORT_IF_FALSE(InImageBridgeChildThread(), "Should be in ImageBridgeChild thread."); ClearSharedImagePool(); Send__delete__(this); }
void ImageContainerChild::DestroyNow() { NS_ABORT_IF_FALSE(InImageBridgeChildThread(), "Should be in ImageBridgeChild thread."); NS_ABORT_IF_FALSE(mDispatchedDestroy, "Incorrect state in the destruction sequence."); ClearSharedImagePool(); mImageQueue.Clear(); // will decrease the refcount and, in most cases, delete the ImageContainerChild Send__delete__(this); Release(); // corresponds to the AddRef in DispatchDestroy }
bool ImageContainerChild::AddSharedImageToPool(SharedImage* img) { NS_ABORT_IF_FALSE(InImageBridgeChildThread(), "AddSharedImageToPool must be called in the ImageBridgeChild thread"); if (mStop) return false; if (mSharedImagePool.Length() >= POOL_MAX_SHARED_IMAGES) { return false; } if (img->type()==SharedImage::TYUVImage) { nsIntRect rect = img->get_YUVImage().picture(); if ((rect.Width() != mSize.width) || (rect.Height() != mSize.height)) { ClearSharedImagePool(); mSize.width = rect.Width(); mSize.height = rect.Height(); } mSharedImagePool.AppendElement(img); return true; } return false; // TODO accept more image formats in the pool }