Bug 990876 - Remove TextureClientSurface. r=mattwoodrow

This commit is contained in:
Nicolas Silva 2014-04-14 21:29:42 +02:00
Родитель 46e8243a6d
Коммит f7668eb024
4 изменённых файлов: 5 добавлений и 36 удалений

Просмотреть файл

@ -16,9 +16,7 @@ namespace layers {
/**
* A TextureClient implementation based on Xlib.
*/
class TextureClientX11
: public TextureClient,
public TextureClientSurface
class TextureClientX11 : public TextureClient
{
public:
TextureClientX11(gfx::SurfaceFormat format, TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
@ -27,8 +25,6 @@ class TextureClientX11
// TextureClient
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
virtual bool IsAllocated() const MOZ_OVERRIDE;
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;

Просмотреть файл

@ -74,8 +74,8 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format),
flags,
gfxPlatform::GetPlatform()->GetPreferredCanvasBackend());
MOZ_ASSERT(mBuffer->AsTextureClientSurface());
mBuffer->AsTextureClientSurface()->AllocateForSurface(aSize);
MOZ_ASSERT(mBuffer->CanExposeDrawTarget());
mBuffer->AllocateForSurface(aSize);
bufferCreated = true;
}

Просмотреть файл

@ -50,9 +50,6 @@ class TextureClient;
/**
* TextureClient is the abstraction that allows us to share data between the
* content and the compositor side.
* TextureClient can also provide with some more "producer" facing APIs
* such as TextureClientSurface and TextureClientYCbCr, that can be queried
* using AsTextureCLientSurface(), etc.
*/
enum TextureAllocationFlags {
@ -60,23 +57,6 @@ enum TextureAllocationFlags {
ALLOC_CLEAR_BUFFER = 1
};
/**
* Interface for TextureClients that can be updated using a gfxASurface.
*/
class TextureClientSurface
{
public:
/**
* Allocates for a given surface size, taking into account the pixel format
* which is part of the state of the TextureClient.
*
* Does not clear the surface by default, clearing the surface can be done
* by passing the CLEAR_BUFFER flag.
*/
virtual bool AllocateForSurface(gfx::IntSize aSize,
TextureAllocationFlags flags = ALLOC_DEFAULT) = 0;
};
/**
* Interface for TextureClients that can be updated using YCbCr data.
*/
@ -167,7 +147,6 @@ public:
gfx::BackendType aMoz2dBackend,
const gfx::IntSize& aSizeHint);
virtual TextureClientSurface* AsTextureClientSurface() { return nullptr; }
virtual TextureClientYCbCr* AsTextureClientYCbCr() { return nullptr; }
/**
@ -410,7 +389,6 @@ protected:
* (see ShmemTextureClient and MemoryTextureClient)
*/
class BufferTextureClient : public TextureClient
, public TextureClientSurface
, public TextureClientYCbCr
{
public:
@ -435,10 +413,6 @@ public:
virtual TemporaryRef<gfx::DrawTarget> GetAsDrawTarget() MOZ_OVERRIDE;
// TextureClientSurface
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
virtual bool AllocateForSurface(gfx::IntSize aSize,
TextureAllocationFlags aFlags = ALLOC_DEFAULT) MOZ_OVERRIDE;

Просмотреть файл

@ -147,9 +147,8 @@ void AssertYCbCrSurfacesEqual(PlanarYCbCrData* surface1,
void TestTextureClientSurface(TextureClient* texture, gfxImageSurface* surface) {
// client allocation
ASSERT_TRUE(texture->AsTextureClientSurface() != nullptr);
TextureClientSurface* client = texture->AsTextureClientSurface();
client->AllocateForSurface(ToIntSize(surface->GetSize()));
ASSERT_TRUE(texture->CanExposeDrawTarget());
texture->AllocateForSurface(ToIntSize(surface->GetSize()));
ASSERT_TRUE(texture->IsAllocated());
ASSERT_TRUE(texture->Lock(OPEN_READ_WRITE));