Bug 862106. Use Create*Client directly. r=nical

--HG--
extra : rebase_source : d903db2fcb68bbccff9548dfbcd215d9a25ba41c
This commit is contained in:
Nicholas Cameron 2013-04-17 09:36:06 +12:00
Родитель ec2b053649
Коммит 9a37c9d3fd
12 изменённых файлов: 24 добавлений и 68 удалений

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

@ -295,7 +295,8 @@ BasicShadowableCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
if (mNeedsYFlip) {
flags |= NeedsYFlip;
}
mCanvasClient = BasicManager()->CreateCanvasClientFor(GetCompositableClientType(), this, flags);
mCanvasClient = CanvasClient::CreateCanvasClient(GetCompositableClientType(),
BasicManager(), flags);
if (!mCanvasClient) {
return;
}

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

@ -258,10 +258,15 @@ BasicShadowableImageLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
if (!mImageClient ||
!mImageClient->UpdateImage(mContainer, GetContentFlags())) {
mImageClient = BasicManager()->CreateImageClientFor(GetImageClientType(), this,
mImageClient = ImageClient::CreateImageClient(GetImageClientType(),
BasicManager(),
mForceSingleTile
? ForceSingleTile
: 0);
if (GetImageClientType() == BUFFER_BRIDGE) {
static_cast<ImageClientBridge*>(mImageClient.get())->SetLayer(this);
}
if (!mImageClient) {
return;
}

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

@ -254,7 +254,7 @@ BasicShadowableThebesLayer::PaintThebes(gfxContext* aContext,
}
if (!mContentClient) {
mContentClient = BasicManager()->CreateContentClientFor(this);
mContentClient = ContentClient::CreateContentClient(BasicManager());
if (!mContentClient) {
return;
}

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

@ -18,8 +18,7 @@ namespace mozilla {
namespace layers {
/* static */ TemporaryRef<CanvasClient>
CanvasClient::CreateCanvasClient(LayersBackend aParentBackend,
CompositableType aCompositableHostType,
CanvasClient::CreateCanvasClient(CompositableType aCompositableHostType,
CompositableForwarder* aForwarder,
TextureFlags aFlags)
{
@ -27,7 +26,7 @@ CanvasClient::CreateCanvasClient(LayersBackend aParentBackend,
return new CanvasClient2D(aForwarder, aFlags);
}
if (aCompositableHostType == BUFFER_IMAGE_BUFFERED) {
if (aParentBackend == LAYERS_OPENGL) {
if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) {
return new CanvasClientWebGL(aForwarder, aFlags);
}
return new CanvasClient2D(aForwarder, aFlags);

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

@ -26,8 +26,7 @@ public:
* message will be sent to the compositor to create a corresponding image
* host.
*/
static TemporaryRef<CanvasClient> CreateCanvasClient(LayersBackend aBackendType,
CompositableType aImageHostType,
static TemporaryRef<CanvasClient> CreateCanvasClient(CompositableType aImageHostType,
CompositableForwarder* aFwd,
TextureFlags aFlags);

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

@ -17,10 +17,9 @@ using namespace gfx;
namespace layers {
/* static */ TemporaryRef<ContentClient>
ContentClient::CreateContentClient(LayersBackend aParentBackend,
CompositableForwarder* aForwarder)
ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
{
if (aParentBackend != LAYERS_OPENGL) {
if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) {
return nullptr;
}
if (ShadowLayerManager::SupportsDirectTexturing() ||

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

@ -64,8 +64,7 @@ public:
* message will be sent to the compositor to create a corresponding content
* host.
*/
static TemporaryRef<ContentClient> CreateContentClient(LayersBackend aBackendType,
CompositableForwarder* aFwd);
static TemporaryRef<ContentClient> CreateContentClient(CompositableForwarder* aFwd);
ContentClient(CompositableForwarder* aForwarder)
: CompositableClient(aForwarder)

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

@ -21,25 +21,24 @@ namespace mozilla {
namespace layers {
/* static */ TemporaryRef<ImageClient>
ImageClient::CreateImageClient(LayersBackend aParentBackend,
CompositableType aCompositableHostType,
ImageClient::CreateImageClient(CompositableType aCompositableHostType,
CompositableForwarder* aForwarder,
TextureFlags aFlags)
{
RefPtr<ImageClient> result = nullptr;
switch (aCompositableHostType) {
case BUFFER_IMAGE_SINGLE:
if (aParentBackend == LAYERS_OPENGL) {
if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) {
result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
}
break;
case BUFFER_IMAGE_BUFFERED:
if (aParentBackend == LAYERS_OPENGL) {
if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) {
result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
}
break;
case BUFFER_BRIDGE:
if (aParentBackend == LAYERS_OPENGL) {
if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) {
result = new ImageClientBridge(aForwarder, aFlags);
}
break;

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

@ -31,8 +31,7 @@ public:
* message will be sent to the compositor to create a corresponding image
* host.
*/
static TemporaryRef<ImageClient> CreateImageClient(LayersBackend aBackendType,
CompositableType aImageHostType,
static TemporaryRef<ImageClient> CreateImageClient(CompositableType aImageHostType,
CompositableForwarder* aFwd,
TextureFlags aFlags);

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

@ -485,7 +485,7 @@ ImageBridgeChild::CreateImageClientNow(CompositableType aType)
mCompositorBackend = LAYERS_OPENGL;
RefPtr<ImageClient> client
= ImageClient::CreateImageClient(mCompositorBackend, aType, this, 0);
= ImageClient::CreateImageClient(aType, this, 0);
MOZ_ASSERT(client, "failed to create ImageClient");
if (client) {
client->Connect();

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

@ -532,39 +532,6 @@ ShadowLayerForwarder::CloseDescriptor(const SurfaceDescriptor& aDescriptor)
// There's no "close" needed for Shmem surfaces.
}
TemporaryRef<ImageClient>
ShadowLayerForwarder::CreateImageClientFor(const CompositableType& aCompositableType,
ShadowableLayer* aLayer,
TextureFlags aFlags)
{
RefPtr<ImageClient> client = ImageClient::CreateImageClient(GetCompositorBackendType(),
aCompositableType,
this, aFlags);
if (aCompositableType == BUFFER_BRIDGE) {
static_cast<ImageClientBridge*>(client.get())->SetLayer(aLayer);
}
return client.forget();
}
TemporaryRef<CanvasClient>
ShadowLayerForwarder::CreateCanvasClientFor(const CompositableType& aCompositableType,
ShadowableLayer* aLayer,
TextureFlags aFlags)
{
RefPtr<CanvasClient> client = CanvasClient::CreateCanvasClient(GetCompositorBackendType(),
aCompositableType,
this, aFlags);
return client.forget();
}
TemporaryRef<ContentClient>
ShadowLayerForwarder::CreateContentClientFor(ShadowableLayer* aLayer)
{
RefPtr<ContentClient> client = ContentClient::CreateContentClient(GetCompositorBackendType(),
this);
return client.forget();
}
PLayerChild*
ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer)
{

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

@ -363,17 +363,6 @@ public:
*/
void SetIsFirstPaint() { mIsFirstPaint = true; }
/**
* Create compositable clients, see comments in CompositingFactory
*/
TemporaryRef<ImageClient> CreateImageClientFor(const CompositableType& aCompositableType,
ShadowableLayer* aLayer,
TextureFlags aFlags);
TemporaryRef<CanvasClient> CreateCanvasClientFor(const CompositableType& aCompositableType,
ShadowableLayer* aLayer,
TextureFlags aFlags);
TemporaryRef<ContentClient> CreateContentClientFor(ShadowableLayer* aLayer);
static void PlatformSyncBeforeUpdate();
static already_AddRefed<gfxASurface>