Bug 1026432 - Add GetCompositorChild() to ClientLayerManager r=nical

This commit is contained in:
Sotaro Ikeda
2014-06-17 19:42:34 -07:00
parent 4120f9ec40
commit 1e3fa8c17c
4 changed files with 29 additions and 5 deletions

View File

@@ -78,6 +78,7 @@ namespace layers {
class Animation;
class AnimationData;
class AsyncPanZoomController;
class ClientLayerManager;
class CommonLayerAttributes;
class Layer;
class ThebesLayer;
@@ -203,6 +204,9 @@ public:
virtual LayerManagerComposite* AsLayerManagerComposite()
{ return nullptr; }
virtual ClientLayerManager* AsClientLayerManager()
{ return nullptr; }
/**
* Returns true if this LayerManager is owned by an nsIWidget,
* and is used for drawing into the widget.

View File

@@ -284,6 +284,15 @@ ClientLayerManager::GetRemoteRenderer()
return mWidget->GetRemoteRenderer();
}
CompositorChild*
ClientLayerManager::GetCompositorChild()
{
if (XRE_GetProcessType() != GeckoProcessType_Default) {
return CompositorChild::Get();
}
return GetRemoteRenderer();
}
void
ClientLayerManager::Composite()
{

View File

@@ -51,6 +51,11 @@ public:
return mForwarder;
}
virtual ClientLayerManager* AsClientLayerManager()
{
return this;
}
virtual int32_t GetMaxTextureSize() const;
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation);
@@ -107,8 +112,8 @@ public:
virtual void SetIsFirstPaint() MOZ_OVERRIDE;
TextureClientPool *GetTexturePool(gfx::SurfaceFormat aFormat);
SimpleTextureClientPool *GetSimpleTileTexturePool(gfx::SurfaceFormat aFormat);
TextureClientPool* GetTexturePool(gfx::SurfaceFormat aFormat);
SimpleTextureClientPool* GetSimpleTileTexturePool(gfx::SurfaceFormat aFormat);
// Drop cached resources and ask our shadow manager to do the same,
// if we have one.
@@ -123,7 +128,7 @@ public:
bool HasShadowTarget() { return !!mShadowTarget; }
void SetShadowTarget(gfxContext *aTarget) { mShadowTarget = aTarget; }
void SetShadowTarget(gfxContext* aTarget) { mShadowTarget = aTarget; }
bool CompositorMightResample() { return mCompositorMightResample; }
@@ -133,7 +138,9 @@ public:
void* GetThebesLayerCallbackData() const
{ return mThebesLayerCallbackData; }
CompositorChild *GetRemoteRenderer();
CompositorChild* GetRemoteRenderer();
CompositorChild* GetCompositorChild();
/**
* Called for each iteration of a progressive tile update. Fills

View File

@@ -152,7 +152,11 @@ SharedFrameMetricsHelper::UpdateFromCompositorFrameMetrics(
{
MOZ_ASSERT(aLayer);
CompositorChild* compositor = CompositorChild::Get();
CompositorChild* compositor = nullptr;
if(aLayer->Manager() &&
aLayer->Manager()->AsClientLayerManager()) {
compositor = aLayer->Manager()->AsClientLayerManager()->GetCompositorChild();
}
if (!compositor) {
FindFallbackContentFrameMetrics(aLayer, aCompositionBounds, aZoom);