mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1143575. Store composition time in Compositor. r=nical
We'll need this later so ImageHost can select the correct image to use. Adding a TimeStamp parameter to BeginFrame is a bit annoying since BeginFrame is overridden by every subclass. It's a bit more convenient to just call a separate non-virtual method just before we call BeginFrame.
This commit is contained in:
parent
3bdcc32fc3
commit
9117630ce9
@ -478,11 +478,17 @@ public:
|
||||
ScreenRotation GetScreenRotation() const {
|
||||
return mScreenRotation;
|
||||
}
|
||||
|
||||
void SetScreenRotation(ScreenRotation aRotation) {
|
||||
mScreenRotation = aRotation;
|
||||
}
|
||||
|
||||
TimeStamp GetCompositionTime() const {
|
||||
return mCompositionTime;
|
||||
}
|
||||
void SetCompositionTime(TimeStamp aTimeStamp) {
|
||||
mCompositionTime = aTimeStamp;
|
||||
}
|
||||
|
||||
protected:
|
||||
void DrawDiagnosticsInternal(DiagnosticFlags aFlags,
|
||||
const gfx::Rect& aVisibleRect,
|
||||
@ -497,6 +503,11 @@ protected:
|
||||
*/
|
||||
static void SetBackend(LayersBackend backend);
|
||||
|
||||
/**
|
||||
* Render time for the current composition.
|
||||
*/
|
||||
TimeStamp mCompositionTime;
|
||||
|
||||
uint32_t mCompositorID;
|
||||
DiagnosticTypes mDiagnosticTypes;
|
||||
PCompositorParent* mParent;
|
||||
|
@ -248,27 +248,11 @@ LayerManagerComposite::ApplyOcclusionCulling(Layer* aLayer, nsIntRegion& aOpaque
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
LayerManagerComposite::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
{
|
||||
NS_ASSERTION(mInTransaction, "Didn't call BeginTransaction?");
|
||||
if (!mRoot) {
|
||||
mInTransaction = false;
|
||||
mIsCompositorReady = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
EndTransaction(nullptr, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
LayerManagerComposite::EndTransaction(const TimeStamp& aTimeStamp,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
NS_ASSERTION(mInTransaction, "Didn't call BeginTransaction?");
|
||||
NS_ASSERTION(!aCallback && !aCallbackData, "Not expecting callbacks here");
|
||||
NS_ASSERTION(!(aFlags & END_NO_COMPOSITE),
|
||||
"Shouldn't get END_NO_COMPOSITE here");
|
||||
mInTransaction = false;
|
||||
@ -300,6 +284,10 @@ LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
}
|
||||
|
||||
if (mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
|
||||
MOZ_ASSERT(!aTimeStamp.IsNull());
|
||||
// Set composition timestamp here because we need it in
|
||||
// ComputeEffectiveTransforms (so the correct video frame size is picked)
|
||||
mCompositor->SetCompositionTime(aTimeStamp);
|
||||
// The results of our drawing always go directly into a pixel buffer,
|
||||
// so we don't need to pass any global transform here.
|
||||
mRoot->ComputeEffectiveTransforms(gfx::Matrix4x4());
|
||||
|
@ -109,12 +109,22 @@ public:
|
||||
{
|
||||
MOZ_CRASH("Use BeginTransactionWithDrawTarget");
|
||||
}
|
||||
void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget, const gfx::IntRect& aRect);
|
||||
void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget,
|
||||
const gfx::IntRect& aRect);
|
||||
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) override;
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) override
|
||||
{
|
||||
MOZ_CRASH("Use EndTransaction(aTimeStamp)");
|
||||
return false;
|
||||
}
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) override;
|
||||
EndTransactionFlags aFlags = END_DEFAULT) override
|
||||
{
|
||||
MOZ_CRASH("Use EndTransaction(aTimeStamp)");
|
||||
}
|
||||
void EndTransaction(const TimeStamp& aTimeStamp,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
virtual void SetRoot(Layer* aLayer) override { mRoot = aLayer; }
|
||||
|
||||
|
@ -1170,7 +1170,7 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const gfx::IntRect* aRe
|
||||
}
|
||||
#endif
|
||||
mLayerManager->SetDebugOverlayWantsNextFrame(false);
|
||||
mLayerManager->EndEmptyTransaction();
|
||||
mLayerManager->EndTransaction(time);
|
||||
|
||||
if (!aTarget) {
|
||||
DidComposite();
|
||||
@ -1199,6 +1199,7 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const gfx::IntRect* aRe
|
||||
// Special full-tilt composite mode for performance testing
|
||||
ScheduleComposition();
|
||||
}
|
||||
mCompositor->SetCompositionTime(TimeStamp());
|
||||
|
||||
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::COMPOSITE_TIME, start);
|
||||
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_END);
|
||||
|
@ -596,7 +596,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
|
||||
{
|
||||
AutoResolveRefLayers resolve(mShadowLayersManager->GetCompositionManager(this));
|
||||
layer_manager()->EndTransaction(nullptr, nullptr, LayerManager::END_NO_IMMEDIATE_REDRAW);
|
||||
layer_manager()->EndTransaction(TimeStamp(), LayerManager::END_NO_IMMEDIATE_REDRAW);
|
||||
}
|
||||
|
||||
if (reply) {
|
||||
|
@ -181,7 +181,7 @@ static bool CompositeAndCompare(nsRefPtr<LayerManagerComposite> layerManager, Dr
|
||||
RefPtr<DrawTarget> drawTarget = CreateDT();
|
||||
|
||||
layerManager->BeginTransactionWithDrawTarget(drawTarget, IntRect(0, 0, gCompWidth, gCompHeight));
|
||||
layerManager->EndEmptyTransaction();
|
||||
layerManager->EndTransaction(TimeStamp::Now());
|
||||
|
||||
RefPtr<SourceSurface> ss = drawTarget->Snapshot();
|
||||
RefPtr<DataSourceSurface> dss = ss->GetDataSurface();
|
||||
|
Loading…
Reference in New Issue
Block a user