From ef261c0b38c4b9cf5e2c1e75ec006da980cc1375 Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Fri, 18 Dec 2015 14:52:16 +0800 Subject: [PATCH] Bug 1215438 - Part 4: Rename CairoImage to SourceSurfaceImage. r=roc --HG-- extra : commitid : H9H2n8GsBOK --- dom/canvas/ImageBitmap.cpp | 13 ++++++------- dom/html/HTMLCanvasElement.cpp | 2 +- dom/media/webrtc/MediaEngineTabVideoSource.cpp | 4 ++-- dom/media/webrtc/MediaEngineTabVideoSource.h | 2 +- dom/plugins/ipc/PluginInstanceParent.cpp | 2 +- gfx/layers/ImageContainer.cpp | 6 +++--- gfx/layers/ImageContainer.h | 8 ++++---- gfx/layers/ImageTypes.h | 2 +- image/RasterImage.cpp | 2 +- layout/base/FrameLayerBuilder.cpp | 2 +- 10 files changed, 21 insertions(+), 22 deletions(-) diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index f9d70bbdb8d5..ee6e62b31e68 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -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 CreateImageFromSurface(SourceSurface* aSurface) { MOZ_ASSERT(aSurface); - RefPtr image = - new layers::CairoImage(aSurface->GetSize(), aSurface); - + RefPtr 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 diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index 0e8a449f8acf..3722d1a0062a 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -1173,7 +1173,7 @@ void HTMLCanvasElement::SetFrameCapture(already_AddRefed aSurface) { RefPtr surface = aSurface; - RefPtr image = new CairoImage(surface->GetSize(), surface); + RefPtr image = new SourceSurfaceImage(surface->GetSize(), surface); // Loop backwards to allow removing elements in the loop. for (int i = mRequestedFrameListeners.Length() - 1; i >= 0; --i) { diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.cpp b/dom/media/webrtc/MediaEngineTabVideoSource.cpp index ac8791fbf669..e4c097cb57e4 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp @@ -196,7 +196,7 @@ MediaEngineTabVideoSource::NotifyPull(MediaStreamGraph*, MonitorAutoLock mon(mMonitor); // Note: we're not giving up mImage here - RefPtr image = mImage; + RefPtr image = mImage; StreamTime delta = aDesiredTime - aSource->GetEndOfAppendedData(aID); if (delta > 0) { // nullptr images are allowed @@ -298,7 +298,7 @@ MediaEngineTabVideoSource::Draw() { return; } - RefPtr image = new layers::CairoImage(size, surface); + RefPtr image = new layers::SourceSurfaceImage(size, surface); MonitorAutoLock mon(mMonitor); mImage = image; diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.h b/dom/media/webrtc/MediaEngineTabVideoSource.h index ee84abcf013f..8a0d3f17f393 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.h +++ b/dom/media/webrtc/MediaEngineTabVideoSource.h @@ -88,7 +88,7 @@ private: ScopedFreePtr mData; size_t mDataSize; nsCOMPtr mWindow; - RefPtr mImage; + RefPtr mImage; nsCOMPtr mTimer; Monitor mMonitor; nsCOMPtr mTabSource; diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index cac0322ef446..4b22f70946d5 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -957,7 +957,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect, RefPtr sourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface); - RefPtr image = new CairoImage(surface->GetSize(), sourceSurface); + RefPtr image = new SourceSurfaceImage(surface->GetSize(), sourceSurface); nsAutoTArray imageList; imageList.AppendElement( diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index 7fba710ca159..d2eeb49f9af4 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -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; diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index ebef6e098657..6a9ef6f960db 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -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 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; diff --git a/gfx/layers/ImageTypes.h b/gfx/layers/ImageTypes.h index 2300085c2a70..9619f2972410 100644 --- a/gfx/layers/ImageTypes.h +++ b/gfx/layers/ImageTypes.h @@ -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. diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 80fdf2d97d3f..0525243917e9 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -632,7 +632,7 @@ RasterImage::GetCurrentImage(ImageContainer* aContainer, uint32_t aFlags) GetWidth(&size.width); GetHeight(&size.height); - RefPtr image = new layers::CairoImage(size, surface); + RefPtr image = new layers::SourceSurfaceImage(size, surface); return MakePair(drawResult, Move(image)); } diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 7a9488c8034d..ed4e4f5d6f30 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -6116,7 +6116,7 @@ ContainerState::CreateMaskLayer(Layer *aLayer, container = aLayer->Manager()->CreateImageContainer(); NS_ASSERTION(container, "Could not create image container for mask layer."); - RefPtr image = new CairoImage(surfaceSizeInt, surface); + RefPtr image = new SourceSurfaceImage(surfaceSizeInt, surface); container->SetCurrentImageInTransaction(image); GetMaskLayerImageCache()->PutImage(newKey.forget(), container);