Skip to content

Commit

Permalink
Bug 745148, part 5: Pass the layer tree to ShadowLayersUpdate(). r=ajuma
Browse files Browse the repository at this point in the history
  • Loading branch information
joneschrisg committed Jul 17, 2012
1 parent f15a893 commit 49ee683
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
12 changes: 5 additions & 7 deletions gfx/layers/ipc/CompositorParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,16 +525,14 @@ CompositorParent::SyncViewportInfo(const nsIntRect& aDisplayPort,
}

void
CompositorParent::ShadowLayersUpdated(bool isFirstPaint)
CompositorParent::ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
bool isFirstPaint)
{
mIsFirstPaint = mIsFirstPaint || isFirstPaint;
mLayersUpdated = true;
const nsTArray<PLayersParent*>& shadowParents = ManagedPLayersParent();
NS_ABORT_IF_FALSE(shadowParents.Length() <= 1,
"can only support at most 1 ShadowLayersParent");
if (shadowParents.Length()) {
Layer* root = static_cast<ShadowLayersParent*>(shadowParents[0])->GetRoot();
mLayerManager->SetRoot(root);
Layer* root = aLayerTree->GetRoot();
mLayerManager->SetRoot(root);
if (root) {
SetShadowProperties(root);
}
ScheduleComposition();
Expand Down
3 changes: 2 additions & 1 deletion gfx/layers/ipc/CompositorParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class CompositorParent : public PCompositorParent,
virtual bool RecvPause() MOZ_OVERRIDE;
virtual bool RecvResume() MOZ_OVERRIDE;

virtual void ShadowLayersUpdated(bool isFirstPaint) MOZ_OVERRIDE;
virtual void ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
bool isFirstPaint) MOZ_OVERRIDE;
void Destroy();

LayerManager* GetLayerManager() { return mLayerManager; }
Expand Down
12 changes: 4 additions & 8 deletions gfx/layers/ipc/ShadowLayersManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@
#define mozilla_layers_ShadowLayersManager_h

namespace mozilla {

namespace layout {
class RenderFrameParent;
}

namespace layers {

class CompositorParent;
class ShadowLayersParent;

class ShadowLayersManager
{

public:
virtual void ShadowLayersUpdated(bool isFirstPaint) = 0;
virtual void ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
// FIXME nuke this
bool isFirstPaint) = 0;
};

} // layers
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/ipc/ShadowLayersParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
// other's buffer contents.
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();

mShadowLayersManager->ShadowLayersUpdated(isFirstPaint);
mShadowLayersManager->ShadowLayersUpdated(this, isFirstPaint);

#ifdef COMPOSITOR_PERFORMANCE_WARNING
int compositeTime = (int)(mozilla::TimeStamp::Now() - updateStart).ToMilliseconds();
Expand Down
3 changes: 2 additions & 1 deletion layout/ipc/RenderFrameParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ RenderFrameParent::ContentViewScaleChanged(nsContentView* aView)
}

void
RenderFrameParent::ShadowLayersUpdated(bool isFirstPaint)
RenderFrameParent::ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
bool isFirstPaint)
{
mFrameLoader->SetCurrentRemoteFrame(this);

Expand Down
3 changes: 2 additions & 1 deletion layout/ipc/RenderFrameParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class RenderFrameParent : public PRenderFrameParent,

void ContentViewScaleChanged(nsContentView* aView);

virtual void ShadowLayersUpdated(bool isFirstPaint) MOZ_OVERRIDE;
virtual void ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
bool isFirstPaint) MOZ_OVERRIDE;

NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,
Expand Down

0 comments on commit 49ee683

Please sign in to comment.