Bug 1215438 - Part 4: Rename CairoImage to SourceSurfaceImage. r=roc

--HG--
extra : commitid : H9H2n8GsBOK
This commit is contained in:
Morris Tseng 2015-12-18 14:52:16 +08:00
parent f76ed9c612
commit ef261c0b38
10 changed files with 21 additions and 22 deletions

View File

@ -146,15 +146,14 @@ CropAndCopyDataSourceSurface(DataSourceSurface* aSurface, const IntRect& aCropRe
}
/*
* Encapsulate the given _aSurface_ into a layers::CairoImage.
* Encapsulate the given _aSurface_ into a layers::SourceSurfaceImage.
*/
static already_AddRefed<layers::Image>
CreateImageFromSurface(SourceSurface* aSurface)
{
MOZ_ASSERT(aSurface);
RefPtr<layers::CairoImage> image =
new layers::CairoImage(aSurface->GetSize(), aSurface);
RefPtr<layers::SourceSurfaceImage> image =
new layers::SourceSurfaceImage(aSurface->GetSize(), aSurface);
return image.forget();
}
@ -251,13 +250,13 @@ CreateImageFromRawData(const gfx::IntSize& aSize,
/*
* This is a synchronous task.
* This class is used to create a layers::CairoImage from raw data in the main
* This class is used to create a layers::SourceSurfaceImage from raw data in the main
* thread. While creating an ImageBitmap from an ImageData, we need to create
* a SouceSurface from the ImageData's raw data and then set the SourceSurface
* into a layers::CairoImage. However, the layers::CairoImage asserts the
* into a layers::SourceSurfaceImage. However, the layers::SourceSurfaceImage asserts the
* setting operation in the main thread, so if we are going to create an
* ImageBitmap from an ImageData off the main thread, we post an event to the
* main thread to create a layers::CairoImage from an ImageData's raw data.
* main thread to create a layers::SourceSurfaceImage from an ImageData's raw data.
*/
class CreateImageFromRawDataInMainThreadSyncTask final :
public WorkerMainThreadRunnable

View File

@ -1173,7 +1173,7 @@ void
HTMLCanvasElement::SetFrameCapture(already_AddRefed<SourceSurface> aSurface)
{
RefPtr<SourceSurface> surface = aSurface;
RefPtr<CairoImage> image = new CairoImage(surface->GetSize(), surface);
RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surface->GetSize(), surface);
// Loop backwards to allow removing elements in the loop.
for (int i = mRequestedFrameListeners.Length() - 1; i >= 0; --i) {

View File

@ -196,7 +196,7 @@ MediaEngineTabVideoSource::NotifyPull(MediaStreamGraph*,
MonitorAutoLock mon(mMonitor);
// Note: we're not giving up mImage here
RefPtr<layers::CairoImage> image = mImage;
RefPtr<layers::SourceSurfaceImage> image = mImage;
StreamTime delta = aDesiredTime - aSource->GetEndOfAppendedData(aID);
if (delta > 0) {
// nullptr images are allowed
@ -298,7 +298,7 @@ MediaEngineTabVideoSource::Draw() {
return;
}
RefPtr<layers::CairoImage> image = new layers::CairoImage(size, surface);
RefPtr<layers::SourceSurfaceImage> image = new layers::SourceSurfaceImage(size, surface);
MonitorAutoLock mon(mMonitor);
mImage = image;

View File

@ -88,7 +88,7 @@ private:
ScopedFreePtr<unsigned char> mData;
size_t mDataSize;
nsCOMPtr<nsIDOMWindow> mWindow;
RefPtr<layers::CairoImage> mImage;
RefPtr<layers::SourceSurfaceImage> mImage;
nsCOMPtr<nsITimer> mTimer;
Monitor mMonitor;
nsCOMPtr<nsITabSource> mTabSource;

View File

@ -957,7 +957,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
RefPtr<gfx::SourceSurface> sourceSurface =
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
RefPtr<CairoImage> image = new CairoImage(surface->GetSize(), sourceSurface);
RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surface->GetSize(), sourceSurface);
nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
imageList.AppendElement(

View File

@ -549,18 +549,18 @@ PlanarYCbCrImage::GetAsSourceSurface()
return surface.forget();
}
CairoImage::CairoImage(const gfx::IntSize& aSize, gfx::SourceSurface* aSourceSurface)
SourceSurfaceImage::SourceSurfaceImage(const gfx::IntSize& aSize, gfx::SourceSurface* aSourceSurface)
: Image(nullptr, ImageFormat::CAIRO_SURFACE),
mSize(aSize),
mSourceSurface(aSourceSurface)
{}
CairoImage::~CairoImage()
SourceSurfaceImage::~SourceSurfaceImage()
{
}
TextureClient*
CairoImage::GetTextureClient(CompositableClient *aClient)
SourceSurfaceImage::GetTextureClient(CompositableClient *aClient)
{
if (!aClient) {
return nullptr;

View File

@ -807,11 +807,11 @@ protected:
};
/**
* Currently, the data in a CairoImage surface is treated as being in the
* Currently, the data in a SourceSurfaceImage surface is treated as being in the
* device output color space. This class is very simple as all backends
* have to know about how to deal with drawing a cairo image.
*/
class CairoImage final : public Image {
class SourceSurfaceImage final : public Image {
public:
virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override
{
@ -823,8 +823,8 @@ public:
virtual gfx::IntSize GetSize() override { return mSize; }
CairoImage(const gfx::IntSize& aSize, gfx::SourceSurface* aSourceSurface);
~CairoImage();
SourceSurfaceImage(const gfx::IntSize& aSize, gfx::SourceSurface* aSourceSurface);
~SourceSurfaceImage();
private:
gfx::IntSize mSize;

View File

@ -41,7 +41,7 @@ enum class ImageFormat {
SHARED_RGB,
/**
* The CAIRO_SURFACE format creates a CairoImage. All backends should
* The CAIRO_SURFACE format creates a SourceSurfaceImage. All backends should
* support this format, because video rendering sometimes requires it.
*
* This format is useful even though a PaintedLayer could be used.

View File

@ -632,7 +632,7 @@ RasterImage::GetCurrentImage(ImageContainer* aContainer, uint32_t aFlags)
GetWidth(&size.width);
GetHeight(&size.height);
RefPtr<layers::Image> image = new layers::CairoImage(size, surface);
RefPtr<layers::Image> image = new layers::SourceSurfaceImage(size, surface);
return MakePair(drawResult, Move(image));
}

View File

@ -6116,7 +6116,7 @@ ContainerState::CreateMaskLayer(Layer *aLayer,
container = aLayer->Manager()->CreateImageContainer();
NS_ASSERTION(container, "Could not create image container for mask layer.");
RefPtr<CairoImage> image = new CairoImage(surfaceSizeInt, surface);
RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surfaceSizeInt, surface);
container->SetCurrentImageInTransaction(image);
GetMaskLayerImageCache()->PutImage(newKey.forget(), container);