2010-07-21 14:17:33 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 04:12:37 -07: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 14:17:33 -07:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "gfxSharedImageSurface.h"
|
2012-05-25 21:38:17 -07:00
|
|
|
#include "gfxPlatform.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
#include "AutoOpenSurface.h"
|
2010-09-27 17:59:43 -07:00
|
|
|
#include "mozilla/ipc/SharedMemorySysV.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
#include "mozilla/layers/PLayerChild.h"
|
|
|
|
#include "mozilla/layers/PLayersChild.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
#include "mozilla/layers/PLayersParent.h"
|
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 02:20:52 -07:00
|
|
|
#include "mozilla/layers/TextureChild.h"
|
|
|
|
#include "mozilla/layers/LayerTransaction.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
#include "ShadowLayers.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
#include "ShadowLayerChild.h"
|
2012-01-03 11:36:00 -08:00
|
|
|
#include "gfxipc/ShadowLayerUtils.h"
|
2012-02-28 08:24:24 -08:00
|
|
|
#include "RenderTrace.h"
|
2013-03-18 07:25:50 -07:00
|
|
|
#include "GeckoProfiler.h"
|
2012-04-13 08:17:39 -07:00
|
|
|
#include "nsXULAppAPI.h"
|
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 02:20:52 -07:00
|
|
|
#include "mozilla/layers/TextureClient.h"
|
|
|
|
#include "mozilla/layers/ImageClient.h"
|
|
|
|
#include "mozilla/layers/CanvasClient.h"
|
|
|
|
#include "mozilla/layers/ContentClient.h"
|
|
|
|
#include "ISurfaceAllocator.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2010-09-27 17:59:43 -07:00
|
|
|
using namespace mozilla::ipc;
|
2012-10-25 13:12:59 -07:00
|
|
|
using namespace mozilla::gl;
|
2012-11-21 18:40:57 -08:00
|
|
|
using namespace mozilla::dom;
|
2010-09-27 17:59:43 -07:00
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
typedef nsTArray<SurfaceDescriptor> BufferArray;
|
2010-07-21 14:17:33 -07:00
|
|
|
typedef std::vector<Edit> EditVector;
|
|
|
|
typedef std::set<ShadowableLayer*> ShadowableLayerSet;
|
|
|
|
|
|
|
|
class Transaction
|
|
|
|
{
|
|
|
|
public:
|
2012-05-01 12:23:39 -07:00
|
|
|
Transaction()
|
2013-02-25 21:18:20 -08:00
|
|
|
: mTargetRotation(ROTATION_0)
|
|
|
|
, mSwapRequired(false)
|
2012-05-18 01:29:38 -07:00
|
|
|
, mOpen(false)
|
2012-11-06 01:11:43 -08:00
|
|
|
, mRotationChanged(false)
|
2012-05-01 12:23:39 -07:00
|
|
|
{}
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-11-21 18:40:57 -08:00
|
|
|
void Begin(const nsIntRect& aTargetBounds, ScreenRotation aRotation,
|
|
|
|
const nsIntRect& aClientBounds, ScreenOrientation aOrientation)
|
2012-07-24 12:01:09 -07:00
|
|
|
{
|
|
|
|
mOpen = true;
|
|
|
|
mTargetBounds = aTargetBounds;
|
2012-11-06 01:11:43 -08:00
|
|
|
if (aRotation != mTargetRotation) {
|
2013-02-25 21:18:20 -08: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 01:11:43 -08:00
|
|
|
}
|
2012-07-24 12:01:09 -07:00
|
|
|
mTargetRotation = aRotation;
|
2012-11-21 18:40:57 -08:00
|
|
|
mClientBounds = aClientBounds;
|
|
|
|
mTargetOrientation = aOrientation;
|
2012-07-24 12:01:09 -07:00
|
|
|
}
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
void AddEdit(const CompositableOperation& aEdit)
|
|
|
|
{
|
|
|
|
AddEdit(Edit(aEdit));
|
|
|
|
}
|
2010-09-15 14:03:13 -07:00
|
|
|
void AddPaint(const Edit& aPaint)
|
2012-05-01 12:23:39 -07: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 02:20:52 -07:00
|
|
|
void AddPaint(const CompositableOperation& aPaint)
|
|
|
|
{
|
|
|
|
AddNoSwapPaint(Edit(aPaint));
|
|
|
|
mSwapRequired = true;
|
|
|
|
}
|
|
|
|
|
2012-05-01 12:23:39 -07:00
|
|
|
void AddNoSwapPaint(const Edit& aPaint)
|
2010-09-15 14:03:13 -07: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 02:20:52 -07:00
|
|
|
void AddNoSwapPaint(const CompositableOperation& aPaint)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mPaints.push_back(Edit(aPaint));
|
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
void AddMutant(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mMutants.insert(aLayer);
|
|
|
|
}
|
2010-09-13 22:23:08 -07:00
|
|
|
void AddBufferToDestroy(gfxSharedImageSurface* aBuffer)
|
2010-09-13 22:23:08 -07:00
|
|
|
{
|
|
|
|
return AddBufferToDestroy(aBuffer->GetShmem());
|
|
|
|
}
|
|
|
|
void AddBufferToDestroy(const SurfaceDescriptor& aBuffer)
|
2010-09-13 22:23:08 -07:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!Finished(), "forgot BeginTransaction?");
|
|
|
|
mDyingBuffers.AppendElement(aBuffer);
|
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
void End()
|
|
|
|
{
|
|
|
|
mCset.clear();
|
2010-09-15 14:03:13 -07:00
|
|
|
mPaints.clear();
|
2010-09-13 22:23:08 -07:00
|
|
|
mDyingBuffers.Clear();
|
2010-07-21 14:17:33 -07:00
|
|
|
mMutants.clear();
|
2011-10-17 07:59:28 -07:00
|
|
|
mOpen = false;
|
2012-05-01 12:23:39 -07:00
|
|
|
mSwapRequired = false;
|
2012-11-06 01:11:43 -08:00
|
|
|
mRotationChanged = false;
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool Empty() const {
|
2010-09-15 14:03:13 -07:00
|
|
|
return mCset.empty() && mPaints.empty() && mMutants.empty();
|
|
|
|
}
|
2012-11-06 01:11:43 -08:00
|
|
|
bool RotationChanged() const {
|
|
|
|
return mRotationChanged;
|
|
|
|
}
|
2011-09-28 23:19:26 -07:00
|
|
|
bool Finished() const { return !mOpen && Empty(); }
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
EditVector mCset;
|
2010-09-15 14:03:13 -07:00
|
|
|
EditVector mPaints;
|
2010-09-13 22:23:08 -07:00
|
|
|
BufferArray mDyingBuffers;
|
2010-07-21 14:17:33 -07:00
|
|
|
ShadowableLayerSet mMutants;
|
2012-07-24 12:01:09 -07:00
|
|
|
nsIntRect mTargetBounds;
|
|
|
|
ScreenRotation mTargetRotation;
|
2012-11-21 18:40:57 -08:00
|
|
|
nsIntRect mClientBounds;
|
|
|
|
ScreenOrientation mTargetOrientation;
|
2012-05-01 12:23:39 -07:00
|
|
|
bool mSwapRequired;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
private:
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mOpen;
|
2012-11-06 01:11:43 -08:00
|
|
|
bool mRotationChanged;
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
void
|
|
|
|
CompositableForwarder::IdentifyTextureHost(const TextureFactoryIdentifier& aIdentifier)
|
|
|
|
{
|
|
|
|
mMaxTextureSize = aIdentifier.mMaxTextureSize;
|
|
|
|
mCompositorBackend = aIdentifier.mParentBackend;
|
|
|
|
}
|
|
|
|
|
2010-12-30 23:40:19 -08:00
|
|
|
ShadowLayerForwarder::ShadowLayerForwarder()
|
|
|
|
: mShadowManager(NULL)
|
2012-03-12 08:50:15 -07:00
|
|
|
, mIsFirstPaint(false)
|
2010-07-21 14:17:33 -07:00
|
|
|
{
|
|
|
|
mTxn = new Transaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
ShadowLayerForwarder::~ShadowLayerForwarder()
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(mTxn->Finished(), "unfinished transaction?");
|
|
|
|
delete mTxn;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-07-24 12:01:09 -07:00
|
|
|
ShadowLayerForwarder::BeginTransaction(const nsIntRect& aTargetBounds,
|
2012-11-21 18:40:57 -08:00
|
|
|
ScreenRotation aRotation,
|
|
|
|
const nsIntRect& aClientBounds,
|
|
|
|
ScreenOrientation aOrientation)
|
2010-07-21 14:17:33 -07:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
|
|
|
NS_ABORT_IF_FALSE(mTxn->Finished(), "uncommitted txn?");
|
2012-11-21 18:40:57 -08:00
|
|
|
mTxn->Begin(aTargetBounds, aRotation, aClientBounds, aOrientation);
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static PLayerChild*
|
|
|
|
Shadow(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
return aLayer->GetShadow();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename OpCreateT>
|
|
|
|
static void
|
|
|
|
CreatedLayer(Transaction* aTxn, ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
aTxn->AddEdit(OpCreateT(NULL, Shadow(aLayer)));
|
|
|
|
}
|
|
|
|
|
|
|
|
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 16:59:45 -07:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedRefLayer(ShadowableLayer* aRef)
|
|
|
|
{
|
|
|
|
CreatedLayer<OpCreateRefLayer>(mTxn, aRef);
|
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2011-10-10 16:43:56 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::DestroyedThebesBuffer(const SurfaceDescriptor& aBackBufferToDestroy)
|
2011-10-10 16:43:56 -07:00
|
|
|
{
|
|
|
|
mTxn->AddBufferToDestroy(aBackBufferToDestroy);
|
|
|
|
}
|
|
|
|
|
2010-09-02 20:05:01 -07:00
|
|
|
void
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
mTxn->AddMutant(aMutant);
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::SetRoot(ShadowableLayer* aRoot)
|
|
|
|
{
|
|
|
|
mTxn->AddEdit(OpSetRoot(NULL, Shadow(aRoot)));
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::InsertAfter(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild,
|
|
|
|
ShadowableLayer* aAfter)
|
|
|
|
{
|
|
|
|
if (aAfter)
|
|
|
|
mTxn->AddEdit(OpInsertAfter(NULL, Shadow(aContainer),
|
|
|
|
NULL, Shadow(aChild),
|
|
|
|
NULL, Shadow(aAfter)));
|
|
|
|
else
|
|
|
|
mTxn->AddEdit(OpAppendChild(NULL, Shadow(aContainer),
|
|
|
|
NULL, Shadow(aChild)));
|
|
|
|
}
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RemoveChild(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild)
|
|
|
|
{
|
2013-03-21 19:17:28 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRemoveChild container=%p child=%p\n",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer()));
|
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
mTxn->AddEdit(OpRemoveChild(NULL, Shadow(aContainer),
|
|
|
|
NULL, Shadow(aChild)));
|
|
|
|
}
|
2012-08-29 03:52:55 -07:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::RepositionChild(ShadowableLayer* aContainer,
|
|
|
|
ShadowableLayer* aChild,
|
|
|
|
ShadowableLayer* aAfter)
|
|
|
|
{
|
2013-03-21 19:17:28 -07:00
|
|
|
if (aAfter) {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRepositionChild container=%p child=%p after=%p",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer(), aAfter->AsLayer()));
|
2012-08-29 03:52:55 -07:00
|
|
|
mTxn->AddEdit(OpRepositionChild(NULL, Shadow(aContainer),
|
|
|
|
NULL, Shadow(aChild),
|
|
|
|
NULL, Shadow(aAfter)));
|
2013-03-21 19:17:28 -07:00
|
|
|
} else {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpRaiseToTopChild container=%p child=%p",
|
|
|
|
aContainer->AsLayer(), aChild->AsLayer()));
|
2012-08-29 03:52:55 -07:00
|
|
|
mTxn->AddEdit(OpRaiseToTopChild(NULL, Shadow(aContainer),
|
|
|
|
NULL, Shadow(aChild)));
|
2013-03-21 19:17:28 -07:00
|
|
|
}
|
2012-08-29 03:52:55 -07:00
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-04-13 08:17:39 -07:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::PaintedTiledLayerBuffer(ShadowableLayer* aLayer,
|
|
|
|
BasicTiledLayerBuffer* aTiledLayerBuffer)
|
|
|
|
{
|
|
|
|
if (XRE_GetProcessType() != GeckoProcessType_Default)
|
|
|
|
NS_RUNTIMEABORT("PaintedTiledLayerBuffer must be made IPC safe (not share pointers)");
|
2012-05-01 12:23:39 -07:00
|
|
|
mTxn->AddNoSwapPaint(OpPaintTiledLayerBuffer(NULL, Shadow(aLayer),
|
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 02:20:52 -07:00
|
|
|
uintptr_t(aTiledLayerBuffer)));
|
2012-04-13 08:17:39 -07:00
|
|
|
}
|
|
|
|
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::UpdateTexture(TextureClient* aTexture,
|
|
|
|
const SurfaceDescriptor& aImage)
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
MOZ_ASSERT(aImage.type() != SurfaceDescriptor::T__None);
|
|
|
|
MOZ_ASSERT(aImage.type() != SurfaceDescriptor::Tnull_t);
|
|
|
|
MOZ_ASSERT(aTexture);
|
|
|
|
MOZ_ASSERT(aTexture->GetIPDLActor());
|
|
|
|
mTxn->AddPaint(OpPaintTexture(nullptr, aTexture->GetIPDLActor(), aImage));
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
|
|
|
|
const ThebesBufferData& aThebesBufferData,
|
|
|
|
const nsIntRegion& aUpdatedRegion)
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
|
|
|
mTxn->AddPaint(OpPaintTextureRegion(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
aThebesBufferData,
|
|
|
|
aUpdatedRegion));
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2013-03-22 12:22:20 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
|
|
|
|
const nsIntRect& aRect)
|
2013-03-22 12:22:20 -07: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 02:20:52 -07:00
|
|
|
mTxn->AddNoSwapPaint(OpUpdatePictureRect(nullptr, aCompositable->GetIPDLActor(), aRect));
|
2013-03-22 12:22:20 -07:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2010-11-08 18:49:00 -08:00
|
|
|
ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies)
|
2010-07-21 14:17:33 -07:00
|
|
|
{
|
2013-03-15 21:47:02 -07:00
|
|
|
PROFILER_LABEL("ShadowLayerForwarder", "EndTranscation");
|
2012-02-28 08:24:24 -08:00
|
|
|
RenderTraceScope rendertrace("Foward Transaction", "000091");
|
2010-07-21 14:17:33 -07:00
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
|
|
|
NS_ABORT_IF_FALSE(!mTxn->Finished(), "forgot BeginTransaction?");
|
|
|
|
|
|
|
|
AutoTxnEnd _(mTxn);
|
|
|
|
|
2012-11-06 01:11:43 -08:00
|
|
|
if (mTxn->Empty() && !mTxn->RotationChanged()) {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] 0-length cset (?) and no rotation event, skipping Update()"));
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] destroying buffers..."));
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
for (uint32_t i = 0; i < mTxn->mDyingBuffers.Length(); ++i) {
|
2010-09-13 22:23:08 -07:00
|
|
|
DestroySharedSurface(&mTxn->mDyingBuffers[i]);
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] building transaction..."));
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2010-09-15 14:03:13 -07: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 08:24:24 -08:00
|
|
|
RenderTraceScope rendertrace2("Foward Transaction", "000092");
|
2010-07-21 14:17:33 -07: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();
|
2012-08-03 14:29:22 -07:00
|
|
|
common.postXScale() = mutant->GetPostXScale();
|
|
|
|
common.postYScale() = mutant->GetPostYScale();
|
2012-07-30 19:20:00 -07:00
|
|
|
common.transform() = mutant->GetBaseTransform();
|
2010-09-02 02:18:40 -07:00
|
|
|
common.contentFlags() = mutant->GetContentFlags();
|
2010-07-21 14:17:33 -07:00
|
|
|
common.opacity() = mutant->GetOpacity();
|
|
|
|
common.useClipRect() = !!mutant->GetClipRect();
|
|
|
|
common.clipRect() = (common.useClipRect() ?
|
|
|
|
*mutant->GetClipRect() : nsIntRect());
|
2011-04-05 22:00:25 -07:00
|
|
|
common.isFixedPosition() = mutant->GetIsFixedPosition();
|
2012-06-27 08:43:57 -07:00
|
|
|
common.fixedPositionAnchor() = mutant->GetFixedPositionAnchor();
|
2012-03-18 16:02:38 -07:00
|
|
|
if (Layer* maskLayer = mutant->GetMaskLayer()) {
|
|
|
|
common.maskLayerChild() = Shadow(maskLayer->AsShadowableLayer());
|
|
|
|
} else {
|
|
|
|
common.maskLayerChild() = NULL;
|
|
|
|
}
|
|
|
|
common.maskLayerParent() = NULL;
|
2012-07-31 10:28:20 -07:00
|
|
|
common.animations() = mutant->GetAnimations();
|
2010-07-21 14:17:33 -07:00
|
|
|
attrs.specific() = null_t();
|
|
|
|
mutant->FillSpecificAttributes(attrs.specific());
|
|
|
|
|
2013-03-21 19:17:28 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] OpSetLayerAttributes(%p)\n", mutant));
|
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
mTxn->AddEdit(OpSetLayerAttributes(NULL, Shadow(shadow), attrs));
|
|
|
|
}
|
|
|
|
|
2010-11-08 18:49:00 -08:00
|
|
|
AutoInfallibleTArray<Edit, 10> cset;
|
2010-09-15 14:03:13 -07:00
|
|
|
size_t nCsets = mTxn->mCset.size() + mTxn->mPaints.size();
|
|
|
|
NS_ABORT_IF_FALSE(nCsets > 0, "should have bailed by now");
|
|
|
|
|
|
|
|
cset.SetCapacity(nCsets);
|
2010-09-20 12:40:30 -07:00
|
|
|
if (!mTxn->mCset.empty()) {
|
|
|
|
cset.AppendElements(&mTxn->mCset.front(), mTxn->mCset.size());
|
|
|
|
}
|
2010-09-15 14:03:13 -07:00
|
|
|
// Paints after non-paint ops, including attribute changes. See
|
|
|
|
// above.
|
2010-09-20 12:40:30 -07:00
|
|
|
if (!mTxn->mPaints.empty()) {
|
|
|
|
cset.AppendElements(&mTxn->mPaints.front(), mTxn->mPaints.size());
|
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-11-21 18:40:57 -08:00
|
|
|
TargetConfig targetConfig(mTxn->mTargetBounds, mTxn->mTargetRotation, mTxn->mClientBounds, mTxn->mTargetOrientation);
|
2012-07-24 12:01:09 -07:00
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] syncing before send..."));
|
|
|
|
PlatformSyncBeforeUpdate();
|
|
|
|
|
2012-05-01 12:23:39 -07:00
|
|
|
if (mTxn->mSwapRequired) {
|
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
|
|
|
|
RenderTraceScope rendertrace3("Forward Transaction", "000093");
|
2012-07-24 12:01:09 -07:00
|
|
|
if (!mShadowManager->SendUpdate(cset, targetConfig, mIsFirstPaint,
|
|
|
|
aReplies)) {
|
2012-05-01 12:23:39 -07: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");
|
2012-07-24 12:01:09 -07:00
|
|
|
if (!mShadowManager->SendUpdateNoSwap(cset, targetConfig, mIsFirstPaint)) {
|
2012-05-01 12:23:39 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2012-03-12 08:50:15 -07:00
|
|
|
mIsFirstPaint = false;
|
2010-07-21 14:17:33 -07:00
|
|
|
MOZ_LAYERS_LOG(("[LayersForwarder] ... done"));
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::AllocShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem)
|
2010-07-21 14:17:33 -07: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 02:20:52 -07:00
|
|
|
return mShadowManager->AllocShmem(aSize, aType, aShmem);
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
2011-09-28 23:19:26 -07: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 02:20:52 -07:00
|
|
|
ShadowLayerForwarder::AllocUnsafeShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem)
|
2012-07-12 05:51:57 -07: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 02:20:52 -07:00
|
|
|
return mShadowManager->AllocUnsafeShmem(aSize, aType, aShmem);
|
2012-07-12 05:51:57 -07: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 02:20:52 -07:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::DeallocShmem(ipc::Shmem& aShmem)
|
|
|
|
{
|
|
|
|
mShadowManager->DeallocShmem(aShmem);
|
2010-12-30 23:40:31 -08:00
|
|
|
}
|
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
/*static*/ already_AddRefed<gfxASurface>
|
2012-07-12 05:51:58 -07:00
|
|
|
ShadowLayerForwarder::OpenDescriptor(OpenMode aMode,
|
|
|
|
const SurfaceDescriptor& aSurface)
|
2010-09-13 22:23:08 -07:00
|
|
|
{
|
2012-07-12 05:51:58 -07:00
|
|
|
nsRefPtr<gfxASurface> surf = PlatformOpenDescriptor(aMode, aSurface);
|
2010-09-13 22:23:08 -07:00
|
|
|
if (surf) {
|
|
|
|
return surf.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (aSurface.type()) {
|
|
|
|
case SurfaceDescriptor::TShmem: {
|
2011-01-04 08:40:54 -08:00
|
|
|
surf = gfxSharedImageSurface::Open(aSurface.get_Shmem());
|
2010-09-13 22:23:08 -07:00
|
|
|
return surf.forget();
|
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 02:20:52 -07:00
|
|
|
} case SurfaceDescriptor::TRGBImage: {
|
|
|
|
const RGBImage& rgb = aSurface.get_RGBImage();
|
|
|
|
gfxASurface::gfxImageFormat rgbFormat
|
|
|
|
= static_cast<gfxASurface::gfxImageFormat>(rgb.rgbFormat());
|
|
|
|
uint32_t stride = gfxASurface::BytesPerPixel(rgbFormat) * rgb.picture().width;
|
|
|
|
nsIntSize size(rgb.picture().width, rgb.picture().height);
|
|
|
|
surf = new gfxImageSurface(rgb.data().get<uint8_t>(),
|
|
|
|
size,
|
|
|
|
stride,
|
|
|
|
rgbFormat);
|
|
|
|
return surf.forget();
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
default:
|
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 02:20:52 -07:00
|
|
|
NS_ERROR("unexpected SurfaceDescriptor type!");
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
/*static*/ gfxContentType
|
|
|
|
ShadowLayerForwarder::GetDescriptorSurfaceContentType(
|
|
|
|
const SurfaceDescriptor& aDescriptor, OpenMode aMode,
|
|
|
|
gfxASurface** aSurface)
|
|
|
|
{
|
|
|
|
gfxContentType content;
|
|
|
|
if (PlatformGetDescriptorSurfaceContentType(aDescriptor, aMode,
|
|
|
|
&content, aSurface)) {
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> surface = OpenDescriptor(aMode, aDescriptor);
|
|
|
|
content = surface->GetContentType();
|
|
|
|
*aSurface = surface.forget().get();
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ gfxIntSize
|
|
|
|
ShadowLayerForwarder::GetDescriptorSurfaceSize(
|
|
|
|
const SurfaceDescriptor& aDescriptor, OpenMode aMode,
|
|
|
|
gfxASurface** aSurface)
|
|
|
|
{
|
|
|
|
gfxIntSize size;
|
|
|
|
if (PlatformGetDescriptorSurfaceSize(aDescriptor, aMode, &size, aSurface)) {
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> surface = OpenDescriptor(aMode, aDescriptor);
|
|
|
|
size = surface->GetSize();
|
|
|
|
*aSurface = surface.forget().get();
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerForwarder::CloseDescriptor(const SurfaceDescriptor& aDescriptor)
|
|
|
|
{
|
|
|
|
PlatformCloseDescriptor(aDescriptor);
|
|
|
|
// There's no "close" needed for Shmem surfaces.
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
TemporaryRef<ImageClient>
|
|
|
|
ShadowLayerForwarder::CreateImageClientFor(const CompositableType& aCompositableType,
|
|
|
|
ShadowableLayer* aLayer,
|
|
|
|
TextureFlags aFlags)
|
2010-09-13 22:23:08 -07: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 02:20:52 -07:00
|
|
|
RefPtr<ImageClient> client = ImageClient::CreateImageClient(GetCompositorBackendType(),
|
|
|
|
aCompositableType,
|
|
|
|
this, aFlags);
|
|
|
|
if (aCompositableType == BUFFER_BRIDGE) {
|
|
|
|
static_cast<ImageClientBridge*>(client.get())->SetLayer(aLayer);
|
2010-09-13 22:23:08 -07: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 02:20:52 -07:00
|
|
|
return client.forget();
|
2010-09-13 22:23:08 -07: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 02:20:52 -07:00
|
|
|
TemporaryRef<CanvasClient>
|
|
|
|
ShadowLayerForwarder::CreateCanvasClientFor(const CompositableType& aCompositableType,
|
|
|
|
ShadowableLayer* aLayer,
|
|
|
|
TextureFlags aFlags)
|
2010-09-13 22:23:08 -07: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 02:20:52 -07:00
|
|
|
RefPtr<CanvasClient> client = CanvasClient::CreateCanvasClient(GetCompositorBackendType(),
|
|
|
|
aCompositableType,
|
|
|
|
this, aFlags);
|
|
|
|
return client.forget();
|
2010-09-13 22:23:08 -07: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 02:20:52 -07:00
|
|
|
TemporaryRef<ContentClient>
|
|
|
|
ShadowLayerForwarder::CreateContentClientFor(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
RefPtr<ContentClient> client = ContentClient::CreateContentClient(GetCompositorBackendType(),
|
|
|
|
this);
|
|
|
|
return client.forget();
|
|
|
|
}
|
2010-09-13 22:23:08 -07:00
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
PLayerChild*
|
|
|
|
ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
|
|
|
return mShadowManager->SendPLayerConstructor(new ShadowLayerChild(aLayer));
|
|
|
|
}
|
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
#if !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
|
|
|
|
|
|
|
/*static*/ already_AddRefed<gfxASurface>
|
2012-07-12 05:51:58 -07:00
|
|
|
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode,
|
|
|
|
const SurfaceDescriptor&)
|
2010-09-13 22:23:08 -07:00
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformCloseDescriptor(const SurfaceDescriptor&)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformGetDescriptorSurfaceContentType(
|
|
|
|
const SurfaceDescriptor&,
|
|
|
|
OpenMode,
|
|
|
|
gfxContentType*,
|
|
|
|
gfxASurface**)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformGetDescriptorSurfaceSize(
|
|
|
|
const SurfaceDescriptor&,
|
|
|
|
OpenMode,
|
|
|
|
gfxIntSize*,
|
|
|
|
gfxASurface**)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2010-09-13 22:23:08 -07:00
|
|
|
ShadowLayerForwarder::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|
|
|
{
|
2011-10-17 07:59:28 -07:00
|
|
|
return false;
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07: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 02:20:52 -07:00
|
|
|
ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
2010-09-13 22:23:08 -07:00
|
|
|
{
|
2011-10-17 07:59:28 -07:00
|
|
|
return false;
|
2010-09-13 22:23:08 -07:00
|
|
|
}
|
|
|
|
|
2012-07-23 16:58:37 -07:00
|
|
|
/*static*/ already_AddRefed<TextureImage>
|
|
|
|
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
|
|
|
const SurfaceDescriptor&,
|
|
|
|
GLenum)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2012-07-23 16:58:37 -07: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 02:20:52 -07:00
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerManager::SupportsDirectTexturing()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-09-13 22:23:08 -07:00
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
AutoOpenSurface::AutoOpenSurface(OpenMode aMode,
|
|
|
|
const SurfaceDescriptor& aDescriptor)
|
|
|
|
: mDescriptor(aDescriptor)
|
|
|
|
, mMode(aMode)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(IsSurfaceDescriptorValid(mDescriptor));
|
|
|
|
}
|
|
|
|
|
|
|
|
AutoOpenSurface::~AutoOpenSurface()
|
|
|
|
{
|
|
|
|
if (mSurface) {
|
2012-07-30 07:20:58 -07:00
|
|
|
mSurface = nullptr;
|
2012-07-12 05:51:58 -07:00
|
|
|
ShadowLayerForwarder::CloseDescriptor(mDescriptor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxContentType
|
|
|
|
AutoOpenSurface::ContentType()
|
|
|
|
{
|
|
|
|
if (mSurface) {
|
|
|
|
return mSurface->GetContentType();
|
|
|
|
}
|
|
|
|
return ShadowLayerForwarder::GetDescriptorSurfaceContentType(
|
|
|
|
mDescriptor, mMode, getter_AddRefs(mSurface));
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxIntSize
|
|
|
|
AutoOpenSurface::Size()
|
|
|
|
{
|
|
|
|
if (mSurface) {
|
|
|
|
return mSurface->GetSize();
|
|
|
|
}
|
|
|
|
return ShadowLayerForwarder::GetDescriptorSurfaceSize(
|
|
|
|
mDescriptor, mMode, getter_AddRefs(mSurface));
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxASurface*
|
|
|
|
AutoOpenSurface::Get()
|
|
|
|
{
|
|
|
|
if (!mSurface) {
|
|
|
|
mSurface = ShadowLayerForwarder::OpenDescriptor(mMode, mDescriptor);
|
|
|
|
}
|
|
|
|
return mSurface.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxImageSurface*
|
|
|
|
AutoOpenSurface::GetAsImage()
|
|
|
|
{
|
|
|
|
if (!mSurfaceAsImage) {
|
|
|
|
mSurfaceAsImage = Get()->GetAsImageSurface();
|
|
|
|
}
|
|
|
|
return mSurfaceAsImage.get();
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
void
|
|
|
|
ShadowLayerForwarder::Connect(CompositableClient* aCompositable)
|
|
|
|
{
|
|
|
|
#ifdef GFX_COMPOSITOR_LOGGING
|
|
|
|
printf("ShadowLayerForwarder::Connect(Compositable)\n");
|
|
|
|
#endif
|
|
|
|
MOZ_ASSERT(aCompositable);
|
|
|
|
CompositableChild* child = static_cast<CompositableChild*>(
|
|
|
|
mShadowManager->SendPCompositableConstructor(aCompositable->GetType()));
|
|
|
|
MOZ_ASSERT(child);
|
|
|
|
aCompositable->SetIPDLActor(child);
|
|
|
|
child->SetClient(aCompositable);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedSingleBuffer(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aBuffer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aBuffer->LockSurfaceDescriptor()->type() != SurfaceDescriptor::T__None &&
|
|
|
|
aBuffer->LockSurfaceDescriptor()->type() != SurfaceDescriptor::Tnull_t);
|
|
|
|
mTxn->AddEdit(OpCreatedSingleBuffer(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
nullptr, aBuffer->GetIPDLActor(),
|
|
|
|
*aBuffer->LockSurfaceDescriptor()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::CreatedDoubleBuffer(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aFront,
|
|
|
|
TextureClient* aBack)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aFront->LockSurfaceDescriptor()->type() != SurfaceDescriptor::T__None &&
|
|
|
|
aBack->LockSurfaceDescriptor()->type() != SurfaceDescriptor::T__None &&
|
|
|
|
aFront->LockSurfaceDescriptor()->type() != SurfaceDescriptor::Tnull_t &&
|
|
|
|
aBack->LockSurfaceDescriptor()->type() != SurfaceDescriptor::Tnull_t);
|
|
|
|
mTxn->AddEdit(OpCreatedDoubleBuffer(nullptr, aCompositable->GetIPDLActor(),
|
|
|
|
nullptr, aFront->GetIPDLActor(),
|
|
|
|
*aFront->LockSurfaceDescriptor(),
|
|
|
|
nullptr, aBack->GetIPDLActor(),
|
|
|
|
*aBack->LockSurfaceDescriptor()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowLayerForwarder::DestroyThebesBuffer(CompositableClient* aCompositable)
|
|
|
|
{
|
|
|
|
mTxn->AddEdit(OpDestroyThebesBuffer(nullptr, aCompositable->GetIPDLActor()));
|
|
|
|
}
|
|
|
|
|
|
|
|
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 05:51:58 -07:00
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|