зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1215438 - Part 4: Rename CairoImage to SourceSurfaceImage. r=roc
--HG-- extra : commitid : H9H2n8GsBOK
This commit is contained in:
Родитель
f76ed9c612
Коммит
ef261c0b38
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче