Skip to content

Commit

Permalink
Bug 854421 - Part 9: Send DidComposite during ClientLayerManager dest…
Browse files Browse the repository at this point in the history
…ruction. r=roc
  • Loading branch information
mattwoodrow committed May 28, 2014
1 parent 795c213 commit 89a5359
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions gfx/layers/client/ClientLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using namespace mozilla::gfx;
ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
: mPhase(PHASE_NONE)
, mWidget(aWidget)
, mLatestTransactionId(0)
, mTargetRotation(ROTATION_0)
, mRepeatTransaction(false)
, mIsRepeatTransaction(false)
Expand All @@ -54,6 +55,9 @@ ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)

ClientLayerManager::~ClientLayerManager()
{
if (mTransactionIdAllocator) {
DidComposite(mLatestTransactionId);
}
ClearCachedResources();
// Stop receiveing AsyncParentMessage at Forwarder.
// After the call, the message is directly handled by LayerTransactionChild.
Expand Down Expand Up @@ -422,13 +426,13 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
{
mPhase = PHASE_FORWARD;

uint64_t pendingTransactionId = mTransactionIdAllocator->GetTransactionId();
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();

// forward this transaction's changeset to our LayerManagerComposite
bool sent;
AutoInfallibleTArray<EditReply, 10> replies;
if (HasShadowManager() && mForwarder->EndTransaction(&replies, mRegionToClear,
pendingTransactionId, aScheduleComposite, mPaintSequenceNumber, &sent)) {
mLatestTransactionId, aScheduleComposite, mPaintSequenceNumber, &sent)) {
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
const EditReply& reply = replies[i];

Expand Down Expand Up @@ -486,7 +490,7 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
// Clear the transaction id so that it doesn't get returned
// unless we forwarded to somewhere that doesn't actually
// have a compositor.
mTransactionIdAllocator->RevokeTransactionId(pendingTransactionId);
mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
}
} else if (HasShadowManager()) {
NS_WARNING("failed to forward Layers transaction");
Expand Down
1 change: 1 addition & 0 deletions gfx/layers/client/ClientLayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class ClientLayerManager : public LayerManager
nsRefPtr<gfxContext> mShadowTarget;

nsRefPtr<TransactionIdAllocator> mTransactionIdAllocator;
uint64_t mLatestTransactionId;

// Sometimes we draw to targets that don't natively support
// landscape/portrait orientation. When we need to implement that
Expand Down
5 changes: 3 additions & 2 deletions layout/base/nsRefreshDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,9 @@ void
nsRefreshDriver::FinishedWaitingForTransaction()
{
mWaitingForTransaction = false;
if (mSkippedPaint && (ObserverCount() || ImageRequestCount())) {
MOZ_ASSERT(!IsInRefresh());
if (mSkippedPaint &&
!IsInRefresh() &&
(ObserverCount() || ImageRequestCount())) {
DoRefresh();
}
mSkippedPaint = false;
Expand Down

0 comments on commit 89a5359

Please sign in to comment.