Skip to content

Commit

Permalink
Bug 1294121 - Backed out changeset 635d266614ad for windows build fai…
Browse files Browse the repository at this point in the history
…lures. r=me. CLOSED TREE
  • Loading branch information
Mason Chang committed Aug 16, 2016
1 parent c07ca36 commit 6478db3
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 260 deletions.
18 changes: 3 additions & 15 deletions gfx/layers/client/ClientLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
: mPhase(PHASE_NONE)
, mWidget(aWidget)
, mLatestTransactionId(0)
, mLastPaintTime(TimeDuration::Forever())
, mTargetRotation(ROTATION_0)
, mRepeatTransaction(false)
, mIsRepeatTransaction(false)
Expand Down Expand Up @@ -284,24 +283,17 @@ ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
ClientLayer* root = ClientLayer::ToClientLayer(GetRoot());

mTransactionIncomplete = false;

// Apply pending tree updates before recomputing effective
// properties.
GetRoot()->ApplyPendingUpdatesToSubtree();

mPaintedLayerCallback = aCallback;
mPaintedLayerCallbackData = aCallbackData;

GetRoot()->ComputeEffectiveTransforms(Matrix4x4());

if (gfxPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
TimeStamp start = TimeStamp::Now();
root->RenderLayer();
mLastPaintTime = TimeStamp::Now() - start;
} else {
root->RenderLayer();
}

root->RenderLayer();
if (!mRepeatTransaction && !GetRoot()->GetInvalidRegion().IsEmpty()) {
GetRoot()->Mutated();
}
Expand Down Expand Up @@ -631,10 +623,6 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
transactionStart = mTransactionStart;
}

if (gfxPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
mForwarder->SendPaintTime(mLatestTransactionId, mLastPaintTime);
}

// forward this transaction's changeset to our LayerManagerComposite
bool sent;
AutoTArray<EditReply, 10> replies;
Expand Down
3 changes: 1 addition & 2 deletions gfx/layers/client/ClientLayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class ClientLayerManager final : public LayerManager
LayerRefArray mKeepAlive;

nsIWidget* mWidget;

/* PaintedLayer callbacks; valid at the end of a transaciton,
* while rendering */
DrawPaintedLayerCallback mPaintedLayerCallback;
Expand All @@ -321,7 +321,6 @@ class ClientLayerManager final : public LayerManager

RefPtr<TransactionIdAllocator> mTransactionIdAllocator;
uint64_t mLatestTransactionId;
TimeDuration mLastPaintTime;

// Sometimes we draw to targets that don't natively support
// landscape/portrait orientation. When we need to implement that
Expand Down
3 changes: 2 additions & 1 deletion gfx/layers/composite/FPSCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ static void DrawDigits(unsigned int aValue,

Rect drawRect = Rect(aOffsetX + n * FontWidth, aOffsetY, FontWidth, FontHeight);
IntRect clipRect = IntRect(0, 0, 300, 100);
aCompositor->DrawQuad(drawRect, clipRect, aEffectChain, opacity, transform);
aCompositor->DrawQuad(drawRect, clipRect,
aEffectChain, opacity, transform);
}
}

Expand Down
25 changes: 0 additions & 25 deletions gfx/layers/composite/LayerManagerComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "CompositableHost.h" // for CompositableHost
#include "ContainerLayerComposite.h" // for ContainerLayerComposite, etc
#include "FPSCounter.h" // for FPSState, FPSCounter
#include "PaintCounter.h" // For PaintCounter
#include "FrameMetrics.h" // for FrameMetrics
#include "GeckoProfiler.h" // for profiler_set_frame_number, etc
#include "ImageLayerComposite.h" // for ImageLayerComposite
Expand Down Expand Up @@ -128,8 +127,6 @@ LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
, mGeometryChanged(true)
, mLastFrameMissedHWC(false)
, mWindowOverlayChanged(false)
, mLastPaintTime(TimeDuration::Forever())
, mRenderStartTime(TimeStamp::Now())
{
mTextRenderer = new TextRenderer(aCompositor);
MOZ_ASSERT(aCompositor);
Expand All @@ -151,7 +148,6 @@ LayerManagerComposite::Destroy()
}
mRoot = nullptr;
mClonedLayerTreeProperties = nullptr;
mPaintCounter = nullptr;
mDestroyed = true;
}
}
Expand Down Expand Up @@ -377,7 +373,6 @@ LayerManagerComposite::EndTransaction(const TimeStamp& aTimeStamp,
NS_ASSERTION(!(aFlags & END_NO_COMPOSITE),
"Shouldn't get END_NO_COMPOSITE here");
mInTransaction = false;
mRenderStartTime = TimeStamp::Now();

if (!mIsCompositorReady) {
return;
Expand Down Expand Up @@ -564,28 +559,13 @@ LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
bool drawPaintTimes = gfxPrefs::AlwaysPaint();

if (drawFps || drawFrameCounter) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 256, 256));
}
if (drawFrameColorBars) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 10, aBounds.height));
}
if (drawPaintTimes) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(PaintCounter::GetPaintRect()));
}
}

