Bug 871150 - Call IdentifyTextureHost on ImageBridgeChild so that we create appropriate textures for the compositor. r=nical

This commit is contained in:
Matt Woodrow 2013-06-24 17:28:22 +12:00
parent 48aa80f20f
commit c68c9da465
4 changed files with 14 additions and 2 deletions

View File

@ -21,6 +21,7 @@
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/layers/AsyncPanZoomController.h"
#include "mozilla/layers/CompositorChild.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/PLayerTransactionChild.h"
#include "mozilla/layout/RenderFrameChild.h"
#include "mozilla/StaticPtr.h"
@ -2176,6 +2177,7 @@ TabChild::InitRenderingState()
NS_ABORT_IF_FALSE(lf && lf->HasShadowManager(),
"PuppetWidget should have shadow manager");
lf->IdentifyTextureHost(mTextureFactoryIdentifier);
ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);
mRemoteFrame = remoteFrame;

View File

@ -480,6 +480,14 @@ void ImageBridgeChild::ConnectAsync(ImageBridgeParent* aParent)
this, aParent));
}
void
ImageBridgeChild::IdentifyCompositorTextureHost(const TextureFactoryIdentifier& aIdentifier)
{
if (sImageBridgeChildSingleton) {
sImageBridgeChildSingleton->IdentifyTextureHost(aIdentifier);
}
}
TemporaryRef<ImageClient>
ImageBridgeChild::CreateImageClient(CompositableType aType)
{
@ -504,8 +512,6 @@ ImageBridgeChild::CreateImageClient(CompositableType aType)
TemporaryRef<ImageClient>
ImageBridgeChild::CreateImageClientNow(CompositableType aType)
{
mCompositorBackend = LAYERS_OPENGL;
RefPtr<ImageClient> client
= ImageClient::CreateImageClient(aType, this, 0);
MOZ_ASSERT(client, "failed to create ImageClient");

View File

@ -148,6 +148,8 @@ public:
*/
void ConnectAsync(ImageBridgeParent* aParent);
static void IdentifyCompositorTextureHost(const TextureFactoryIdentifier& aIdentifier);
void BeginTransaction();
void EndTransaction();

View File

@ -7,6 +7,7 @@
#include "mozilla/layers/CompositorChild.h"
#include "mozilla/layers/CompositorParent.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "nsBaseWidget.h"
#include "nsDeviceContext.h"
#include "nsCOMPtr.h"
@ -952,6 +953,7 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
}
lf->SetShadowManager(shadowManager);
lf->IdentifyTextureHost(textureFactoryIdentifier);
ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
mLayerManager = lm;
return;