2010-07-21 21:17:33 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
#include "ShadowLayers.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include <set> // for _Rb_tree_const_iterator, etc
|
|
|
|
#include <vector> // for vector
|
2013-08-22 07:11:51 +00:00
|
|
|
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "ISurfaceAllocator.h" // for IsSurfaceDescriptorValid
|
|
|
|
#include "Layers.h" // for Layer
|
|
|
|
#include "RenderTrace.h" // for RenderTraceScope
|
|
|
|
#include "ShadowLayerChild.h" // for ShadowLayerChild
|
2013-12-20 16:46:29 +00:00
|
|
|
#include "gfx2DGlue.h" // for Moz2D transition helpers
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "gfxPlatform.h" // for gfxImageFormat, gfxPlatform
|
|
|
|
#include "gfxSharedImageSurface.h" // for gfxSharedImageSurface
|
|
|
|
#include "ipc/IPCMessageUtils.h" // for gfxContentType, null_t
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
2013-12-20 16:46:30 +00:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/CompositableClient.h" // for CompositableClient, etc
|
2013-09-06 15:41:00 +00:00
|
|
|
#include "mozilla/layers/LayersMessages.h" // for Edit, etc
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
|
2013-11-27 15:19:34 +00:00
|
|
|
#include "mozilla/layers/LayerTransactionChild.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "ShadowLayerUtils.h"
|
|
|
|
#include "mozilla/layers/TextureClient.h" // for TextureClient
|
|
|
|
#include "mozilla/mozalloc.h" // for operator new, etc
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc
|
|
|
|
#include "nsDebug.h" // for NS_ABORT_IF_FALSE, etc
|
|
|
|
#include "nsRect.h" // for nsIntRect
|
|
|
|
#include "nsSize.h" // for nsIntSize
|
|
|
|
#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
|
|
|
|
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-08-11 23:17:23 +00:00
|
|
|
struct nsIntPoint;
|
2013-05-27 14:12:13 +00:00
|
|
|
|
2010-09-28 00:59:43 +00:00
|
|
|
using namespace mozilla::ipc;
|
2012-10-25 20:12:59 +00:00
|
|
|
using namespace mozilla::gl;
|
2012-11-22 02:40:57 +00:00
|
|
|
using namespace mozilla::dom;
|
2010-09-28 00:59:43 +00:00
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
namespace mozilla {
|
2013-08-11 23:17:23 +00:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
namespace layers {
|
|
|
|
|
2014-03-07 21:34:04 +00:00
|
|
|
class ClientTiledLayerBuffer;
|
2013-08-11 23:17:23 +00:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
typedef nsTArray<SurfaceDescriptor> BufferArray;
|
2010-07-21 21:17:33 +00:00
|
|
|
typedef std::vector<Edit> EditVector;
|
|
|
|
typedef std::set<ShadowableLayer*> ShadowableLayerSet;
|
|
|
|
|
|
|
|
class Transaction
|
|
|
|
{
|
|
|
|
public:
|
2012-05-01 19:23:39 +00:00
|
|
|
Transaction()
|
2013-02-26 05:18:20 +00:00
|
|
|
: mTargetRotation(ROTATION_0)
|
|
|
|
, mSwapRequired(false)
|
2012-05-18 08:29:38 +00:00
|
|
|
, mOpen(false)
|
2012-11-06 09:11:43 +00:00
|
|
|
, mRotationChanged(false)
|
2012-05-01 19:23:39 +00:00
|
|
|
{}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2012-11-22 02:40:57 +00:00
|
|
|
void Begin(const nsIntRect& aTargetBounds, ScreenRotation aRotation,
|
|
|
|
const nsIntRect& aClientBounds, ScreenOrientation aOrientation)
|
2012-07-24 19:01:09 +00:00
|
|
|
{
|
|
|
|
mOpen = true;
|
|
|
|
mTargetBounds = aTargetBounds;
|
2012-11-06 09:11:43 +00:00
|
|
|
if (aRotation != mTargetRotation) {
|
2013-02-26 05:18:20 +00:00
|
|
|
// the first time this is called, mRotationChanged will be false if
|
|
|
|
// aRotation is 0, but we should be OK because for the first transaction
|
|
|
|
// we should only compose if it is non-empty. See the caller(s) of
|
|
|
|
// RotationChanged.
|
|
|
|
mRotationChanged = true;
|
2012-11-06 09:11:43 +00:00
|
|
|
}
|
2012-07-24 19:01:09 +00:00
|
|
|
mTargetRotation = aRotation;
|
2012-11-22 02:40:57 +00:00
|
|
|
mClientBounds = aClientBounds;
|
|
|
|
mTargetOrientation = aOrientation;
|
2012-07-24 19:01:09 +00:00
|
|
|
}
|
2013-09-12 14:50:28 +00:00
|
|
|
void MarkSyncTransaction()
|
|
|
|
{
|
|
|
|
mSwapRequired = true;
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
void AddEdit(const Edit& aEdit)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mCset.push_back(aEdit);
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void AddEdit(const CompositableOperation& aEdit)
|
|
|
|
{
|
|
|
|
AddEdit(Edit(aEdit));
|
|
|
|
}
|
2010-09-15 21:03:13 +00:00
|
|
|
void AddPaint(const Edit& aPaint)
|
2012-05-01 19:23:39 +00:00
|
|
|
{
|
|
|
|
AddNoSwapPaint(aPaint);
|
|
|
|
mSwapRequired = true;
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void AddPaint(const CompositableOperation& aPaint)
|
|
|
|
{
|
|
|
|
AddNoSwapPaint(Edit(aPaint));
|
|
|
|
mSwapRequired = true;
|
|
|
|
}
|
|
|
|
|
2012-05-01 19:23:39 +00:00
|
|
|
void AddNoSwapPaint(const Edit& aPaint)
|
2010-09-15 21:03:13 +00:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mPaints.push_back(aPaint);
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void AddNoSwapPaint(const CompositableOperation& aPaint)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mPaints.push_back(Edit(aPaint));
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
void AddMutant(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mMutants.insert(aLayer);
|
|
|
|
}
|
|
|
|
void End()
|
|
|
|
{
|
|
|
|
mCset.clear();
|
2010-09-15 21:03:13 +00:00
|
|
|
mPaints.clear();
|
2010-07-21 21:17:33 +00:00
|
|
|
mMutants.clear();
|
2011-10-17 14:59:28 +00:00
|
|
|
mOpen = false;
|
2012-05-01 19:23:39 +00:00
|
|
|
mSwapRequired = false;
|
2012-11-06 09:11:43 +00:00
|
|
|
mRotationChanged = false;
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool Empty() const {
|
2010-09-15 21:03:13 +00:00
|
|
|
return mCset.empty() && mPaints.empty() && mMutants.empty();
|
|
|
|
}
|
2012-11-06 09:11:43 +00:00
|
|
|
bool RotationChanged() const {
|
|
|
|
return mRotationChanged;
|
|
|
|
}
|
2011-09-29 06:19:26 +00:00
|
|
|
bool Finished() const { return !mOpen && Empty(); }
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
EditVector mCset;
|
2010-09-15 21:03:13 +00:00
|
|
|
EditVector mPaints;
|
2010-07-21 21:17:33 +00:00
|
|
|
ShadowableLayerSet mMutants;
|
2012-07-24 19:01:09 +00:00
|
|
|
nsIntRect mTargetBounds;
|
|
|
|
ScreenRotation mTargetRotation;
|
2012-11-22 02:40:57 +00:00
|
|
|
nsIntRect mClientBounds;
|
|
|
|
ScreenOrientation mTargetOrientation;
|
2012-05-01 19:23:39 +00:00
|
|
|
bool mSwapRequired;
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mOpen;
|
2012-11-06 09:11:43 +00:00
|
|
|
bool mRotationChanged;
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
// disabled
|
|
|
|
Transaction(const Transaction&);
|
|
|
|
Transaction& operator=(const Transaction&);
|
|
|
|
};
|
|
|
|
struct AutoTxnEnd {
|
|
|
|
AutoTxnEnd(Transaction* aTxn) : mTxn(aTxn) {}
|
|
|
|
~AutoTxnEnd() { mTxn->End(); }
|
|
|
|
Transaction* mTxn;
|
|
|
|
};
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void
|
|
|
|
CompositableForwarder::IdentifyTextureHost(const TextureFactoryIdentifier& aIdentifier)
|
|
|
|
{
|
2013-07-12 02:32:09 +00:00
|
|
|
mTextureFactoryIdentifier = aIdentifier;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
}
|
|
|
|
|
2010-12-31 07:40:19 +00:00
|
|
|
ShadowLayerForwarder::ShadowLayerForwarder()
|
2014-04-26 02:34:06 +00:00
|
|
|
: mDiagnosticTypes(DiagnosticTypes::NO_DIAGNOSTIC)
|
2012-03-12 15:50:15 +00:00
|
|
|
, mIsFirstPaint(false)
|
2013-06-20 13:01:20 +00:00
|
|
|
, mWindowOverlayChanged(false)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
|
|
|
mTxn = new Transaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
ShadowLayerForwarder::~ShadowLayerForwarder()
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(mTxn->Finished(), "unfinished transaction?");
|
|
|
|
delete mTxn;
|
2014-05-06 01:56:40 +00:00
|
|
|
if (mShadowManager) {
|
|
|
|
mShadowManager->SetForwarder(nullptr);
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-07-24 19:01:09 +00:00
|
|
|
ShadowLayerForwarder::BeginTransaction(const nsIntRect& aTargetBounds,
|
2012-11-22 02:40:57 +00:00
|
|
|
ScreenRotation aRotation,
|
|
|
|
const nsIntRect& aClientBounds,
|
|
|
|
ScreenOrientation aOrientation)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
|
|
|
NS_ABORT_IF_FALSE(mTxn->Finished(), "uncommitted txn?");
|
2012-11-22 02:40:57 +00:00
|
|
|
mTxn->Begin(aTargetBounds, aRotation, aClientBounds, aOrientation);
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static PLayerChild*
|
|
|
|
Shadow(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
return aLayer->GetShadow();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename OpCreateT>
|
|
|
|
static void
|
|
|
|
CreatedLayer(Transaction* aTxn, ShadowableLayer* aLayer)
|
|
|
|
{
|
2013-07-20 08:48:55 +00:00
|
|
|
aTxn->AddEdit(OpCreateT(nullptr, Shadow(aLayer)));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedThebesLayer(ShadowableLayer* aThebes)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateThebesLayer>(mTxn, aThebes);
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedContainerLayer(ShadowableLayer* aContainer)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateContainerLayer>(mTxn, aContainer);
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedImageLayer(ShadowableLayer* aImage)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateImageLayer>(mTxn, aImage);
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedColorLayer(ShadowableLayer* aColor)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateColorLayer>(mTxn, aColor);
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedCanvasLayer(ShadowableLayer* aCanvas)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateCanvasLayer>(mTxn, aCanvas);
|
|
|
|
}
|
2012-07-17 23:59:45 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedRefLayer(ShadowableLayer* aRef)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateRefLayer>(mTxn, aRef);
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2010-09-03 03:05:01 +00:00
|
|
|
void
|
2010-07-21 21:17:33 +00:00
|
|
|
ShadowLayerForwarder::Mutated(ShadowableLayer* aMutant)
|
|
|
|
{
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
mTxn->AddMutant(aMutant);
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::SetRoot(ShadowableLayer* aRoot)
|
|
|
|
{
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpSetRoot(nullptr, Shadow(aRoot)));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::InsertAfter(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild,
|
|
|
|
ShadowableLayer* aAfter)
|
|
|
|
{
|
|
|
|
if (aAfter)
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpInsertAfter(nullptr, Shadow(aContainer),
|
|
|
|
nullptr, Shadow(aChild),
|
|
|
|
nullptr, Shadow(aAfter)));
|
2010-07-21 21:17:33 +00:00
|
|
|
else
|
2014-02-24 14:41:55 +00:00
|
|
|
mTxn->AddEdit(OpPrependChild(nullptr, Shadow(aContainer),
|
|
|
|
nullptr, Shadow(aChild)));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RemoveChild(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild)
|
|
|
|
{
|
2013-03-22 02:17:28 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRemoveChild container=%p child=%p\n",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer()));
|
|
|
|
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpRemoveChild(nullptr, Shadow(aContainer),
|
|
|
|
nullptr, Shadow(aChild)));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
2012-08-29 10:52:55 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RepositionChild(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild,
|
|
|
|
ShadowableLayer* aAfter)
|
|
|
|
{
|
2013-03-22 02:17:28 +00:00
|
|
|
if (aAfter) {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRepositionChild container=%p child=%p after=%p",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer(), aAfter->AsLayer()));
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpRepositionChild(nullptr, Shadow(aContainer),
|
|
|
|
nullptr, Shadow(aChild),
|
|
|
|
nullptr, Shadow(aAfter)));
|
2013-03-22 02:17:28 +00:00
|
|
|
} else {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRaiseToTopChild container=%p child=%p",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer()));
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpRaiseToTopChild(nullptr, Shadow(aContainer),
|
|
|
|
nullptr, Shadow(aChild)));
|
2013-03-22 02:17:28 +00:00
|
|
|
}
|
2012-08-29 10:52:55 +00:00
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-10-21 14:23:42 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CheckSurfaceDescriptor(const SurfaceDescriptor* aDescriptor) const
|
|
|
|
{
|
|
|
|
if (!aDescriptor) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-04-07 01:32:49 +00:00
|
|
|
if (aDescriptor->type() == SurfaceDescriptor::TSurfaceDescriptorShmem) {
|
|
|
|
const SurfaceDescriptorShmem& shmem = aDescriptor->get_SurfaceDescriptorShmem();
|
|
|
|
shmem.data().AssertInvariants();
|
2013-11-01 06:36:02 +00:00
|
|
|
MOZ_ASSERT(mShadowManager &&
|
2014-04-07 01:32:49 +00:00
|
|
|
mShadowManager->IsTrackingSharedMemory(shmem.data().mSegment));
|
2013-10-21 14:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-04-13 15:17:39 +00:00
|
|
|
void
|
2014-03-07 21:34:04 +00:00
|
|
|
ShadowLayerForwarder::UseTiledLayerBuffer(CompositableClient* aCompositable,
|
|
|
|
const SurfaceDescriptorTiles& aTileLayerDescriptor)
|
2012-04-13 15:17:39 +00:00
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
2014-03-07 21:34:04 +00:00
|
|
|
mTxn->AddNoSwapPaint(OpUseTiledLayerBuffer(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
aTileLayerDescriptor));
|
2012-04-13 15:17:39 +00:00
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
void
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
|
|
|
|
const ThebesBufferData& aThebesBufferData,
|
|
|
|
const nsIntRegion& aUpdatedRegion)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
mTxn->AddPaint(OpPaintTextureRegion(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
aThebesBufferData,
|
|
|
|
aUpdatedRegion));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2013-05-16 03:45:43 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::UpdateTextureIncremental(CompositableClient* aCompositable,
|
|
|
|
TextureIdentifier aTextureId,
|
|
|
|
SurfaceDescriptor& aDescriptor,
|
|
|
|
const nsIntRegion& aUpdatedRegion,
|
|
|
|
const nsIntRect& aBufferRect,
|
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
2013-10-21 14:23:42 +00:00
|
|
|
CheckSurfaceDescriptor(&aDescriptor);
|
2013-05-16 03:45:43 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
2013-05-22 03:36:38 +00:00
|
|
|
mTxn->AddNoSwapPaint(OpPaintTextureIncremental(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
aTextureId,
|
|
|
|
aDescriptor,
|
|
|
|
aUpdatedRegion,
|
|
|
|
aBufferRect,
|
|
|
|
aBufferRotation));
|
2013-05-16 03:45:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-22 19:22:20 +00:00
|
|
|
void
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
|
|
|
|
const nsIntRect& aRect)
|
2013-03-22 19:22:20 +00:00
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
mTxn->AddNoSwapPaint(OpUpdatePictureRect(nullptr, aCompositable->GetIPDLActor(), aRect));
|
2013-03-22 19:22:20 +00:00
|
|
|
}
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::UpdatedTexture(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aTexture,
|
|
|
|
nsIntRegion* aRegion)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aTexture);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
MOZ_ASSERT(aTexture->GetIPDLActor());
|
2013-07-30 09:59:51 +00:00
|
|
|
MaybeRegion region = aRegion ? MaybeRegion(*aRegion)
|
|
|
|
: MaybeRegion(null_t());
|
2014-04-26 02:34:05 +00:00
|
|
|
if (aTexture->GetFlags() & TextureFlags::IMMEDIATE_UPLOAD) {
|
2013-08-03 17:30:28 +00:00
|
|
|
mTxn->AddPaint(OpUpdateTexture(nullptr, aCompositable->GetIPDLActor(),
|
2013-12-12 01:44:44 +00:00
|
|
|
nullptr, aTexture->GetIPDLActor(),
|
2013-08-03 17:30:28 +00:00
|
|
|
region));
|
|
|
|
} else {
|
|
|
|
mTxn->AddNoSwapPaint(OpUpdateTexture(nullptr, aCompositable->GetIPDLActor(),
|
2013-12-12 01:44:44 +00:00
|
|
|
nullptr, aTexture->GetIPDLActor(),
|
2013-08-03 17:30:28 +00:00
|
|
|
region));
|
|
|
|
}
|
2013-07-30 09:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::UseTexture(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aTexture)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aTexture);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
MOZ_ASSERT(aTexture->GetIPDLActor());
|
2013-07-30 09:59:51 +00:00
|
|
|
mTxn->AddEdit(OpUseTexture(nullptr, aCompositable->GetIPDLActor(),
|
2013-12-12 01:44:44 +00:00
|
|
|
nullptr, aTexture->GetIPDLActor()));
|
2013-12-11 18:05:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-06 11:28:29 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::UseComponentAlphaTextures(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aTextureOnBlack,
|
|
|
|
TextureClient* aTextureOnWhite)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aTextureOnWhite);
|
|
|
|
MOZ_ASSERT(aTextureOnBlack);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
MOZ_ASSERT(aTextureOnBlack->GetIPDLActor());
|
|
|
|
MOZ_ASSERT(aTextureOnWhite->GetIPDLActor());
|
2014-03-21 17:03:20 +00:00
|
|
|
MOZ_ASSERT(aTextureOnBlack->GetSize() == aTextureOnWhite->GetSize());
|
2014-02-06 11:28:29 +00:00
|
|
|
mTxn->AddEdit(OpUseComponentAlphaTextures(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
nullptr, aTextureOnBlack->GetIPDLActor(),
|
|
|
|
nullptr, aTextureOnWhite->GetIPDLActor()));
|
|
|
|
}
|
|
|
|
|
2014-02-10 20:52:35 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RemoveTextureFromCompositable(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aTexture)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aTexture);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
MOZ_ASSERT(aTexture->GetIPDLActor());
|
2014-02-10 20:52:35 +00:00
|
|
|
mTxn->AddEdit(OpRemoveTexture(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
nullptr, aTexture->GetIPDLActor()));
|
2014-04-26 02:34:05 +00:00
|
|
|
if (aTexture->GetFlags() & TextureFlags::DEALLOCATE_CLIENT) {
|
2014-02-10 20:52:35 +00:00
|
|
|
mTxn->MarkSyncTransaction();
|
|
|
|
}
|
|
|
|
// Hold texture until transaction complete.
|
|
|
|
HoldUntilTransaction(aTexture);
|
|
|
|
}
|
|
|
|
|
2013-12-12 01:44:45 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RemoveTexture(TextureClient* aTexture)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aTexture);
|
2013-12-12 01:44:45 +00:00
|
|
|
aTexture->ForceRemove();
|
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
2014-03-28 03:38:32 +00:00
|
|
|
ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
|
|
|
const nsIntRegion& aRegionToClear,
|
|
|
|
bool aScheduleComposite,
|
|
|
|
bool* aSent)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
2013-10-21 20:14:47 +00:00
|
|
|
*aSent = false;
|
|
|
|
|
2013-03-16 04:47:02 +00:00
|
|
|
PROFILER_LABEL("ShadowLayerForwarder", "EndTranscation");
|
2012-02-28 16:24:24 +00:00
|
|
|
RenderTraceScope rendertrace("Foward Transaction", "000091");
|
2010-07-21 21:17:33 +00:00
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
|
|
|
NS_ABORT_IF_FALSE(!mTxn->Finished(), "forgot BeginTransaction?");
|
|
|
|
|
2013-08-02 22:50:17 +00:00
|
|
|
DiagnosticTypes diagnostics = gfxPlatform::GetPlatform()->GetLayerDiagnosticTypes();
|
|
|
|
if (mDiagnosticTypes != diagnostics) {
|
|
|
|
mDiagnosticTypes = diagnostics;
|
|
|
|
mTxn->AddEdit(OpSetDiagnosticTypes(diagnostics));
|
2013-03-21 17:08:01 +00:00
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
AutoTxnEnd _(mTxn);
|
|
|
|
|
2013-06-20 13:01:20 +00:00
|
|
|
if (mTxn->Empty() && !mTxn->RotationChanged() && !mWindowOverlayChanged) {
|
2012-11-06 09:11:43 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] 0-length cset (?) and no rotation event, skipping Update()"));
|
2011-10-17 14:59:28 +00:00
|
|
|
return true;
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2010-09-14 05:23:08 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] destroying buffers..."));
|
|
|
|
|
2010-09-14 05:23:08 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] building transaction..."));
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2010-09-15 21:03:13 +00:00
|
|
|
// We purposely add attribute-change ops to the final changeset
|
|
|
|
// before we add paint ops. This allows layers to record the
|
|
|
|
// attribute changes before new pixels arrive, which can be useful
|
|
|
|
// for setting up back/front buffers.
|
2012-02-28 16:24:24 +00:00
|
|
|
RenderTraceScope rendertrace2("Foward Transaction", "000092");
|
2010-07-21 21:17:33 +00:00
|
|
|
for (ShadowableLayerSet::const_iterator it = mTxn->mMutants.begin();
|
|
|
|
it != mTxn->mMutants.end(); ++it) {
|
|
|
|
ShadowableLayer* shadow = *it;
|
|
|
|
Layer* mutant = shadow->AsLayer();
|
|
|
|
NS_ABORT_IF_FALSE(!!mutant, "unshadowable layer?");
|
|
|
|
|
|
|
|
LayerAttributes attrs;
|
|
|
|
CommonLayerAttributes& common = attrs.common();
|
|
|
|
common.visibleRegion() = mutant->GetVisibleRegion();
|
2013-12-16 10:47:06 +00:00
|
|
|
common.eventRegions() = mutant->GetEventRegions();
|
2012-08-03 21:29:22 +00:00
|
|
|
common.postXScale() = mutant->GetPostXScale();
|
|
|
|
common.postYScale() = mutant->GetPostYScale();
|
2012-07-31 02:20:00 +00:00
|
|
|
common.transform() = mutant->GetBaseTransform();
|
2010-09-02 09:18:40 +00:00
|
|
|
common.contentFlags() = mutant->GetContentFlags();
|
2010-07-21 21:17:33 +00:00
|
|
|
common.opacity() = mutant->GetOpacity();
|
|
|
|
common.useClipRect() = !!mutant->GetClipRect();
|
|
|
|
common.clipRect() = (common.useClipRect() ?
|
|
|
|
*mutant->GetClipRect() : nsIntRect());
|
2011-04-06 05:00:25 +00:00
|
|
|
common.isFixedPosition() = mutant->GetIsFixedPosition();
|
2012-06-27 15:43:57 +00:00
|
|
|
common.fixedPositionAnchor() = mutant->GetFixedPositionAnchor();
|
2013-04-12 22:41:18 +00:00
|
|
|
common.fixedPositionMargin() = mutant->GetFixedPositionMargins();
|
2013-09-12 04:17:58 +00:00
|
|
|
common.isStickyPosition() = mutant->GetIsStickyPosition();
|
|
|
|
if (mutant->GetIsStickyPosition()) {
|
|
|
|
common.stickyScrollContainerId() = mutant->GetStickyScrollContainerId();
|
|
|
|
common.stickyScrollRangeOuter() = mutant->GetStickyScrollRangeOuter();
|
|
|
|
common.stickyScrollRangeInner() = mutant->GetStickyScrollRangeInner();
|
|
|
|
}
|
2013-12-12 18:34:50 +00:00
|
|
|
common.scrollbarTargetContainerId() = mutant->GetScrollbarTargetContainerId();
|
|
|
|
common.scrollbarDirection() = mutant->GetScrollbarDirection();
|
2012-03-18 23:02:38 +00:00
|
|
|
if (Layer* maskLayer = mutant->GetMaskLayer()) {
|
|
|
|
common.maskLayerChild() = Shadow(maskLayer->AsShadowableLayer());
|
|
|
|
} else {
|
2013-07-20 08:48:55 +00:00
|
|
|
common.maskLayerChild() = nullptr;
|
2012-03-18 23:02:38 +00:00
|
|
|
}
|
2013-07-20 08:48:55 +00:00
|
|
|
common.maskLayerParent() = nullptr;
|
2012-07-31 17:28:20 +00:00
|
|
|
common.animations() = mutant->GetAnimations();
|
2013-11-21 19:25:16 +00:00
|
|
|
common.invalidRegion() = mutant->GetInvalidRegion();
|
2010-07-21 21:17:33 +00:00
|
|
|
attrs.specific() = null_t();
|
|
|
|
mutant->FillSpecificAttributes(attrs.specific());
|
|
|
|
|
2013-03-22 02:17:28 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpSetLayerAttributes(%p)\n", mutant));
|
|
|
|
|
2013-07-20 08:48:55 +00:00
|
|
|
mTxn->AddEdit(OpSetLayerAttributes(nullptr, Shadow(shadow), attrs));
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2010-11-09 02:49:00 +00:00
|
|
|
AutoInfallibleTArray<Edit, 10> cset;
|
2010-09-15 21:03:13 +00:00
|
|
|
size_t nCsets = mTxn->mCset.size() + mTxn->mPaints.size();
|
2013-06-20 13:01:20 +00:00
|
|
|
NS_ABORT_IF_FALSE(nCsets > 0 || mWindowOverlayChanged, "should have bailed by now");
|
2010-09-15 21:03:13 +00:00
|
|
|
|
|
|
|
cset.SetCapacity(nCsets);
|
2010-09-20 19:40:30 +00:00
|
|
|
if (!mTxn->mCset.empty()) {
|
|
|
|
cset.AppendElements(&mTxn->mCset.front(), mTxn->mCset.size());
|
|
|
|
}
|
2010-09-15 21:03:13 +00:00
|
|
|
// Paints after non-paint ops, including attribute changes. See
|
|
|
|
// above.
|
2010-09-20 19:40:30 +00:00
|
|
|
if (!mTxn->mPaints.empty()) {
|
|
|
|
cset.AppendElements(&mTxn->mPaints.front(), mTxn->mPaints.size());
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-06-20 13:01:20 +00:00
|
|
|
mWindowOverlayChanged = false;
|
|
|
|
|
2014-03-28 03:38:32 +00:00
|
|
|
TargetConfig targetConfig(mTxn->mTargetBounds,
|
|
|
|
mTxn->mTargetRotation,
|
|
|
|
mTxn->mClientBounds,
|
|
|
|
mTxn->mTargetOrientation,
|
|
|
|
aRegionToClear);
|
2012-07-24 19:01:09 +00:00
|
|
|
|
2010-09-14 05:23:08 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] syncing before send..."));
|
|
|
|
PlatformSyncBeforeUpdate();
|
|
|
|
|
2013-09-27 16:08:45 +00:00
|
|
|
profiler_tracing("Paint", "Rasterize", TRACING_INTERVAL_END);
|
2012-05-01 19:23:39 +00:00
|
|
|
if (mTxn->mSwapRequired) {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
|
|
|
|
RenderTraceScope rendertrace3("Forward Transaction", "000093");
|
2013-11-01 06:36:02 +00:00
|
|
|
if (!HasShadowManager() ||
|
2014-04-16 01:59:09 +00:00
|
|
|
!mShadowManager->IPCOpen() ||
|
2013-11-01 06:36:02 +00:00
|
|
|
!mShadowManager->SendUpdate(cset, targetConfig, mIsFirstPaint,
|
2013-12-16 05:38:42 +00:00
|
|
|
aScheduleComposite, aReplies)) {
|
2012-05-01 19:23:39 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// If we don't require a swap we can call SendUpdateNoSwap which
|
|
|
|
// assumes that aReplies is empty (DEBUG assertion)
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] sending no swap transaction..."));
|
|
|
|
RenderTraceScope rendertrace3("Forward NoSwap Transaction", "000093");
|
2013-11-01 06:36:02 +00:00
|
|
|
if (!HasShadowManager() ||
|
2014-04-16 01:59:09 +00:00
|
|
|
!mShadowManager->IPCOpen() ||
|
2013-12-16 05:38:42 +00:00
|
|
|
!mShadowManager->SendUpdateNoSwap(cset, targetConfig, mIsFirstPaint, aScheduleComposite)) {
|
2012-05-01 19:23:39 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2013-10-21 20:14:47 +00:00
|
|
|
*aSent = true;
|
2012-03-12 15:50:15 +00:00
|
|
|
mIsFirstPaint = false;
|
2010-07-21 21:17:33 +00:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] ... done"));
|
2011-10-17 14:59:28 +00:00
|
|
|
return true;
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
ShadowLayerForwarder::AllocShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
2013-11-01 06:36:02 +00:00
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no shadow manager");
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return false;
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
return mShadowManager->AllocShmem(aSize, aType, aShmem);
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
ShadowLayerForwarder::AllocUnsafeShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem)
|
2012-07-12 12:51:57 +00:00
|
|
|
{
|
2013-11-01 06:36:02 +00:00
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no shadow manager");
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return false;
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
return mShadowManager->AllocUnsafeShmem(aSize, aType, aShmem);
|
2012-07-12 12:51:57 +00:00
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::DeallocShmem(ipc::Shmem& aShmem)
|
|
|
|
{
|
2013-11-01 06:36:02 +00:00
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no shadow manager");
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return;
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
mShadowManager->DeallocShmem(aShmem);
|
2010-12-31 07:40:31 +00:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:18:38 +00:00
|
|
|
bool
|
|
|
|
ShadowLayerForwarder::IPCOpen() const
|
|
|
|
{
|
|
|
|
return mShadowManager->IPCOpen();
|
|
|
|
}
|
|
|
|
|
2014-02-25 13:12:49 +00:00
|
|
|
bool
|
|
|
|
ShadowLayerForwarder::IsSameProcess() const
|
|
|
|
{
|
2014-04-16 01:59:09 +00:00
|
|
|
if (!mShadowManager->IPCOpen()) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-02-25 13:12:49 +00:00
|
|
|
return mShadowManager->OtherProcess() == kInvalidProcessHandle;
|
|
|
|
}
|
|
|
|
|
2013-11-01 06:36:02 +00:00
|
|
|
/**
|
|
|
|
* We bail out when we have no shadow manager. That can happen when the
|
|
|
|
* layer manager is created by the preallocated process.
|
|
|
|
* See bug 914843 for details.
|
|
|
|
*/
|
2010-07-21 21:17:33 +00:00
|
|
|
PLayerChild*
|
|
|
|
ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return nullptr;
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
return mShadowManager->SendPLayerConstructor(new ShadowLayerChild(aLayer));
|
|
|
|
}
|
|
|
|
|
2010-09-14 05:23:08 +00:00
|
|
|
#if !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::Connect(CompositableClient* aCompositable)
|
|
|
|
{
|
|
|
|
#ifdef GFX_COMPOSITOR_LOGGING
|
|
|
|
printf("ShadowLayerForwarder::Connect(Compositable)\n");
|
|
|
|
#endif
|
|
|
|
MOZ_ASSERT(aCompositable);
|
2013-11-01 06:36:02 +00:00
|
|
|
MOZ_ASSERT(mShadowManager);
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-04-24 18:13:59 +00:00
|
|
|
PCompositableChild* actor =
|
|
|
|
mShadowManager->SendPCompositableConstructor(aCompositable->GetTextureInfo());
|
|
|
|
MOZ_ASSERT(actor);
|
|
|
|
aCompositable->InitIPDLActor(actor);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
}
|
|
|
|
|
2013-05-16 03:45:43 +00:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
const nsIntRect& aBufferRect)
|
|
|
|
{
|
2014-04-11 16:47:56 +00:00
|
|
|
MOZ_ASSERT(aCompositable);
|
2013-05-22 03:36:38 +00:00
|
|
|
mTxn->AddNoSwapPaint(OpCreatedIncrementalTexture(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
aTextureInfo, aBufferRect));
|
2013-05-16 03:45:43 +00:00
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
void ShadowLayerForwarder::Attach(CompositableClient* aCompositable,
|
|
|
|
ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aLayer);
|
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
mTxn->AddEdit(OpAttachCompositable(nullptr, Shadow(aLayer),
|
|
|
|
nullptr, aCompositable->GetIPDLActor()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShadowLayerForwarder::AttachAsyncCompositable(uint64_t aCompositableID,
|
|
|
|
ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aLayer);
|
|
|
|
MOZ_ASSERT(aCompositableID != 0); // zero is always an invalid compositable id.
|
|
|
|
mTxn->AddEdit(OpAttachAsyncCompositable(nullptr, Shadow(aLayer),
|
|
|
|
aCompositableID));
|
|
|
|
}
|
2012-07-12 12:51:58 +00:00
|
|
|
|
2013-12-12 01:44:44 +00:00
|
|
|
PTextureChild*
|
2014-01-21 22:06:18 +00:00
|
|
|
ShadowLayerForwarder::CreateTexture(const SurfaceDescriptor& aSharedData,
|
|
|
|
TextureFlags aFlags)
|
2013-12-12 01:44:44 +00:00
|
|
|
{
|
2014-05-06 01:56:40 +00:00
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
2014-04-16 01:59:09 +00:00
|
|
|
return nullptr;
|
|
|
|
}
|
2014-01-21 22:06:18 +00:00
|
|
|
return mShadowManager->SendPTextureConstructor(aSharedData, aFlags);
|
2013-12-12 01:44:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-11-27 15:19:34 +00:00
|
|
|
void ShadowLayerForwarder::SetShadowManager(PLayerTransactionChild* aShadowManager)
|
|
|
|
{
|
|
|
|
mShadowManager = static_cast<LayerTransactionChild*>(aShadowManager);
|
2014-05-06 01:56:40 +00:00
|
|
|
mShadowManager->SetForwarder(this);
|
2013-11-27 15:19:34 +00:00
|
|
|
}
|
|
|
|
|
2014-05-06 01:56:40 +00:00
|
|
|
void ShadowLayerForwarder::StopReceiveAsyncParentMessge()
|
|
|
|
{
|
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SendPendingAsyncMessge();
|
|
|
|
mShadowManager->SetForwarder(nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShadowLayerForwarder::ClearCachedResources()
|
|
|
|
{
|
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SendPendingAsyncMessge();
|
|
|
|
mShadowManager->SendClearCachedResources();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShadowLayerForwarder::Composite()
|
|
|
|
{
|
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mShadowManager->SendForceComposite();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShadowLayerForwarder::SendPendingAsyncMessge()
|
|
|
|
{
|
|
|
|
if (!HasShadowManager() ||
|
|
|
|
!mShadowManager->IPCOpen() ||
|
|
|
|
mTransactionsToRespond.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Send OpReplyDeliverFence messages
|
|
|
|
InfallibleTArray<AsyncChildMessageData> replies;
|
|
|
|
replies.SetCapacity(mTransactionsToRespond.size());
|
|
|
|
for (size_t i = 0; i < mTransactionsToRespond.size(); i++) {
|
|
|
|
replies.AppendElement(OpReplyDeliverFence(mTransactionsToRespond[i]));
|
|
|
|
}
|
|
|
|
mTransactionsToRespond.clear();
|
|
|
|
mShadowManager->SendChildAsyncMessages(replies);
|
|
|
|
}
|
2013-11-27 15:19:34 +00:00
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|