зеркало из https://github.com/mozilla/gecko-dev.git
Bug 732091 - Part 3: Pass on the isFirstPaint flag from the PresShell to the compositor via the layer manager. r=tnikkel,bgirard
This commit is contained in:
Родитель
4d8312dbab
Коммит
fa2d5472cf
|
@ -486,6 +486,11 @@ public:
|
|||
LayerUserData* GetUserData(void* aKey)
|
||||
{ return mUserData.Get(aKey); }
|
||||
|
||||
/**
|
||||
* Flag the next paint as the first for a document.
|
||||
*/
|
||||
virtual void SetIsFirstPaint() {}
|
||||
|
||||
// We always declare the following logging symbols, because it's
|
||||
// extremely tricky to conditionally declare them. However, for
|
||||
// ifndef MOZ_LAYERS_HAVE_LOG builds, they only have trivial
|
||||
|
|
|
@ -3504,5 +3504,11 @@ BasicShadowLayerManager::IsCompositingCheap()
|
|||
LayerManager::IsCompositingCheap(GetParentBackendType());
|
||||
}
|
||||
|
||||
void
|
||||
BasicShadowLayerManager::SetIsFirstPaint()
|
||||
{
|
||||
ShadowLayerForwarder::SetIsFirstPaint();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,6 +267,8 @@ public:
|
|||
virtual bool IsCompositingCheap();
|
||||
virtual bool HasShadowManagerInternal() const { return HasShadowManager(); }
|
||||
|
||||
virtual void SetIsFirstPaint() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Forward transaction results to the parent context.
|
||||
|
|
|
@ -58,6 +58,7 @@ CompositorParent::CompositorParent(nsIWidget* aWidget)
|
|||
: mWidget(aWidget)
|
||||
, mCurrentCompositeTask(NULL)
|
||||
, mPaused(false)
|
||||
, mIsFirstPaint(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositorParent);
|
||||
}
|
||||
|
@ -315,8 +316,9 @@ CompositorParent::RequestViewTransform()
|
|||
#endif
|
||||
|
||||
void
|
||||
CompositorParent::ShadowLayersUpdated()
|
||||
CompositorParent::ShadowLayersUpdated(bool isFirstPaint)
|
||||
{
|
||||
mIsFirstPaint = mIsFirstPaint || isFirstPaint;
|
||||
const nsTArray<PLayersParent*>& shadowParents = ManagedPLayersParent();
|
||||
NS_ABORT_IF_FALSE(shadowParents.Length() <= 1,
|
||||
"can only support at most 1 ShadowLayersParent");
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
virtual bool RecvStop() MOZ_OVERRIDE;
|
||||
|
||||
virtual void ShadowLayersUpdated() MOZ_OVERRIDE;
|
||||
virtual void ShadowLayersUpdated(bool isFirstPaint) MOZ_OVERRIDE;
|
||||
void Destroy();
|
||||
|
||||
LayerManager* GetLayerManager() { return mLayerManager; }
|
||||
|
@ -144,6 +144,13 @@ private:
|
|||
float mYScale;
|
||||
nsIntPoint mScrollOffset;
|
||||
|
||||
// When this flag is set, the next composition will be the first for a
|
||||
// particular document (i.e. the document displayed on the screen will change).
|
||||
// This happens when loading a new page or switching tabs. We notify the
|
||||
// front-end (e.g. Java on Android) about this so that it take the new page
|
||||
// size and zoom into account when providing us with the next view transform.
|
||||
bool mIsFirstPaint;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
|
||||
};
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ struct AutoTxnEnd {
|
|||
ShadowLayerForwarder::ShadowLayerForwarder()
|
||||
: mShadowManager(NULL)
|
||||
, mParentBackend(LayerManager::LAYERS_NONE)
|
||||
, mIsFirstPaint(false)
|
||||
{
|
||||
mTxn = new Transaction();
|
||||
}
|
||||
|
@ -325,11 +326,12 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies)
|
|||
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
|
||||
RenderTraceScope rendertrace3("Foward Transaction", "000093");
|
||||
if (!mShadowManager->SendUpdate(cset, false, aReplies)) {
|
||||
if (!mShadowManager->SendUpdate(cset, mIsFirstPaint, aReplies)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
mIsFirstPaint = false;
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] ... done"));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -308,6 +308,11 @@ public:
|
|||
*/
|
||||
bool ShouldDoubleBuffer() { return GetParentBackendType() == LayerManager::LAYERS_BASIC; }
|
||||
|
||||
/**
|
||||
* Flag the next paint as the first for a document.
|
||||
*/
|
||||
void SetIsFirstPaint() { mIsFirstPaint = true; }
|
||||
|
||||
protected:
|
||||
ShadowLayerForwarder();
|
||||
|
||||
|
@ -332,6 +337,8 @@ private:
|
|||
|
||||
Transaction* mTxn;
|
||||
LayersBackend mParentBackend;
|
||||
|
||||
bool mIsFirstPaint;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class ShadowLayersManager
|
|||
{
|
||||
|
||||
public:
|
||||
virtual void ShadowLayersUpdated() = 0;
|
||||
virtual void ShadowLayersUpdated(bool isFirstPaint) = 0;
|
||||
};
|
||||
|
||||
} // layers
|
||||
|
|
|
@ -399,7 +399,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
// other's buffer contents.
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
|
||||
|
||||
mShadowLayersManager->ShadowLayersUpdated();
|
||||
mShadowLayersManager->ShadowLayersUpdated(isFirstPaint);
|
||||
|
||||
#ifdef COMPOSITOR_PERFORMANCE_WARNING
|
||||
printf_stderr("Compositor: Layers update took %i ms (blocking gecko).\n",
|
||||
|
|
|
@ -5370,6 +5370,11 @@ PresShell::Paint(nsIView* aViewToPaint,
|
|||
LayerManager* layerManager =
|
||||
aWidgetToPaint->GetLayerManager(&isRetainingManager);
|
||||
NS_ASSERTION(layerManager, "Must be in paint event");
|
||||
|
||||
if (mIsFirstPaint) {
|
||||
layerManager->SetIsFirstPaint();
|
||||
mIsFirstPaint = false;
|
||||
}
|
||||
layerManager->BeginTransaction();
|
||||
|
||||
if (frame && isRetainingManager) {
|
||||
|
|
|
@ -516,7 +516,7 @@ RenderFrameParent::ContentViewScaleChanged(nsContentView* aView)
|
|||
}
|
||||
|
||||
void
|
||||
RenderFrameParent::ShadowLayersUpdated()
|
||||
RenderFrameParent::ShadowLayersUpdated(bool isFirstPaint)
|
||||
{
|
||||
mFrameLoader->SetCurrentRemoteFrame(this);
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public:
|
|||
|
||||
void ContentViewScaleChanged(nsContentView* aView);
|
||||
|
||||
virtual void ShadowLayersUpdated() MOZ_OVERRIDE;
|
||||
virtual void ShadowLayersUpdated(bool isFirstPaint) MOZ_OVERRIDE;
|
||||
|
||||
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsSubDocumentFrame* aFrame,
|
||||
|
|
Загрузка…
Ссылка в новой задаче