Bug 1256693 - Refer to ClientIPCAllocator instead of ISurfaceAllocator where it makes sense. r=sotaro
This commit is contained in:
@@ -288,7 +288,7 @@ ChooseBufferBits(const SurfaceCaps& caps,
|
||||
|
||||
SurfaceFactory::SurfaceFactory(SharedSurfaceType type, GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
: mType(type)
|
||||
, mGL(gl)
|
||||
|
||||
@@ -39,7 +39,7 @@ class DrawTarget;
|
||||
} // namespace gfx
|
||||
|
||||
namespace layers {
|
||||
class ISurfaceAllocator;
|
||||
class ClientIPCAllocator;
|
||||
class SharedSurfaceTextureClient;
|
||||
enum class TextureFlags : uint32_t;
|
||||
class SurfaceDescriptor;
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
const SharedSurfaceType mType;
|
||||
GLContext* const mGL;
|
||||
const SurfaceCaps mCaps;
|
||||
const RefPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
const RefPtr<layers::ClientIPCAllocator> mAllocator;
|
||||
const layers::TextureFlags mFlags;
|
||||
const GLFormats mFormats;
|
||||
Mutex mMutex;
|
||||
@@ -280,7 +280,7 @@ protected:
|
||||
RefSet<layers::SharedSurfaceTextureClient> mRecycleTotalPool;
|
||||
|
||||
SurfaceFactory(SharedSurfaceType type, GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
public:
|
||||
|
||||
@@ -330,7 +330,7 @@ SharedSurface_ANGLEShareHandle::ReadbackBySharedHandle(gfx::DataSourceSurface* o
|
||||
|
||||
/*static*/ UniquePtr<SurfaceFactory_ANGLEShareHandle>
|
||||
SurfaceFactory_ANGLEShareHandle::Create(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
{
|
||||
GLLibraryEGL* egl = &sEGLLibrary;
|
||||
@@ -350,7 +350,7 @@ SurfaceFactory_ANGLEShareHandle::Create(GLContext* gl, const SurfaceCaps& caps,
|
||||
|
||||
SurfaceFactory_ANGLEShareHandle::SurfaceFactory_ANGLEShareHandle(GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags,
|
||||
GLLibraryEGL* egl,
|
||||
EGLConfig config)
|
||||
|
||||
@@ -89,12 +89,12 @@ protected:
|
||||
public:
|
||||
static UniquePtr<SurfaceFactory_ANGLEShareHandle> Create(GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
protected:
|
||||
SurfaceFactory_ANGLEShareHandle(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags, GLLibraryEGL* egl,
|
||||
EGLConfig config);
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ SharedSurface_D3D11Interop::ToSurfaceDescriptor(layers::SurfaceDescriptor* const
|
||||
|
||||
/*static*/ UniquePtr<SurfaceFactory_D3D11Interop>
|
||||
SurfaceFactory_D3D11Interop::Create(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
{
|
||||
WGLLibrary* wgl = &sWGLLib;
|
||||
@@ -394,7 +394,7 @@ SurfaceFactory_D3D11Interop::Create(GLContext* gl, const SurfaceCaps& caps,
|
||||
|
||||
SurfaceFactory_D3D11Interop::SurfaceFactory_D3D11Interop(GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags,
|
||||
const RefPtr<DXGLDevice>& dxgl)
|
||||
: SurfaceFactory(SharedSurfaceType::DXGLInterop2, gl, caps, allocator, flags)
|
||||
|
||||
@@ -85,12 +85,12 @@ public:
|
||||
|
||||
static UniquePtr<SurfaceFactory_D3D11Interop> Create(GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
protected:
|
||||
SurfaceFactory_D3D11Interop(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags,
|
||||
const RefPtr<DXGLDevice>& dxgl);
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ SharedSurface_EGLImage::ReadbackBySharedHandle(gfx::DataSourceSurface* out_surfa
|
||||
|
||||
/*static*/ UniquePtr<SurfaceFactory_EGLImage>
|
||||
SurfaceFactory_EGLImage::Create(GLContext* prodGL, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
{
|
||||
EGLContext context = GLContextEGL::Cast(prodGL)->mContext;
|
||||
|
||||
@@ -96,14 +96,14 @@ public:
|
||||
// Fallible:
|
||||
static UniquePtr<SurfaceFactory_EGLImage> Create(GLContext* prodGL,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
protected:
|
||||
const EGLContext mContext;
|
||||
|
||||
SurfaceFactory_EGLImage(GLContext* prodGL, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags,
|
||||
EGLContext context)
|
||||
: SurfaceFactory(SharedSurfaceType::EGLImageShare, prodGL, caps, allocator, flags)
|
||||
|
||||
@@ -149,7 +149,7 @@ class SurfaceFactory_GLTexture
|
||||
public:
|
||||
SurfaceFactory_GLTexture(GLContext* prodGL,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
: SurfaceFactory(SharedSurfaceType::SharedGLTexture, prodGL, caps, allocator, flags)
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ SharedSurface_GLXDrawable::ReadbackBySharedHandle(gfx::DataSourceSurface* out_su
|
||||
UniquePtr<SurfaceFactory_GLXDrawable>
|
||||
SurfaceFactory_GLXDrawable::Create(GLContext* prodGL,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
{
|
||||
MOZ_ASSERT(caps.alpha, "GLX surfaces require an alpha channel!");
|
||||
|
||||
@@ -49,14 +49,14 @@ class SurfaceFactory_GLXDrawable
|
||||
public:
|
||||
static UniquePtr<SurfaceFactory_GLXDrawable> Create(GLContext* prodGL,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
virtual UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override;
|
||||
|
||||
private:
|
||||
SurfaceFactory_GLXDrawable(GLContext* prodGL, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
: SurfaceFactory(SharedSurfaceType::GLXDrawable, prodGL, caps, allocator, flags)
|
||||
{ }
|
||||
|
||||
@@ -35,7 +35,7 @@ using namespace mozilla::layers;
|
||||
using namespace android;
|
||||
|
||||
SurfaceFactory_Gralloc::SurfaceFactory_Gralloc(GLContext* prodGL, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
: SurfaceFactory(SharedSurfaceType::Gralloc, prodGL, caps, allocator, flags)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ SharedSurface_Gralloc::Create(GLContext* prodGL,
|
||||
const gfx::IntSize& size,
|
||||
bool hasAlpha,
|
||||
layers::TextureFlags flags,
|
||||
ISurfaceAllocator* allocator)
|
||||
ClientIPCAllocator* allocator)
|
||||
{
|
||||
GLLibraryEGL* egl = &sEGLLibrary;
|
||||
MOZ_ASSERT(egl);
|
||||
@@ -118,7 +118,7 @@ SharedSurface_Gralloc::SharedSurface_Gralloc(GLContext* prodGL,
|
||||
const gfx::IntSize& size,
|
||||
bool hasAlpha,
|
||||
GLLibraryEGL* egl,
|
||||
layers::ISurfaceAllocator* allocator,
|
||||
layers::ClientIPCAllocator* allocator,
|
||||
layers::TextureClient* textureClient,
|
||||
GLuint prodTex)
|
||||
: SharedSurface(SharedSurfaceType::Gralloc,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
class ISurfaceAllocator;
|
||||
class ClientIPCAllocator;
|
||||
class TextureClient;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
const gfx::IntSize& size,
|
||||
bool hasAlpha,
|
||||
layers::TextureFlags flags,
|
||||
layers::ISurfaceAllocator* allocator);
|
||||
layers::ClientIPCAllocator* allocator);
|
||||
|
||||
static SharedSurface_Gralloc* Cast(SharedSurface* surf) {
|
||||
MOZ_ASSERT(surf->mType == SharedSurfaceType::Gralloc);
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
protected:
|
||||
GLLibraryEGL* const mEGL;
|
||||
EGLSync mSync;
|
||||
RefPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
RefPtr<layers::ClientIPCAllocator> mAllocator;
|
||||
RefPtr<layers::TextureClient> mTextureClient;
|
||||
const GLuint mProdTex;
|
||||
|
||||
@@ -48,7 +48,7 @@ protected:
|
||||
const gfx::IntSize& size,
|
||||
bool hasAlpha,
|
||||
GLLibraryEGL* egl,
|
||||
layers::ISurfaceAllocator* allocator,
|
||||
layers::ClientIPCAllocator* allocator,
|
||||
layers::TextureClient* textureClient,
|
||||
GLuint prodTex);
|
||||
|
||||
@@ -83,7 +83,7 @@ class SurfaceFactory_Gralloc
|
||||
{
|
||||
public:
|
||||
SurfaceFactory_Gralloc(GLContext* prodGL, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
|
||||
virtual UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override {
|
||||
|
||||
@@ -212,7 +212,7 @@ SharedSurface_IOSurface::ReadbackBySharedHandle(gfx::DataSourceSurface* out_surf
|
||||
|
||||
/*static*/ UniquePtr<SurfaceFactory_IOSurface>
|
||||
SurfaceFactory_IOSurface::Create(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags)
|
||||
{
|
||||
gfx::IntSize maxDims(MacIOSurface::GetMaxWidth(),
|
||||
|
||||
@@ -77,13 +77,13 @@ public:
|
||||
// Infallible.
|
||||
static UniquePtr<SurfaceFactory_IOSurface> Create(GLContext* gl,
|
||||
const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags);
|
||||
protected:
|
||||
const gfx::IntSize mMaxDims;
|
||||
|
||||
SurfaceFactory_IOSurface(GLContext* gl, const SurfaceCaps& caps,
|
||||
const RefPtr<layers::ISurfaceAllocator>& allocator,
|
||||
const RefPtr<layers::ClientIPCAllocator>& allocator,
|
||||
const layers::TextureFlags& flags,
|
||||
const gfx::IntSize& maxDims)
|
||||
: SurfaceFactory(SharedSurfaceType::IOSurface, gl, caps, allocator, flags)
|
||||
|
||||
@@ -25,16 +25,16 @@ public:
|
||||
static MemoryTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend,TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator*) override;
|
||||
virtual void Deallocate(ClientIPCAllocator*) override;
|
||||
|
||||
MemoryTextureData(const BufferDescriptor& aDesc,
|
||||
gfx::BackendType aMoz2DBackend,
|
||||
@@ -62,16 +62,16 @@ public:
|
||||
static ShmemTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override;
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override;
|
||||
|
||||
ShmemTextureData(const BufferDescriptor& aDesc,
|
||||
gfx::BackendType aMoz2DBackend, mozilla::ipc::Shmem aShmem)
|
||||
@@ -111,7 +111,7 @@ BufferTextureData*
|
||||
BufferTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (!aAllocator || aAllocator->IsSameProcess()) {
|
||||
return MemoryTextureData::Create(aSize, aFormat, aMoz2DBackend, aFlags,
|
||||
@@ -124,7 +124,7 @@ BufferTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
BufferTextureData*
|
||||
BufferTextureData::CreateInternal(ISurfaceAllocator* aAllocator,
|
||||
BufferTextureData::CreateInternal(ClientIPCAllocator* aAllocator,
|
||||
const BufferDescriptor& aDesc,
|
||||
gfx::BackendType aMoz2DBackend,
|
||||
int32_t aBufferSize,
|
||||
@@ -151,7 +151,7 @@ BufferTextureData::CreateInternal(ISurfaceAllocator* aAllocator,
|
||||
}
|
||||
|
||||
BufferTextureData*
|
||||
BufferTextureData::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
BufferTextureData::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
int32_t aBufferSize,
|
||||
TextureFlags aTextureFlags)
|
||||
@@ -170,7 +170,7 @@ BufferTextureData::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
}
|
||||
|
||||
BufferTextureData*
|
||||
BufferTextureData::CreateForYCbCr(ISurfaceAllocator* aAllocator,
|
||||
BufferTextureData::CreateForYCbCr(ClientIPCAllocator* aAllocator,
|
||||
gfx::IntSize aYSize,
|
||||
gfx::IntSize aCbCrSize,
|
||||
StereoMode aStereoMode,
|
||||
@@ -429,7 +429,7 @@ MemoryTextureData*
|
||||
MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
// Should have used CreateForYCbCr.
|
||||
MOZ_ASSERT(aFormat != gfx::SurfaceFormat::YUV);
|
||||
@@ -462,7 +462,7 @@ MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
void
|
||||
MemoryTextureData::Deallocate(ISurfaceAllocator*)
|
||||
MemoryTextureData::Deallocate(ClientIPCAllocator*)
|
||||
{
|
||||
MOZ_ASSERT(mBuffer);
|
||||
GfxMemoryImageReporter::WillFree(mBuffer);
|
||||
@@ -471,7 +471,7 @@ MemoryTextureData::Deallocate(ISurfaceAllocator*)
|
||||
}
|
||||
|
||||
TextureData*
|
||||
MemoryTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
MemoryTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -496,7 +496,7 @@ ShmemTextureData*
|
||||
ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aAllocator);
|
||||
// Should have used CreateForYCbCr.
|
||||
@@ -539,7 +539,7 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
TextureData*
|
||||
ShmemTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
ShmemTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -548,7 +548,7 @@ ShmemTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
}
|
||||
|
||||
void
|
||||
ShmemTextureData::Deallocate(ISurfaceAllocator* aAllocator)
|
||||
ShmemTextureData::Deallocate(ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
aAllocator->AsShmemAllocator()->DeallocShmem(mShmem);
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ public:
|
||||
static BufferTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend,TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
static BufferTextureData* CreateForYCbCr(ISurfaceAllocator* aAllocator,
|
||||
static BufferTextureData* CreateForYCbCr(ClientIPCAllocator* aAllocator,
|
||||
gfx::IntSize aYSize,
|
||||
gfx::IntSize aCbCrSize,
|
||||
StereoMode aStereoMode,
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
// It is generally better to use CreateForYCbCr instead.
|
||||
// This creates a half-initialized texture since we don't know the sizes and
|
||||
// offsets in the buffer.
|
||||
static BufferTextureData* CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
static BufferTextureData* CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
int32_t aSize,
|
||||
TextureFlags aTextureFlags);
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
void SetDesciptor(const BufferDescriptor& aDesc);
|
||||
|
||||
protected:
|
||||
static BufferTextureData* CreateInternal(ISurfaceAllocator* aAllocator,
|
||||
static BufferTextureData* CreateInternal(ClientIPCAllocator* aAllocator,
|
||||
const BufferDescriptor& aDesc,
|
||||
gfx::BackendType aMoz2DBackend,
|
||||
int32_t aBufferSize,
|
||||
|
||||
@@ -73,7 +73,7 @@ GrallocImage::SetData(const Data& aData)
|
||||
return false;
|
||||
}
|
||||
|
||||
ISurfaceAllocator* allocator = ImageBridgeChild::GetSingleton();
|
||||
ClientIPCAllocator* allocator = ImageBridgeChild::GetSingleton();
|
||||
GrallocTextureData* texData = GrallocTextureData::Create(mData.mYSize, HAL_PIXEL_FORMAT_YV12,
|
||||
gfx::BackendType::NONE,
|
||||
GraphicBuffer::USAGE_SW_READ_OFTEN |
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
static
|
||||
DIBTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat);
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override
|
||||
{
|
||||
mSurface = nullptr;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
static
|
||||
DIBTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
void DeallocateData()
|
||||
{
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override
|
||||
{
|
||||
DeallocateData();
|
||||
}
|
||||
@@ -125,7 +125,7 @@ DIBTextureData::BorrowDrawTarget()
|
||||
|
||||
DIBTextureData*
|
||||
DIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (!aAllocator) {
|
||||
return nullptr;
|
||||
@@ -141,7 +141,7 @@ DIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
TextureData*
|
||||
MemoryDIBTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
MemoryDIBTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -204,7 +204,7 @@ MemoryDIBTextureData::UpdateFromSurface(gfx::SourceSurface* aSurface)
|
||||
}
|
||||
|
||||
TextureData*
|
||||
ShmemDIBTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
ShmemDIBTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -268,7 +268,7 @@ ShmemDIBTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
|
||||
|
||||
DIBTextureData*
|
||||
ShmemDIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aAllocator->AsLayerForwarder()->GetParentPid() != base::ProcessId());
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
static
|
||||
DIBTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
protected:
|
||||
DIBTextureData(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
|
||||
@@ -96,13 +96,13 @@ X11TextureData::UpdateFromSurface(gfx::SourceSurface* aSurface)
|
||||
}
|
||||
|
||||
void
|
||||
X11TextureData::Deallocate(ISurfaceAllocator*)
|
||||
X11TextureData::Deallocate(ClientIPCAllocator*)
|
||||
{
|
||||
mSurface = nullptr;
|
||||
}
|
||||
|
||||
TextureData*
|
||||
X11TextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
X11TextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -111,7 +111,7 @@ X11TextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
|
||||
X11TextureData*
|
||||
X11TextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
TextureFlags aFlags, ISurfaceAllocator* aAllocator)
|
||||
TextureFlags aFlags, ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aSize.width >= 0 && aSize.height >= 0);
|
||||
if (aSize.width <= 0 || aSize.height <= 0 ||
|
||||
|
||||
@@ -17,7 +17,7 @@ class X11TextureData : public TextureData
|
||||
{
|
||||
public:
|
||||
static X11TextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
TextureFlags aFlags, ISurfaceAllocator* aAllocator);
|
||||
TextureFlags aFlags, ClientIPCAllocator* aAllocator);
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
@@ -35,10 +35,10 @@ public:
|
||||
|
||||
virtual bool HasIntermediateBuffer() const override { return false; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator*) override;
|
||||
virtual void Deallocate(ClientIPCAllocator*) override;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ static inline void SwapRB_R8G8B8A8(uint8_t* pixel) {
|
||||
|
||||
class TexClientFactory
|
||||
{
|
||||
ISurfaceAllocator* const mAllocator;
|
||||
ClientIPCAllocator* const mAllocator;
|
||||
const bool mHasAlpha;
|
||||
const gfx::IntSize mSize;
|
||||
const gfx::BackendType mBackendType;
|
||||
@@ -192,7 +192,7 @@ class TexClientFactory
|
||||
const LayersBackend mLayersBackend;
|
||||
|
||||
public:
|
||||
TexClientFactory(ISurfaceAllocator* allocator, bool hasAlpha,
|
||||
TexClientFactory(ClientIPCAllocator* allocator, bool hasAlpha,
|
||||
const gfx::IntSize& size, gfx::BackendType backendType,
|
||||
TextureFlags baseTexFlags, LayersBackend layersBackend)
|
||||
: mAllocator(allocator)
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
};
|
||||
|
||||
static already_AddRefed<TextureClient>
|
||||
TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator,
|
||||
TexClientFromReadback(SharedSurface* src, ClientIPCAllocator* allocator,
|
||||
TextureFlags baseFlags, LayersBackend layersBackend)
|
||||
{
|
||||
auto backendType = gfx::BackendType::CAIRO;
|
||||
|
||||
@@ -65,7 +65,7 @@ RemoveTextureFromCompositableTracker::ReleaseTextureClient()
|
||||
!mTextureClient->GetAllocator()->UsesImageBridge())
|
||||
{
|
||||
TextureClientReleaseTask* task = new TextureClientReleaseTask(mTextureClient);
|
||||
RefPtr<ISurfaceAllocator> allocator = mTextureClient->GetAllocator();
|
||||
RefPtr<ClientIPCAllocator> allocator = mTextureClient->GetAllocator();
|
||||
mTextureClient = nullptr;
|
||||
allocator->AsClientAllocator()->GetMessageLoop()->PostTask(FROM_HERE, task);
|
||||
} else {
|
||||
|
||||
@@ -73,7 +73,7 @@ struct TextureDeallocParams
|
||||
{
|
||||
TextureData* data;
|
||||
RefPtr<TextureChild> actor;
|
||||
RefPtr<ISurfaceAllocator> allocator;
|
||||
RefPtr<ClientIPCAllocator> allocator;
|
||||
bool clientDeallocation;
|
||||
bool syncDeallocation;
|
||||
bool workAroundSharedSurfaceOwnershipIssue;
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
|
||||
CompositableForwarder* GetForwarder() { return mForwarder; }
|
||||
|
||||
ISurfaceAllocator* GetAllocator() { return mForwarder; }
|
||||
ClientIPCAllocator* GetAllocator() { return mForwarder; }
|
||||
|
||||
void ActorDestroy(ActorDestroyReason why) override;
|
||||
|
||||
@@ -189,7 +189,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAllocator,
|
||||
static void DestroyTextureData(TextureData* aTextureData, ClientIPCAllocator* aAllocator,
|
||||
bool aDeallocate, bool aMainThreadOnly)
|
||||
{
|
||||
if (!aTextureData) {
|
||||
@@ -197,7 +197,7 @@ static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAl
|
||||
}
|
||||
|
||||
if (aMainThreadOnly && !NS_IsMainThread()) {
|
||||
RefPtr<ISurfaceAllocator> allocatorRef = aAllocator;
|
||||
RefPtr<ClientIPCAllocator> allocatorRef = aAllocator;
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction([aTextureData, allocatorRef, aDeallocate]() -> void {
|
||||
DestroyTextureData(aTextureData, allocatorRef, aDeallocate, true);
|
||||
}));
|
||||
@@ -283,7 +283,7 @@ DeallocateTextureClient(TextureDeallocParams params)
|
||||
|
||||
if (!ipdlMsgLoop) {
|
||||
// If we don't have a message loop we can't know for sure that we are in
|
||||
// the IPDL thread and use the ISurfaceAllocator.
|
||||
// the IPDL thread and use the ClientIPCAllocator.
|
||||
// This should ideally not happen outside of gtest, but some shutdown raciness
|
||||
// could put us in this situation.
|
||||
params.allocator = nullptr;
|
||||
@@ -831,7 +831,7 @@ TextureClient::CreateForDrawing(CompositableForwarder* aAllocator,
|
||||
|
||||
// static
|
||||
already_AddRefed<TextureClient>
|
||||
TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator,
|
||||
TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
gfx::IntSize aSize,
|
||||
gfx::BackendType aMoz2DBackend,
|
||||
@@ -864,7 +864,7 @@ TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator,
|
||||
|
||||
// static
|
||||
already_AddRefed<TextureClient>
|
||||
TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator,
|
||||
TextureClient::CreateForYCbCr(ClientIPCAllocator* aAllocator,
|
||||
gfx::IntSize aYSize,
|
||||
gfx::IntSize aCbCrSize,
|
||||
StereoMode aStereoMode,
|
||||
@@ -891,7 +891,7 @@ TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator,
|
||||
|
||||
// static
|
||||
already_AddRefed<TextureClient>
|
||||
TextureClient::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
TextureClient::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
size_t aSize,
|
||||
TextureFlags aTextureFlags)
|
||||
@@ -912,7 +912,7 @@ TextureClient::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
return MakeAndAddRef<TextureClient>(data, aTextureFlags, aAllocator);
|
||||
}
|
||||
|
||||
TextureClient::TextureClient(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator)
|
||||
TextureClient::TextureClient(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator)
|
||||
: mAllocator(aAllocator)
|
||||
, mActor(nullptr)
|
||||
, mData(aData)
|
||||
@@ -1074,7 +1074,7 @@ SyncObject::CreateSyncObject(SyncHandle aHandle)
|
||||
}
|
||||
|
||||
already_AddRefed<TextureClient>
|
||||
TextureClient::CreateWithData(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator)
|
||||
TextureClient::CreateWithData(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (!aData) {
|
||||
return nullptr;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace layers {
|
||||
class AsyncTransactionWaiter;
|
||||
class CompositableForwarder;
|
||||
class GrallocTextureData;
|
||||
class ISurfaceAllocator;
|
||||
class ClientIPCAllocator;
|
||||
class CompositableClient;
|
||||
struct PlanarYCbCrData;
|
||||
class Image;
|
||||
@@ -207,15 +207,15 @@ public:
|
||||
|
||||
virtual bool BorrowMappedYCbCrData(MappedYCbCrTextureData&) { return false; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) = 0;
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) = 0;
|
||||
|
||||
/// Depending on the texture's flags either Deallocate or Forget is called.
|
||||
virtual void Forget(ISurfaceAllocator* aAllocator) {}
|
||||
virtual void Forget(ClientIPCAllocator* aAllocator) {}
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aDescriptor) = 0;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const { return nullptr; }
|
||||
|
||||
@@ -267,12 +267,12 @@ class TextureClient
|
||||
: public AtomicRefCountedWithFinalize<TextureClient>
|
||||
{
|
||||
public:
|
||||
explicit TextureClient(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator);
|
||||
explicit TextureClient(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator);
|
||||
|
||||
virtual ~TextureClient();
|
||||
|
||||
static already_AddRefed<TextureClient>
|
||||
CreateWithData(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator);
|
||||
CreateWithData(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator);
|
||||
|
||||
// Creates and allocates a TextureClient usable with Moz2D.
|
||||
static already_AddRefed<TextureClient>
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
|
||||
// Creates and allocates a TextureClient supporting the YCbCr format.
|
||||
static already_AddRefed<TextureClient>
|
||||
CreateForYCbCr(ISurfaceAllocator* aAllocator,
|
||||
CreateForYCbCr(ClientIPCAllocator* aAllocator,
|
||||
gfx::IntSize aYSize,
|
||||
gfx::IntSize aCbCrSize,
|
||||
StereoMode aStereoMode,
|
||||
@@ -294,7 +294,7 @@ public:
|
||||
// Creates and allocates a TextureClient (can be accessed through raw
|
||||
// pointers).
|
||||
static already_AddRefed<TextureClient>
|
||||
CreateForRawBufferAccess(ISurfaceAllocator* aAllocator,
|
||||
CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
gfx::IntSize aSize,
|
||||
gfx::BackendType aMoz2dBackend,
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
// pointers) with a certain buffer size. It's unfortunate that we need this.
|
||||
// providing format and sizes could let us do more optimization.
|
||||
static already_AddRefed<TextureClient>
|
||||
CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
|
||||
CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
size_t aSize,
|
||||
TextureFlags aTextureFlags);
|
||||
@@ -581,7 +581,7 @@ public:
|
||||
|
||||
void SyncWithObject(SyncObject* aFence) { mData->SyncWithObject(aFence); }
|
||||
|
||||
ISurfaceAllocator* GetAllocator() { return mAllocator; }
|
||||
ClientIPCAllocator* GetAllocator() { return mAllocator; }
|
||||
|
||||
ITextureClientRecycleAllocator* GetRecycleAllocator() { return mRecycleAllocator; }
|
||||
void SetRecycleAllocator(ITextureClientRecycleAllocator* aAllocator);
|
||||
@@ -619,7 +619,7 @@ protected:
|
||||
bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor);
|
||||
|
||||
|
||||
RefPtr<ISurfaceAllocator> mAllocator;
|
||||
RefPtr<ClientIPCAllocator> mAllocator;
|
||||
RefPtr<TextureChild> mActor;
|
||||
RefPtr<ITextureClientRecycleAllocator> mRecycleAllocator;
|
||||
RefPtr<AsyncTransactionWaiter> mRemoveFromCompositableWaiter;
|
||||
|
||||
@@ -32,7 +32,7 @@ SharedSurfaceTextureData::~SharedSurfaceTextureData()
|
||||
{}
|
||||
|
||||
void
|
||||
SharedSurfaceTextureData::Deallocate(ISurfaceAllocator*)
|
||||
SharedSurfaceTextureData::Deallocate(ClientIPCAllocator*)
|
||||
{}
|
||||
|
||||
gfx::IntSize
|
||||
@@ -50,7 +50,7 @@ SharedSurfaceTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
|
||||
|
||||
SharedSurfaceTextureClient::SharedSurfaceTextureClient(SharedSurfaceTextureData* aData,
|
||||
TextureFlags aFlags,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
: TextureClient(aData, aFlags, aAllocator)
|
||||
{
|
||||
mWorkaroundAnnoyingSharedSurfaceLifetimeIssues = true;
|
||||
@@ -58,7 +58,7 @@ SharedSurfaceTextureClient::SharedSurfaceTextureClient(SharedSurfaceTextureData*
|
||||
|
||||
already_AddRefed<SharedSurfaceTextureClient>
|
||||
SharedSurfaceTextureClient::Create(UniquePtr<gl::SharedSurface> surf, gl::SurfaceFactory* factory,
|
||||
ISurfaceAllocator* aAllocator, TextureFlags aFlags)
|
||||
ClientIPCAllocator* aAllocator, TextureFlags aFlags)
|
||||
{
|
||||
if (!surf) {
|
||||
return nullptr;
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator*) override;
|
||||
virtual void Deallocate(ClientIPCAllocator*) override;
|
||||
|
||||
gl::SharedSurface* Surf() const { return mSurf.get(); }
|
||||
};
|
||||
@@ -64,13 +64,13 @@ class SharedSurfaceTextureClient : public TextureClient
|
||||
public:
|
||||
SharedSurfaceTextureClient(SharedSurfaceTextureData* aData,
|
||||
TextureFlags aFlags,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
~SharedSurfaceTextureClient();
|
||||
|
||||
static already_AddRefed<SharedSurfaceTextureClient>
|
||||
Create(UniquePtr<gl::SharedSurface> surf, gl::SurfaceFactory* factory,
|
||||
ISurfaceAllocator* aAllocator, TextureFlags aFlags);
|
||||
ClientIPCAllocator* aAllocator, TextureFlags aFlags);
|
||||
|
||||
virtual void SetReleaseFenceHandle(const FenceHandle& aReleaseFenceHandle) override;
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ gfxMemorySharedReadLock::GetReadCount()
|
||||
return mReadCount;
|
||||
}
|
||||
|
||||
gfxShmSharedReadLock::gfxShmSharedReadLock(ISurfaceAllocator* aAllocator)
|
||||
gfxShmSharedReadLock::gfxShmSharedReadLock(ClientIPCAllocator* aAllocator)
|
||||
: mAllocator(aAllocator)
|
||||
, mAllocSuccess(false)
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
};
|
||||
|
||||
public:
|
||||
explicit gfxShmSharedReadLock(ISurfaceAllocator* aAllocator);
|
||||
explicit gfxShmSharedReadLock(ClientIPCAllocator* aAllocator);
|
||||
|
||||
protected:
|
||||
~gfxShmSharedReadLock();
|
||||
|
||||
@@ -382,7 +382,7 @@ D3D11TextureData::Create(IntSize aSize, SurfaceFormat aFormat, TextureAllocation
|
||||
}
|
||||
|
||||
void
|
||||
D3D11TextureData::Deallocate(ISurfaceAllocator* aAllocator)
|
||||
D3D11TextureData::Deallocate(ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
mTexture = nullptr;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ already_AddRefed<TextureClient>
|
||||
CreateD3D11TextureClientWithDevice(IntSize aSize, SurfaceFormat aFormat,
|
||||
TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags,
|
||||
ID3D11Device* aDevice,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
TextureData* data = D3D11TextureData::Create(aSize, aFormat, aAllocFlags, aDevice);
|
||||
if (!data) {
|
||||
@@ -401,7 +401,7 @@ CreateD3D11TextureClientWithDevice(IntSize aSize, SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
TextureData*
|
||||
D3D11TextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
D3D11TextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
@@ -415,7 +415,7 @@ D3D11TextureData::GetDXGIResource(IDXGIResource** aOutResource)
|
||||
}
|
||||
|
||||
DXGIYCbCrTextureData*
|
||||
DXGIYCbCrTextureData::Create(ISurfaceAllocator* aAllocator,
|
||||
DXGIYCbCrTextureData::Create(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
IUnknown* aTextureY,
|
||||
IUnknown* aTextureCb,
|
||||
@@ -447,7 +447,7 @@ DXGIYCbCrTextureData::Create(ISurfaceAllocator* aAllocator,
|
||||
}
|
||||
|
||||
DXGIYCbCrTextureData*
|
||||
DXGIYCbCrTextureData::Create(ISurfaceAllocator* aAllocator,
|
||||
DXGIYCbCrTextureData::Create(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
ID3D11Texture2D* aTextureY,
|
||||
ID3D11Texture2D* aTextureCb,
|
||||
@@ -509,7 +509,7 @@ DXGIYCbCrTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
|
||||
}
|
||||
|
||||
void
|
||||
DXGIYCbCrTextureData::Deallocate(ISurfaceAllocator*)
|
||||
DXGIYCbCrTextureData::Deallocate(ClientIPCAllocator*)
|
||||
{
|
||||
mHoldRefs[0] = nullptr;
|
||||
mHoldRefs[1] = nullptr;
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const override;
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
ID3D11Texture2D* GetD3D11Texture() { return mTexture; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override;
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override;
|
||||
|
||||
D3D11TextureData* AsD3D11TextureData() override {
|
||||
return this;
|
||||
@@ -107,13 +107,13 @@ already_AddRefed<TextureClient>
|
||||
CreateD3D11extureClientWithDevice(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags,
|
||||
ID3D11Device* aDevice,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
class DXGIYCbCrTextureData : public TextureData
|
||||
{
|
||||
public:
|
||||
static DXGIYCbCrTextureData*
|
||||
Create(ISurfaceAllocator* aAllocator,
|
||||
Create(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
IUnknown* aTextureY,
|
||||
IUnknown* aTextureCb,
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
const gfx::IntSize& aSizeCbCr);
|
||||
|
||||
static DXGIYCbCrTextureData*
|
||||
Create(ISurfaceAllocator* aAllocator,
|
||||
Create(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
ID3D11Texture2D* aTextureCb,
|
||||
ID3D11Texture2D* aTextureY,
|
||||
@@ -156,9 +156,9 @@ public:
|
||||
// (ex. component alpha) because the underlying texture is always created by
|
||||
// an external producer.
|
||||
virtual DXGIYCbCrTextureData*
|
||||
CreateSimilar(ISurfaceAllocator*, TextureFlags, TextureAllocationFlags) const override { return nullptr; }
|
||||
CreateSimilar(ClientIPCAllocator*, TextureFlags, TextureAllocationFlags) const override { return nullptr; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override;
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override;
|
||||
|
||||
virtual bool UpdateFromSurface(gfx::SourceSurface*) override { return false; }
|
||||
|
||||
@@ -278,7 +278,7 @@ already_AddRefed<TextureClient>
|
||||
CreateD3D11TextureClientWithDevice(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags,
|
||||
ID3D11Device* aDevice,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -576,7 +576,7 @@ D3D9TextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
}
|
||||
|
||||
TextureData*
|
||||
D3D9TextureData::CreateSimilar(ISurfaceAllocator*, TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const
|
||||
D3D9TextureData::CreateSimilar(ClientIPCAllocator*, TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
return D3D9TextureData::Create(mSize, mFormat, aAllocFlags);
|
||||
}
|
||||
|
||||
@@ -201,14 +201,14 @@ public:
|
||||
virtual bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const override;
|
||||
|
||||
static D3D9TextureData*
|
||||
Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat, TextureAllocationFlags aFlags);
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override {}
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override {}
|
||||
|
||||
protected:
|
||||
D3D9TextureData(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
|
||||
virtual bool HasIntermediateBuffer() const override { return false; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override {}
|
||||
virtual void Deallocate(ClientIPCAllocator* aAllocator) override {}
|
||||
|
||||
IDirect3DDevice9* GetD3D9Device() { return mDevice; }
|
||||
IDirect3DTexture9* GetD3D9Texture() { return mTexture; }
|
||||
|
||||
@@ -110,7 +110,7 @@ GrallocTextureData::~GrallocTextureData()
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureData::Deallocate(ISurfaceAllocator* aAllocator)
|
||||
GrallocTextureData::Deallocate(ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aAllocator);
|
||||
if (aAllocator && aAllocator->IPCOpen()) {
|
||||
@@ -122,7 +122,7 @@ GrallocTextureData::Deallocate(ISurfaceAllocator* aAllocator)
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureData::Forget(ISurfaceAllocator* aAllocator)
|
||||
GrallocTextureData::Forget(ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aAllocator);
|
||||
if (aAllocator && aAllocator->IPCOpen()) {
|
||||
@@ -279,7 +279,7 @@ GrallocTextureData::UpdateFromSurface(gfx::SourceSurface* aSurface)
|
||||
GrallocTextureData*
|
||||
GrallocTextureData::Create(gfx::IntSize aSize, AndroidFormat aAndroidFormat,
|
||||
gfx::BackendType aMoz2dBackend, uint32_t aUsage,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (!aAllocator || !aAllocator->IPCOpen()) {
|
||||
return nullptr;
|
||||
@@ -334,7 +334,7 @@ GrallocTextureData::Create(gfx::IntSize aSize, AndroidFormat aAndroidFormat,
|
||||
GrallocTextureData*
|
||||
GrallocTextureData::CreateForDrawing(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2dBackend,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (DisableGralloc(aFormat, aSize)) {
|
||||
return nullptr;
|
||||
@@ -386,7 +386,7 @@ GrallocTextureData::GetTextureFlags() const
|
||||
// static
|
||||
GrallocTextureData*
|
||||
GrallocTextureData::CreateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
MOZ_ASSERT(aYSize.width == aCbCrSize.width * 2);
|
||||
MOZ_ASSERT(aYSize.height == aCbCrSize.height * 2);
|
||||
@@ -399,7 +399,7 @@ GrallocTextureData::CreateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize,
|
||||
// static
|
||||
GrallocTextureData*
|
||||
GrallocTextureData::CreateForGLRendering(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator)
|
||||
ClientIPCAllocator* aAllocator)
|
||||
{
|
||||
if (aFormat == gfx::SurfaceFormat::YUV) {
|
||||
return nullptr;
|
||||
@@ -435,7 +435,7 @@ GrallocTextureData::TextureClientFromSharedSurface(gl::SharedSurface* abstractSu
|
||||
}
|
||||
|
||||
TextureData*
|
||||
GrallocTextureData::CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
GrallocTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags,
|
||||
TextureAllocationFlags aAllocFlags) const
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
|
||||
#include "mozilla/layers/TextureClient.h"
|
||||
#include "mozilla/layers/ISurfaceAllocator.h" // For IsSurfaceDescriptorValid
|
||||
#include "mozilla/layers/FenceUtils.h" // for FenceHandle
|
||||
#include "mozilla/layers/ShadowLayerUtilsGralloc.h"
|
||||
#include <ui/GraphicBuffer.h>
|
||||
@@ -62,30 +61,30 @@ public:
|
||||
|
||||
virtual bool HasSynchronization() const override { return true; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator*) override;
|
||||
virtual void Deallocate(ClientIPCAllocator*) override;
|
||||
|
||||
virtual void Forget(ISurfaceAllocator*) override;
|
||||
virtual void Forget(ClientIPCAllocator*) override;
|
||||
|
||||
static GrallocTextureData* CreateForDrawing(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aMoz2dBackend,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
static GrallocTextureData* CreateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
static GrallocTextureData* CreateForGLRendering(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
static GrallocTextureData* Create(gfx::IntSize aSize, AndroidFormat aFormat,
|
||||
gfx::BackendType aMoz2DBackend, uint32_t aUsage,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
ClientIPCAllocator* aAllocator);
|
||||
|
||||
|
||||
static already_AddRefed<TextureClient>
|
||||
TextureClientFromSharedSurface(gl::SharedSurface* abstractSurf, TextureFlags flags);
|
||||
|
||||
virtual TextureData*
|
||||
CreateSimilar(ISurfaceAllocator* aAllocator,
|
||||
CreateSimilar(ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags = TextureFlags::DEFAULT,
|
||||
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ public:
|
||||
|
||||
virtual bool HasIntermediateBuffer() const override { return false; }
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator* aAllocator) override { mSurface = nullptr; }
|
||||
virtual void Deallocate(ClientIPCAllocator*) override { mSurface = nullptr; }
|
||||
|
||||
virtual void Forget(ISurfaceAllocator* aAllocator) override { mSurface = nullptr; }
|
||||
virtual void Forget(ClientIPCAllocator*) override { mSurface = nullptr; }
|
||||
|
||||
// For debugging purposes only.
|
||||
already_AddRefed<gfx::DataSourceSurface> GetAsSurface();
|
||||
|
||||
@@ -29,7 +29,7 @@ EGLImageTextureData::EGLImageTextureData(EGLImageImage* aImage, gfx::IntSize aSi
|
||||
|
||||
already_AddRefed<TextureClient>
|
||||
EGLImageTextureData::CreateTextureClient(EGLImageImage* aImage, gfx::IntSize aSize,
|
||||
ISurfaceAllocator* aAllocator, TextureFlags aFlags)
|
||||
ClientIPCAllocator* aAllocator, TextureFlags aFlags)
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||
"Can't pass an `EGLImage` between processes.");
|
||||
@@ -71,7 +71,7 @@ already_AddRefed<TextureClient>
|
||||
AndroidSurfaceTextureData::CreateTextureClient(AndroidSurfaceTexture* aSurfTex,
|
||||
gfx::IntSize aSize,
|
||||
gl::OriginPos aOriginPos,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags)
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
|
||||
static already_AddRefed<TextureClient>
|
||||
CreateTextureClient(EGLImageImage* aImage, gfx::IntSize aSize,
|
||||
ISurfaceAllocator* aAllocator, TextureFlags aFlags);
|
||||
ClientIPCAllocator* aAllocator, TextureFlags aFlags);
|
||||
|
||||
virtual bool HasIntermediateBuffer() const override { return false; }
|
||||
|
||||
@@ -34,9 +34,9 @@ public:
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual void Deallocate(ISurfaceAllocator*) override { mImage = nullptr; }
|
||||
virtual void Deallocate(ClientIPCAllocator*) override { mImage = nullptr; }
|
||||
|
||||
virtual void Forget(ISurfaceAllocator*) override { mImage = nullptr; }
|
||||
virtual void Forget(ClientIPCAllocator*) override { mImage = nullptr; }
|
||||
|
||||
// Unused functions.
|
||||
virtual bool Lock(OpenMode, FenceHandle*) override { return true; }
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
CreateTextureClient(gl::AndroidSurfaceTexture* aSurfTex,
|
||||
gfx::IntSize aSize,
|
||||
gl::OriginPos aOriginPos,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
ClientIPCAllocator* aAllocator,
|
||||
TextureFlags aFlags);
|
||||
|
||||
~AndroidSurfaceTextureData();
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
}
|
||||
|
||||
// Our data is always owned externally.
|
||||
virtual void Deallocate(ISurfaceAllocator*) override {}
|
||||
virtual void Deallocate(ClientIPCAllocator*) override {}
|
||||
|
||||
protected:
|
||||
AndroidSurfaceTextureData(gl::AndroidSurfaceTexture* aSurfTex,
|
||||
|
||||
Reference in New Issue
Block a user