void
LayerManagerComposite::DrawPaintTimes(Compositor* aCompositor)
{
if (!mPaintCounter) {
mPaintCounter = new PaintCounter();
}

TimeDuration compositeTime = TimeStamp::Now() - mRenderStartTime;
mPaintCounter->Draw(aCompositor, mLastPaintTime, compositeTime);
}

static uint16_t sFrameCount = 0;
Expand All @@ -595,7 +575,6 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
bool drawPaintTimes = gfxPrefs::AlwaysPaint();

TimeStamp now = TimeStamp::Now();

Expand Down Expand Up @@ -735,10 +714,6 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
// We intentionally overflow at 2^16.
sFrameCount++;
}

if (drawPaintTimes) {
DrawPaintTimes(mCompositor);
}
}

RefPtr<CompositingRenderTarget>
Expand Down
11 changes: 0 additions & 11 deletions gfx/layers/composite/LayerManagerComposite.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class PaintedLayerComposite;
class TextRenderer;
class CompositingRenderTarget;
struct FPSState;
class PaintCounter;

static const int kVisualWarningDuration = 150; // ms

Expand Down Expand Up @@ -332,8 +331,6 @@ class LayerManagerComposite final : public LayerManager

void ForcePresent() { mCompositor->ForcePresent(); }

void SetPaintTime(const TimeDuration& aPaintTime) { mLastPaintTime = aPaintTime; }

private:
/** Region we're clipping our current drawing to. */
nsIntRegion mClippingRegion;
Expand All @@ -355,11 +352,6 @@ class LayerManagerComposite final : public LayerManager
void RenderToPresentationSurface();
#endif

/**
* Render paint and composite times above the frame.
*/
void DrawPaintTimes(Compositor* aCompositor);

/**
* We need to know our invalid region before we're ready to render.
*/
Expand Down Expand Up @@ -417,9 +409,6 @@ class LayerManagerComposite final : public LayerManager
bool mLastFrameMissedHWC;

bool mWindowOverlayChanged;
RefPtr<PaintCounter> mPaintCounter;
TimeDuration mLastPaintTime;
TimeStamp mRenderStartTime;
};

/**
Expand Down
84 changes: 0 additions & 84 deletions gfx/layers/composite/PaintCounter.cpp

This file was deleted.

50 changes: 0 additions & 50 deletions gfx/layers/composite/PaintCounter.h

This file was deleted.

26 changes: 0 additions & 26 deletions gfx/layers/ipc/CompositorBridgeParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ CompositorBridgeParent::CompositorBridgeParent(CSSToLayoutDeviceScale aScale,
, mForceCompositionTask(nullptr)
, mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
, mCompositorScheduler(nullptr)
, mPaintTime(TimeDuration::Forever())
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
, mLastPluginUpdateLayerTreeId(0)
, mDeferPluginWindows(false)
Expand Down Expand Up @@ -1079,18 +1078,6 @@ CompositorBridgeParent::ScheduleTask(already_AddRefed<CancelableRunnable> task,
}
}

void
CompositorBridgeParent::UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime)
{
// We get a lot of paint timings for things with empty transactions.
if (!mLayerManager || aPaintTime.ToMilliseconds() < 1.0) {
return;
}

mLayerManager->SetPaintTime(aPaintTime);
}

void
CompositorBridgeParent::NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint,
bool aScheduleComposite, uint32_t aPaintSequenceNumber,
Expand Down Expand Up @@ -2143,19 +2130,6 @@ class CrossProcessCompositorBridgeParent final : public PCompositorBridgeParent,

virtual CompositorBridgeParentIPCAllocator* AsCompositorBridgeParentIPCAllocator() override { return this; }

virtual void UpdatePaintTime(LayerTransactionParent* aLayerTree, const TimeDuration& aPaintTime) override {
uint64_t id = aLayerTree->GetId();
MOZ_ASSERT(id != 0);

CompositorBridgeParent::LayerTreeState* state =
CompositorBridgeParent::GetIndirectShadowTree(id);
if (!state || !state->mParent) {
return;
}

state->mParent->UpdatePaintTime(aLayerTree, aPaintTime);
}

protected:
void OnChannelConnected(int32_t pid) override {
mCompositorThreadHolder = CompositorThreadHolder::GetSingleton();
Expand Down
5 changes: 0 additions & 5 deletions gfx/layers/ipc/CompositorBridgeParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,6 @@ class CompositorBridgeParent final : public PCompositorBridgeParent,
bool aScheduleComposite, uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction, bool aHitTestUpdate);

void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) override;

/**
* Check rotation info and schedule a rendering task if needed.
* Only can be called from compositor thread.
Expand Down Expand Up @@ -633,8 +630,6 @@ class CompositorBridgeParent final : public PCompositorBridgeParent,
// mSelfRef is cleared in DeferredDestroy which is scheduled by ActorDestroy.
RefPtr<CompositorBridgeParent> mSelfRef;

TimeDuration mPaintTime;

#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// cached plugin data used to reduce the number of updates we request.
uint64_t mLastPluginUpdateLayerTreeId;
Expand Down
Loading

0 comments on commit 6478db3

Please sign in to comment.