Backed out changeset 4b7de1f2b4a0 (bug 856079) for various test failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2013-04-24 11:28:05 -04:00
parent 1912da4247
commit 39bd320f11
43 changed files with 570 additions and 433 deletions

View File

@ -26,7 +26,7 @@
*
* # Main interfaces and abstractions
*
* - Layer, ShadowableLayer and LayerComposite
* - Layer, ShadowableLayer and ShadowLayer
* (see Layers.h and ipc/ShadowLayers.h)
* - CompositableClient and CompositableHost
* (client/CompositableClient.h composite/CompositableHost.h)

View File

@ -136,15 +136,6 @@ struct TextureInfo
}
};
/**
* How a SurfaceDescriptor will be opened.
*
* See ShadowLayerForwarder::OpenDescriptor for example.
*/
enum OpenMode {
OPEN_READ_ONLY,
OPEN_READ_WRITE
};
} // namespace layers
} // namespace mozilla

View File

@ -8,7 +8,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/layers/PLayerTransaction.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/Telemetry.h"
#include "ImageLayers.h"
@ -460,7 +460,7 @@ Layer::CanUseOpaqueSurface()
const nsIntRect*
Layer::GetEffectiveClipRect()
{
if (LayerComposite* shadow = AsLayerComposite()) {
if (ShadowLayer* shadow = AsShadowLayer()) {
return shadow->GetShadowClipRect();
}
return GetClipRect();
@ -469,7 +469,7 @@ Layer::GetEffectiveClipRect()
const nsIntRegion&
Layer::GetEffectiveVisibleRegion()
{
if (LayerComposite* shadow = AsLayerComposite()) {
if (ShadowLayer* shadow = AsShadowLayer()) {
return shadow->GetShadowVisibleRegion();
}
return GetVisibleRegion();
@ -640,7 +640,7 @@ const gfx3DMatrix
Layer::GetLocalTransform()
{
gfx3DMatrix transform;
if (LayerComposite* shadow = AsLayerComposite())
if (ShadowLayer* shadow = AsShadowLayer())
transform = shadow->GetShadowTransform();
else
transform = mTransform;
@ -665,7 +665,7 @@ Layer::ApplyPendingUpdatesForThisTransaction()
const float
Layer::GetLocalOpacity()
{
if (LayerComposite* shadow = AsLayerComposite())
if (ShadowLayer* shadow = AsShadowLayer())
return shadow->GetShadowOpacity();
return mOpacity;
}
@ -975,7 +975,7 @@ LayerManager::BeginTabSwitch()
#ifdef MOZ_LAYERS_HAVE_LOG
static nsACString& PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite);
static nsACString& PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer);
#ifdef MOZ_DUMP_PAINTING
template <typename T>
@ -1101,7 +1101,7 @@ Layer::PrintInfo(nsACString& aTo, const char* aPrefix)
aTo += aPrefix;
aTo += nsPrintfCString("%s%s (0x%p)", mManager->Name(), Name(), this);
::PrintInfo(aTo, AsLayerComposite());
::PrintInfo(aTo, AsShadowLayer());
if (mUseClipRect) {
AppendToString(aTo, mClipRect, " [clip=", "]");
@ -1312,19 +1312,19 @@ LayerManager::IsLogEnabled()
}
static nsACString&
PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite)
PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
{
if (!aLayerComposite) {
if (!aShadowLayer) {
return aTo;
}
if (const nsIntRect* clipRect = aLayerComposite->GetShadowClipRect()) {
if (const nsIntRect* clipRect = aShadowLayer->GetShadowClipRect()) {
AppendToString(aTo, *clipRect, " [shadow-clip=", "]");
}
if (!aLayerComposite->GetShadowTransform().IsIdentity()) {
AppendToString(aTo, aLayerComposite->GetShadowTransform(), " [shadow-transform=", "]");
if (!aShadowLayer->GetShadowTransform().IsIdentity()) {
AppendToString(aTo, aShadowLayer->GetShadowTransform(), " [shadow-transform=", "]");
}
if (!aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
AppendToString(aTo, aLayerComposite->GetShadowVisibleRegion(), " [shadow-visible=", "]");
if (!aShadowLayer->GetShadowVisibleRegion().IsEmpty()) {
AppendToString(aTo, aShadowLayer->GetShadowVisibleRegion(), " [shadow-visible=", "]");
}
return aTo;
}

View File

@ -60,10 +60,10 @@ class CanvasLayer;
class ReadbackLayer;
class ReadbackProcessor;
class RefLayer;
class LayerComposite;
class ShadowLayer;
class ShadowableLayer;
class ShadowLayerForwarder;
class LayerManagerComposite;
class ShadowLayerManager;
class SpecificLayerAttributes;
class SurfaceDescriptor;
class Compositor;
@ -168,7 +168,7 @@ public:
virtual ShadowLayerForwarder* AsShadowForwarder()
{ return nullptr; }
virtual LayerManagerComposite* AsLayerManagerComposite()
virtual ShadowLayerManager* AsShadowManager()
{ return nullptr; }
/**
@ -1015,10 +1015,10 @@ public:
virtual ColorLayer* AsColorLayer() { return nullptr; }
/**
* Dynamic cast to a LayerComposite. Return null if this is not a
* LayerComposite. Can be used anytime.
* Dynamic cast to a ShadowLayer. Return null if this is not a
* ShadowLayer. Can be used anytime.
*/
virtual LayerComposite* AsLayerComposite() { return nullptr; }
virtual ShadowLayer* AsShadowLayer() { return nullptr; }
/**
* Dynamic cast to a ShadowableLayer. Return null if this is not a
@ -1026,6 +1026,12 @@ public:
*/
virtual ShadowableLayer* AsShadowableLayer() { return nullptr; }
/**
* Dynamic cast to a LayerComposite. Return null if this is not a
* ShadowableLayer. Can be used anytime.
*/
virtual LayerComposite* AsLayerComposite() { return nullptr; }
// These getters can be used anytime. They return the effective
// values that should be used when drawing this layer to screen,
// accounting for this layer possibly being a shadow.

View File

@ -35,7 +35,7 @@ void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx3DMatrix aRoo
trans.TransformBounds(rect);
if (strcmp(aLayer->Name(), "ContainerLayer") != 0 &&
strcmp(aLayer->Name(), "ContainerLayerComposite") != 0) {
strcmp(aLayer->Name(), "ShadowContainerLayer") != 0) {
printf_stderr("%s RENDERTRACE %u rect #%02X%s %i %i %i %i\n",
aLayer->Name(), (int)PR_IntervalNow(),
colorId, aColor,

View File

@ -1251,7 +1251,7 @@ BasicShadowLayerManager::ForwardTransaction()
RenderTraceScope rendertrace("Foward Transaction", "000090");
mPhase = PHASE_FORWARD;
// forward this transaction's changeset to our LayerManagerComposite
// forward this transaction's changeset to our ShadowLayerManager
AutoInfallibleTArray<EditReply, 10> replies;
if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies)) {
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {

View File

@ -21,11 +21,11 @@ namespace mozilla {
namespace layers {
class BasicShadowableLayer;
class ThebesLayerComposite;
class ContainerLayerComposite;
class ImageLayerComposite;
class CanvasLayerComposite;
class ColorLayerComposite;
class ShadowThebesLayer;
class ShadowContainerLayer;
class ShadowImageLayer;
class ShadowCanvasLayer;
class ShadowColorLayer;
class ReadbackProcessor;
class ImageFactory;
class PaintLayerContext;

View File

@ -349,7 +349,7 @@ protected:
virtual already_AddRefed<gfxASurface>
CreateBuffer(ContentType, const nsIntRect&, uint32_t, gfxASurface**)
{
NS_RUNTIMEABORT("ThebesLayerComposite can't paint content");
NS_RUNTIMEABORT("ShadowThebesLayer can't paint content");
return nullptr;
}
};

View File

@ -43,7 +43,7 @@ class CompositableChild;
*
* To do in-transaction texture transfer (the default), call
* ShadowLayerForwarder::Attach(CompositableClient*, ShadowableLayer*). This
* will let the LayerComposite on the compositor side know which CompositableHost
* will let the ShadowLayer on the compositor side know which CompositableHost
* to use for compositing.
*
* To do async texture transfer (like async-video), the CompositableClient

View File

@ -9,7 +9,6 @@
#include "nsIWidget.h"
#include "gfxUtils.h"
#include "gfxPlatform.h"
#include "mozilla/layers/LayerManagerComposite.h"
namespace mozilla {
@ -23,7 +22,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) {
return nullptr;
}
if (LayerManagerComposite::SupportsDirectTexturing() ||
if (ShadowLayerManager::SupportsDirectTexturing() ||
PR_GetEnv("MOZ_FORCE_DOUBLE_BUFFERING")) {
return new ContentClientDoubleBuffered(aForwarder);
}

View File

@ -21,9 +21,11 @@ class GLContext;
namespace layers {
class PTextureChild;
class ContentClient;
class PlanarYCbCrImage;
class Image;
class PTextureChild;
class CompositableForwarder;
/**

View File

@ -17,7 +17,7 @@ using namespace mozilla;
using namespace mozilla::layers;
CanvasLayerComposite::CanvasLayerComposite(LayerManagerComposite* aManager)
: CanvasLayer(aManager, nullptr)
: ShadowCanvasLayer(aManager, nullptr)
, LayerComposite(aManager)
, mImageHost(nullptr)
{

View File

@ -7,7 +7,7 @@
#define GFX_CanvasLayerComposite_H
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "gfxASurface.h"
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
#include "mozilla/X11Util.h"
@ -20,12 +20,14 @@ namespace layers {
// canvas is identical to compositing an image.
class ImageHost;
class CanvasLayerComposite : public CanvasLayer,
// NB: eventually we'll have separate shadow canvas2d and shadow
// canvas3d layers, but currently they look the same from the
// perspective of the compositor process
class CanvasLayerComposite : public ShadowCanvasLayer,
public LayerComposite
{
public:
CanvasLayerComposite(LayerManagerComposite* aManager);
virtual ~CanvasLayerComposite();
// CanvasLayer impl
@ -36,6 +38,14 @@ public:
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
// ShadowCanvasLayer impl
virtual void Swap(const SurfaceDescriptor& aNewFront,
bool needYFlip,
SurfaceDescriptor* aNewBack) MOZ_OVERRIDE
{
NS_ERROR("Should never be called");
}
virtual void SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
virtual void Disconnect() MOZ_OVERRIDE
@ -43,6 +53,7 @@ public:
Destroy();
}
// LayerComposite impl
virtual Layer* GetLayer() MOZ_OVERRIDE;
virtual void RenderLayer(const nsIntPoint& aOffset,
const nsIntRect& aClipRect) MOZ_OVERRIDE;
@ -53,8 +64,6 @@ public:
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
void SetBounds(nsIntRect aBounds) { mBounds = aBounds; }
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const MOZ_OVERRIDE { return "CanvasLayerComposite"; }

View File

@ -9,18 +9,18 @@
#include "mozilla/layers/PLayerTransaction.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
namespace mozilla {
namespace layers {
class ColorLayerComposite : public ColorLayer,
class ColorLayerComposite : public ShadowColorLayer,
public LayerComposite
{
public:
ColorLayerComposite(LayerManagerComposite *aManager)
: ColorLayer(aManager, nullptr)
: ShadowColorLayer(aManager, nullptr)
, LayerComposite(aManager)
{
MOZ_COUNT_CTOR(ColorLayerComposite);

View File

@ -152,7 +152,7 @@ ContainerRender(ContainerT* aContainer,
}
ContainerLayerComposite::ContainerLayerComposite(LayerManagerComposite *aManager)
: ContainerLayer(aManager, nullptr)
: ShadowContainerLayer(aManager, nullptr)
, LayerComposite(aManager)
{
MOZ_COUNT_CTOR(ContainerLayerComposite);
@ -329,7 +329,7 @@ ContainerLayerComposite::CleanupResources()
}
RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
: RefLayer(aManager, nullptr)
: ShadowRefLayer(aManager, nullptr)
, LayerComposite(aManager)
{
mImplData = static_cast<LayerComposite*>(this);

View File

@ -10,7 +10,7 @@
#include "mozilla/layers/ShadowLayers.h"
#include "Layers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "mozilla/layers/Effects.h"
#include "gfxUtils.h"
@ -19,7 +19,7 @@
namespace mozilla {
namespace layers {
class ContainerLayerComposite : public ContainerLayer,
class ContainerLayerComposite : public ShadowContainerLayer,
public LayerComposite
{
template<class ContainerT>
@ -29,7 +29,6 @@ class ContainerLayerComposite : public ContainerLayer,
const nsIntRect& aClipRect);
public:
ContainerLayerComposite(LayerManagerComposite *aManager);
~ContainerLayerComposite();
void InsertAfter(Layer* aChild, Layer* aAfter);
@ -65,7 +64,7 @@ public:
#endif
};
class RefLayerComposite : public RefLayer,
class RefLayerComposite : public ShadowRefLayer,
public LayerComposite
{
template<class ContainerT>

View File

@ -7,7 +7,7 @@
#define MOZILLA_GFX_IMAGEHOST_H
#include "CompositableHost.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
namespace mozilla {
namespace layers {

View File

@ -22,7 +22,7 @@ namespace mozilla {
namespace layers {
ImageLayerComposite::ImageLayerComposite(LayerManagerComposite* aManager)
: ImageLayer(aManager, nullptr)
: ShadowImageLayer(aManager, nullptr)
, LayerComposite(aManager)
, mImageHost(nullptr)
{

View File

@ -9,7 +9,7 @@
#include "mozilla/layers/PLayerTransaction.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "ImageLayers.h"
#include "mozilla/Mutex.h"
@ -18,18 +18,24 @@ namespace layers {
class ImageHost;
class ImageLayerComposite : public ImageLayer,
class ImageLayerComposite : public ShadowImageLayer,
public LayerComposite
{
typedef gl::TextureImage TextureImage;
public:
ImageLayerComposite(LayerManagerComposite* aManager);
virtual ~ImageLayerComposite();
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
// ShadowImageLayer impl
virtual void Swap(const SurfaceDescriptor& aFront,
SurfaceDescriptor* aNewBack)
{
NS_ERROR("Not implemented");
}
virtual void Disconnect() MOZ_OVERRIDE;
virtual void SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;

View File

@ -9,7 +9,7 @@
// typedefs conflicts.
#include "mozilla/Util.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "ThebesLayerComposite.h"
#include "ContainerLayerComposite.h"
#include "ImageLayerComposite.h"
@ -21,7 +21,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/layers/ImageHost.h"
#include "mozilla/layers/ContentHost.h"
#include "mozilla/layers/Compositor.h"
#include "gfxContext.h"
#include "gfxUtils.h"
@ -48,7 +47,6 @@ namespace mozilla {
namespace layers {
using namespace mozilla::gfx;
using namespace mozilla::gl;
static LayerComposite*
ToLayerComposite(Layer* aLayer)
@ -80,20 +78,16 @@ LayerManagerComposite::ClearCachedResources(Layer* aSubtree)
// Do we need that?
}
/**
* LayerManagerComposite
*/
LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
: mCompositor(aCompositor)
{
mCompositor = aCompositor;
}
LayerManagerComposite::~LayerManagerComposite()
{
Destroy();
}
bool
LayerManagerComposite::Initialize()
{
@ -549,38 +543,38 @@ LayerManagerComposite::ComputeRenderIntegrity()
return 1.f;
}
already_AddRefed<ThebesLayerComposite>
LayerManagerComposite::CreateThebesLayerComposite()
already_AddRefed<ShadowThebesLayer>
LayerManagerComposite::CreateShadowThebesLayer()
{
if (mDestroyed) {
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
return nullptr;
}
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
}
already_AddRefed<ContainerLayerComposite>
LayerManagerComposite::CreateContainerLayerComposite()
already_AddRefed<ShadowContainerLayer>
LayerManagerComposite::CreateShadowContainerLayer()
{
if (mDestroyed) {
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
return nullptr;
}
return nsRefPtr<ContainerLayerComposite>(new ContainerLayerComposite(this)).forget();
}
already_AddRefed<ImageLayerComposite>
LayerManagerComposite::CreateImageLayerComposite()
already_AddRefed<ShadowImageLayer>
LayerManagerComposite::CreateShadowImageLayer()
{
if (mDestroyed) {
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
return nullptr;
}
return nsRefPtr<ImageLayerComposite>(new ImageLayerComposite(this)).forget();
}
already_AddRefed<ColorLayerComposite>
LayerManagerComposite::CreateColorLayerComposite()
already_AddRefed<ShadowColorLayer>
LayerManagerComposite::CreateShadowColorLayer()
{
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
@ -589,8 +583,8 @@ LayerManagerComposite::CreateColorLayerComposite()
return nsRefPtr<ColorLayerComposite>(new ColorLayerComposite(this)).forget();
}
already_AddRefed<CanvasLayerComposite>
LayerManagerComposite::CreateCanvasLayerComposite()
already_AddRefed<ShadowCanvasLayer>
LayerManagerComposite::CreateShadowCanvasLayer()
{
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
@ -599,8 +593,8 @@ LayerManagerComposite::CreateCanvasLayerComposite()
return nsRefPtr<CanvasLayerComposite>(new CanvasLayerComposite(this)).forget();
}
already_AddRefed<RefLayerComposite>
LayerManagerComposite::CreateRefLayerComposite()
already_AddRefed<ShadowRefLayer>
LayerManagerComposite::CreateShadowRefLayer()
{
if (LayerManagerComposite::mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
@ -646,18 +640,6 @@ LayerManagerComposite::CreateDrawTarget(const IntSize &aSize,
return LayerManager::CreateDrawTarget(aSize, aFormat);
}
LayerComposite::LayerComposite(LayerManagerComposite *aManager)
: mCompositeManager(aManager)
, mCompositor(aManager->GetCompositor())
, mShadowOpacity(1.0)
, mUseShadowClipRect(false)
, mDestroyed(false)
{ }
LayerComposite::~LayerComposite()
{
}
void
LayerComposite::Destroy()
{
@ -667,65 +649,5 @@ LayerComposite::Destroy()
}
}
const nsIntSize&
LayerManagerComposite::GetWidgetSize()
{
return mCompositor->GetWidgetSize();
}
void
LayerManagerComposite::SetCompositorID(uint32_t aID)
{
NS_ASSERTION(mCompositor, "No compositor");
mCompositor->SetCompositorID(aID);
}
void
LayerManagerComposite::NotifyShadowTreeTransaction()
{
mCompositor->NotifyLayersTransaction();
}
bool
LayerManagerComposite::CanUseCanvasLayerForSize(const gfxIntSize &aSize)
{
return mCompositor->CanUseCanvasLayerForSize(aSize);
}
TextureFactoryIdentifier
LayerManagerComposite::GetTextureFactoryIdentifier()
{
return mCompositor->GetTextureFactoryIdentifier();
}
int32_t
LayerManagerComposite::GetMaxTextureSize() const
{
return mCompositor->GetMaxTextureSize();
}
#ifndef MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS
/*static*/ already_AddRefed<TextureImage>
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
{
return nullptr;
}
/*static*/ bool
LayerManagerComposite::SupportsDirectTexturing()
{
return false;
}
/*static*/ void
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
{
}
#endif // !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
} /* layers */
} /* mozilla */

View File

@ -10,7 +10,6 @@
#include "mozilla/layers/ShadowLayers.h"
#include "Composer2D.h"
#include "mozilla/TimeStamp.h"
#include "Layers.h"
#ifdef XP_WIN
#include <windows.h>
@ -31,23 +30,43 @@ namespace mozilla {
namespace layers {
class LayerComposite;
class ThebesLayerComposite;
class ContainerLayerComposite;
class ImageLayerComposite;
class CanvasLayerComposite;
class ColorLayerComposite;
class RefLayerComposite;
class ShadowThebesLayer;
class ShadowContainerLayer;
class ShadowImageLayer;
class ShadowCanvasLayer;
class ShadowColorLayer;
class CompositableHost;
class EffectChain;
class TiledLayerComposer;
class THEBES_API LayerManagerComposite : public LayerManager
/**
* Composite layers are for use with OMTC on the compositor thread only. There
* must be corresponding Basic layers on the content thread. For composite
* layers, the layer manager only maintains the layer tree, all rendering is
* done by a Compositor (see Compositor.h). As such, composite layers are
* platform-independent and can be used on any platform for which there is a
* Compositor implementation.
*
* The composite layer tree reflects exactly the basic layer tree. To
* composite to screen, the layer manager walks the layer tree calling render
* methods which in turn call into their CompositableHosts' Composite methods.
* These call Compositor::DrawQuad to do the rendering.
*
* Mostly, layers are updated during the layers transaction. This is done from
* CompositableClient to CompositableHost without interacting with the layer.
*
* mCompositor is stored in ShadowLayerManager.
*
* Post-landing TODO: merge LayerComposite with ShadowLayer
*/
class THEBES_API LayerManagerComposite : public ShadowLayerManager
{
public:
LayerManagerComposite(Compositor* aCompositor);
~LayerManagerComposite();
virtual void Destroy() MOZ_OVERRIDE;
virtual ~LayerManagerComposite()
{
Destroy();
}
virtual void Destroy();
/**
* return True if initialization was succesful, false when it was not.
@ -71,7 +90,7 @@ public:
/**
* LayerManager implementation.
*/
virtual LayerManagerComposite* AsLayerManagerComposite() MOZ_OVERRIDE
virtual ShadowLayerManager* AsShadowManager() MOZ_OVERRIDE
{
return this;
}
@ -81,7 +100,10 @@ public:
void BeginTransaction() MOZ_OVERRIDE;
void BeginTransactionWithTarget(gfxContext* aTarget) MOZ_OVERRIDE;
void NotifyShadowTreeTransaction();
virtual void NotifyShadowTreeTransaction() MOZ_OVERRIDE
{
mCompositor->NotifyLayersTransaction();
}
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
@ -90,11 +112,20 @@ public:
virtual void SetRoot(Layer* aLayer) MOZ_OVERRIDE { mRoot = aLayer; }
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE;
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE
{
return mCompositor->CanUseCanvasLayerForSize(aSize);
}
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE;
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE
{
return mCompositor->GetTextureFactoryIdentifier();
}
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE;
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE
{
return mCompositor->GetMaxTextureSize();
}
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
@ -103,12 +134,12 @@ public:
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
already_AddRefed<ThebesLayerComposite> CreateThebesLayerComposite();
already_AddRefed<ContainerLayerComposite> CreateContainerLayerComposite();
already_AddRefed<ImageLayerComposite> CreateImageLayerComposite();
already_AddRefed<ColorLayerComposite> CreateColorLayerComposite();
already_AddRefed<CanvasLayerComposite> CreateCanvasLayerComposite();
already_AddRefed<RefLayerComposite> CreateRefLayerComposite();
virtual already_AddRefed<ShadowThebesLayer> CreateShadowThebesLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ShadowContainerLayer> CreateShadowContainerLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer() MOZ_OVERRIDE;
virtual already_AddRefed<ShadowRefLayer> CreateShadowRefLayer() MOZ_OVERRIDE;
virtual LayersBackend GetBackendType() MOZ_OVERRIDE
{
@ -173,7 +204,10 @@ public:
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat) MOZ_OVERRIDE;
const nsIntSize& GetWidgetSize();
const nsIntSize& GetWidgetSize()
{
return mCompositor->GetWidgetSize();
}
/**
* Calculates the 'completeness' of the rendering that intersected with the
@ -184,34 +218,6 @@ public:
*/
float ComputeRenderIntegrity();
/**
* Try to open |aDescriptor| for direct texturing. If the
* underlying surface supports direct texturing, a non-null
* TextureImage is returned. Otherwise null is returned.
*/
static already_AddRefed<gl::TextureImage>
OpenDescriptorForDirectTexturing(gl::GLContext* aContext,
const SurfaceDescriptor& aDescriptor,
GLenum aWrapMode);
/**
* returns true if PlatformAllocBuffer will return a buffer that supports
* direct texturing
*/
static bool SupportsDirectTexturing();
static void PlatformSyncBeforeReplyUpdate();
void SetCompositorID(uint32_t aID);
Compositor* GetCompositor() const
{
return mCompositor;
}
bool PlatformDestroySharedSurface(SurfaceDescriptor* aSurface);
RefPtr<Compositor> mCompositor;
private:
/** Region we're clipping our current drawing to. */
nsIntRegion mClippingRegion;
@ -249,32 +255,24 @@ private:
bool mInTransaction;
};
/**
* Composite layers are for use with OMTC on the compositor thread only. There
* must be corresponding Basic layers on the content thread. For composite
* layers, the layer manager only maintains the layer tree, all rendering is
* done by a Compositor (see Compositor.h). As such, composite layers are
* platform-independent and can be used on any platform for which there is a
* Compositor implementation.
*
* The composite layer tree reflects exactly the basic layer tree. To
* composite to screen, the layer manager walks the layer tree calling render
* methods which in turn call into their CompositableHosts' Composite methods.
* These call Compositor::DrawQuad to do the rendering.
*
* Mostly, layers are updated during the layers transaction. This is done from
* CompositableClient to CompositableHost without interacting with the layer.
*
* A reference to the Compositor is stored in LayerManagerComposite.
* General information and tree management for layers.
*/
class LayerComposite
{
public:
LayerComposite(LayerManagerComposite* aManager);
LayerComposite(LayerManagerComposite *aManager)
: mCompositeManager(aManager)
, mCompositor(aManager->GetCompositor())
, mDestroyed(false)
{ }
virtual ~LayerComposite();
virtual ~LayerComposite() {}
virtual LayerComposite* GetFirstChildComposite()
virtual LayerComposite *GetFirstChildComposite()
{
return nullptr;
}
@ -299,53 +297,9 @@ public:
virtual TiledLayerComposer* GetTiledLayerComposer() { return nullptr; }
virtual void DestroyFrontBuffer() { }
/**
* The following methods are
*
* CONSTRUCTION PHASE ONLY
*
* They are analogous to the Layer interface.
*/
void SetShadowVisibleRegion(const nsIntRegion& aRegion)
{
mShadowVisibleRegion = aRegion;
}
void SetShadowOpacity(float aOpacity)
{
mShadowOpacity = aOpacity;
}
void SetShadowClipRect(const nsIntRect* aRect)
{
mUseShadowClipRect = aRect != nullptr;
if (aRect) {
mShadowClipRect = *aRect;
}
}
void SetShadowTransform(const gfx3DMatrix& aMatrix)
{
mShadowTransform = aMatrix;
}
// These getters can be used anytime.
float GetShadowOpacity() { return mShadowOpacity; }
const nsIntRect* GetShadowClipRect() { return mUseShadowClipRect ? &mShadowClipRect : nullptr; }
const nsIntRegion& GetShadowVisibleRegion() { return mShadowVisibleRegion; }
const gfx3DMatrix& GetShadowTransform() { return mShadowTransform; }
protected:
gfx3DMatrix mShadowTransform;
nsIntRegion mShadowVisibleRegion;
nsIntRect mShadowClipRect;
LayerManagerComposite* mCompositeManager;
RefPtr<Compositor> mCompositor;
float mShadowOpacity;
bool mUseShadowClipRect;
bool mDestroyed;
};

View File

@ -26,7 +26,7 @@ namespace mozilla {
namespace layers {
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
: ThebesLayer(aManager, nullptr)
: ShadowThebesLayer(aManager, nullptr)
, LayerComposite(aManager)
, mBuffer(nullptr)
{

View File

@ -10,7 +10,7 @@
#include "mozilla/layers/ShadowLayers.h"
#include "Layers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "base/task.h"
@ -25,7 +25,7 @@ namespace layers {
class ContentHost;
class ThebesLayerComposite : public ThebesLayer,
class ThebesLayerComposite : public ShadowThebesLayer,
public LayerComposite
{
public:
@ -34,6 +34,11 @@ public:
virtual void Disconnect() MOZ_OVERRIDE;
virtual void SetValidRegion(const nsIntRegion& aRegion) MOZ_OVERRIDE
{
ShadowThebesLayer::SetValidRegion(aRegion);
}
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
CompositableHost* GetCompositableHost() MOZ_OVERRIDE;
@ -55,23 +60,10 @@ public:
void EnsureTiled() { mRequiresTiledProperties = true; }
virtual void InvalidateRegion(const nsIntRegion& aRegion)
{
NS_RUNTIMEABORT("ThebesLayerComposites can't fill invalidated regions");
}
void SetValidRegion(const nsIntRegion& aRegion)
{
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ValidRegion", this));
mValidRegion = aRegion;
Mutated();
}
MOZ_LAYER_DECL_NAME("ThebesLayerComposite", TYPE_SHADOW)
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const MOZ_OVERRIDE { return "ThebesLayerComposite"; }
protected:
#ifdef MOZ_LAYERS_HAVE_LOG
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
#endif

View File

@ -13,8 +13,7 @@
#include "mozilla/layers/ContentHost.h"
#include "ShadowLayerParent.h"
#include "TiledLayerBuffer.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/ThebesLayerComposite.h"
#include "LayerManagerComposite.h"
#include "CompositorParent.h"
namespace mozilla {
@ -57,7 +56,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
compositableParent->GetCompositableHost();
Layer* layer = compositable ? compositable->GetLayer() : nullptr;
LayerComposite* shadowLayer = layer ? layer->AsLayerComposite() : nullptr;
ShadowLayer* shadowLayer = layer ? layer->AsShadowLayer() : nullptr;
if (shadowLayer) {
Compositor* compositor = static_cast<LayerManagerComposite*>(layer->Manager())->GetCompositor();
compositable->SetCompositor(compositor);
@ -107,8 +106,8 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
CompositableParent* compositableParent = static_cast<CompositableParent*>(op.compositableParent());
CompositableHost* compositable =
compositableParent->GetCompositableHost();
ThebesLayerComposite* thebes =
static_cast<ThebesLayerComposite*>(compositable->GetLayer());
ShadowThebesLayer* thebes =
static_cast<ShadowThebesLayer*>(compositable->GetLayer());
const ThebesBufferData& bufferData = op.bufferData();

View File

@ -403,9 +403,9 @@ void
CompositorParent::NotifyShadowTreeTransaction()
{
if (mLayerManager) {
LayerManagerComposite* managerComposite = mLayerManager->AsLayerManagerComposite();
if (managerComposite) {
managerComposite->NotifyShadowTreeTransaction();
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
if (shadow) {
shadow->NotifyShadowTreeTransaction();
}
}
ScheduleComposition();
@ -662,14 +662,14 @@ CompositorParent::TransformFixedLayers(Layer* aLayer,
layerTransform.ScalePost(1.0f/aLayer->GetPostXScale(),
1.0f/aLayer->GetPostYScale(),
1);
LayerComposite* layerComposite = aLayer->AsLayerComposite();
layerComposite->SetShadowTransform(layerTransform);
ShadowLayer* shadow = aLayer->AsShadowLayer();
shadow->SetShadowTransform(layerTransform);
const nsIntRect* clipRect = aLayer->GetClipRect();
if (clipRect) {
nsIntRect transformedClipRect(*clipRect);
transformedClipRect.MoveBy(translation.x, translation.y);
layerComposite->SetShadowClipRect(&transformedClipRect);
shadow->SetShadowClipRect(&transformedClipRect);
}
// The transform has now been applied, so there's no need to iterate over
@ -683,18 +683,18 @@ CompositorParent::TransformFixedLayers(Layer* aLayer,
}
}
// Go down the composite layer tree, setting properties to match their
// content-side counterparts.
// Go down shadow layer tree, setting properties to match their non-shadow
// counterparts.
static void
SetShadowProperties(Layer* aLayer)
{
// FIXME: Bug 717688 -- Do these updates in LayerTransactionParent::RecvUpdate.
LayerComposite* layerComposite = aLayer->AsLayerComposite();
// Set the layerComposite's base transform to the layer's base transform.
layerComposite->SetShadowTransform(aLayer->GetBaseTransform());
layerComposite->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
layerComposite->SetShadowClipRect(aLayer->GetClipRect());
layerComposite->SetShadowOpacity(aLayer->GetOpacity());
ShadowLayer* shadow = aLayer->AsShadowLayer();
// Set the shadow's base transform to the layer's base transform.
shadow->SetShadowTransform(aLayer->GetBaseTransform());
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
shadow->SetShadowClipRect(aLayer->GetClipRect());
shadow->SetShadowOpacity(aLayer->GetOpacity());
for (Layer* child = aLayer->GetFirstChild();
child; child = child->GetNextSibling()) {
@ -793,11 +793,11 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint)
Animatable interpolatedValue;
SampleValue(portion, animation, animData.mStartValues[segmentIndex],
animData.mEndValues[segmentIndex], &interpolatedValue);
LayerComposite* layerComposite = aLayer->AsLayerComposite();
ShadowLayer* shadow = aLayer->AsShadowLayer();
switch (animation.property()) {
case eCSSProperty_opacity:
{
layerComposite->SetShadowOpacity(interpolatedValue.get_float());
shadow->SetShadowOpacity(interpolatedValue.get_float());
break;
}
case eCSSProperty_transform:
@ -809,7 +809,7 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint)
1);
}
NS_ASSERTION(!aLayer->GetIsFixedPosition(), "Can't animate transforms on fixed-position layers");
layerComposite->SetShadowTransform(matrix);
shadow->SetShadowTransform(matrix);
break;
}
default:
@ -843,7 +843,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
}
if (AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController()) {
LayerComposite* layerComposite = aLayer->AsLayerComposite();
ShadowLayer* shadow = aLayer->AsShadowLayer();
ViewTransform treeTransform;
*aWantNextFrame |=
@ -861,7 +861,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
transform.ScalePost(1.0f/aLayer->GetPostXScale(),
1.0f/aLayer->GetPostYScale(),
1);
layerComposite->SetShadowTransform(transform);
shadow->SetShadowTransform(transform);
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
TransformFixedLayers(
@ -879,7 +879,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
void
CompositorParent::TransformScrollableLayer(Layer* aLayer, const gfx3DMatrix& aRootTransform)
{
LayerComposite* layerComposite = aLayer->AsLayerComposite();
ShadowLayer* shadow = aLayer->AsShadowLayer();
ContainerLayer* container = aLayer->AsContainerLayer();
const FrameMetrics& metrics = container->GetFrameMetrics();
@ -991,7 +991,7 @@ CompositorParent::TransformScrollableLayer(Layer* aLayer, const gfx3DMatrix& aRo
computedTransform.ScalePost(1.0f/container->GetPostXScale(),
1.0f/container->GetPostYScale(),
1);
layerComposite->SetShadowTransform(computedTransform);
shadow->SetShadowTransform(computedTransform);
TransformFixedLayers(aLayer, offset, scaleDiff, fixedLayerMargins);
}
@ -1063,9 +1063,9 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
SetShadowProperties(root);
}
ScheduleComposition();
LayerManagerComposite *layerComposite = mLayerManager->AsLayerManagerComposite();
if (layerComposite) {
layerComposite->NotifyShadowTreeTransaction();
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
if (shadow) {
shadow->NotifyShadowTreeTransaction();
}
}
@ -1132,7 +1132,7 @@ CompositorParent::AllocPLayerTransaction(const LayersBackend& aBackendHint,
nsRefPtr<LayerManager> layerManager = new BasicShadowLayerManager(mWidget);
mWidget = NULL;
mLayerManager = layerManager;
LayerManagerComposite* slm = layerManager->AsLayerManagerComposite();
ShadowLayerManager* slm = layerManager->AsShadowManager();
if (!slm) {
return NULL;
}
@ -1375,7 +1375,7 @@ CrossProcessCompositorParent::AllocPLayerTransaction(const LayersBackend& aBacke
nsRefPtr<LayerManager> lm = sCurrentCompositor->GetLayerManager();
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, aId);
return new LayerTransactionParent(lm->AsShadowManager(), this, aId);
}
bool

View File

@ -21,7 +21,7 @@
#include "mozilla/Monitor.h"
#include "mozilla/TimeStamp.h"
#include "ShadowLayersManager.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
class nsIWidget;
namespace base {

View File

@ -16,7 +16,6 @@
#include "mozilla/layers/TextureClient.h"
#include "mozilla/layers/ImageClient.h"
#include "mozilla/layers/LayersTypes.h"
#include "ShadowLayers.h"
using namespace base;
using namespace mozilla::ipc;

View File

@ -59,7 +59,7 @@ ImageBridgeParent::RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply)
// Ensure that any pending operations involving back and front
// buffers have completed, so that neither process stomps on the
// other's buffer contents.
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
return true;
}

View File

@ -21,11 +21,6 @@
#include "TiledLayerBuffer.h"
#include "gfxPlatform.h"
#include "CompositableHost.h"
#include "mozilla/layers/ThebesLayerComposite.h"
#include "mozilla/layers/ImageLayerComposite.h"
#include "mozilla/layers/ColorLayerComposite.h"
#include "mozilla/layers/ContainerLayerComposite.h"
#include "mozilla/layers/CanvasLayerComposite.h"
typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
@ -52,13 +47,13 @@ cast(const PCompositableParent* in)
template<class OpCreateT>
static ShadowLayerParent*
AsLayerComposite(const OpCreateT& op)
AsShadowLayer(const OpCreateT& op)
{
return cast(op.layerParent());
}
static ShadowLayerParent*
AsLayerComposite(const OpSetRoot& op)
AsShadowLayer(const OpSetRoot& op)
{
return cast(op.rootParent());
}
@ -130,7 +125,7 @@ ShadowChild(const OpRaiseToTopChild& op)
//--------------------------------------------------
// LayerTransactionParent
LayerTransactionParent::LayerTransactionParent(LayerManagerComposite* aManager,
LayerTransactionParent::LayerTransactionParent(ShadowLayerManager* aManager,
ShadowLayersManager* aLayersManager,
uint64_t aId)
: mLayerManager(aManager)
@ -194,47 +189,47 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
case Edit::TOpCreateThebesLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
nsRefPtr<ThebesLayerComposite> layer =
layer_manager()->CreateThebesLayerComposite();
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
nsRefPtr<ShadowThebesLayer> layer =
layer_manager()->CreateShadowThebesLayer();
AsShadowLayer(edit.get_OpCreateThebesLayer())->Bind(layer);
break;
}
case Edit::TOpCreateContainerLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateContainerLayerComposite();
AsLayerComposite(edit.get_OpCreateContainerLayer())->Bind(layer);
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateShadowContainerLayer();
AsShadowLayer(edit.get_OpCreateContainerLayer())->Bind(layer);
break;
}
case Edit::TOpCreateImageLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
nsRefPtr<ImageLayerComposite> layer =
layer_manager()->CreateImageLayerComposite();
AsLayerComposite(edit.get_OpCreateImageLayer())->Bind(layer);
nsRefPtr<ShadowImageLayer> layer =
layer_manager()->CreateShadowImageLayer();
AsShadowLayer(edit.get_OpCreateImageLayer())->Bind(layer);
break;
}
case Edit::TOpCreateColorLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
nsRefPtr<ColorLayerComposite> layer = layer_manager()->CreateColorLayerComposite();
AsLayerComposite(edit.get_OpCreateColorLayer())->Bind(layer);
nsRefPtr<ShadowColorLayer> layer = layer_manager()->CreateShadowColorLayer();
AsShadowLayer(edit.get_OpCreateColorLayer())->Bind(layer);
break;
}
case Edit::TOpCreateCanvasLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
nsRefPtr<CanvasLayerComposite> layer =
layer_manager()->CreateCanvasLayerComposite();
AsLayerComposite(edit.get_OpCreateCanvasLayer())->Bind(layer);
nsRefPtr<ShadowCanvasLayer> layer =
layer_manager()->CreateShadowCanvasLayer();
AsShadowLayer(edit.get_OpCreateCanvasLayer())->Bind(layer);
break;
}
case Edit::TOpCreateRefLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
nsRefPtr<RefLayerComposite> layer =
layer_manager()->CreateRefLayerComposite();
AsLayerComposite(edit.get_OpCreateRefLayer())->Bind(layer);
nsRefPtr<ShadowRefLayer> layer =
layer_manager()->CreateShadowRefLayer();
AsShadowLayer(edit.get_OpCreateRefLayer())->Bind(layer);
break;
}
@ -243,7 +238,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
Layer* layer = AsLayerComposite(osla)->AsLayer();
Layer* layer = AsShadowLayer(osla)->AsLayer();
const LayerAttributes& attrs = osla.attrs();
const CommonLayerAttributes& common = attrs.common();
@ -272,8 +267,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
case Specific::TThebesLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
ThebesLayerComposite* thebesLayer =
static_cast<ThebesLayerComposite*>(layer);
ShadowThebesLayer* thebesLayer =
static_cast<ShadowThebesLayer*>(layer);
const ThebesLayerAttributes& attrs =
specific.get_ThebesLayerAttributes();
@ -305,7 +300,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
static_cast<CanvasLayer*>(layer)->SetFilter(
specific.get_CanvasLayerAttributes().filter());
static_cast<CanvasLayerComposite*>(layer)->SetBounds(
static_cast<ShadowCanvasLayer*>(layer)->SetBounds(
specific.get_CanvasLayerAttributes().bounds());
break;
@ -333,7 +328,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
case Edit::TOpSetRoot: {
MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
mRoot = AsLayerComposite(edit.get_OpSetRoot())->AsContainer();
mRoot = AsShadowLayer(edit.get_OpSetRoot())->AsContainer();
break;
}
case Edit::TOpInsertAfter: {
@ -411,7 +406,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
// Ensure that any pending operations involving back and front
// buffers have completed, so that neither process stomps on the
// other's buffer contents.
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
@ -428,7 +423,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
void
LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable)
{
LayerComposite* layer = aLayerParent->AsLayer()->AsLayerComposite();
ShadowLayer* layer = aLayerParent->AsLayer()->AsShadowLayer();
MOZ_ASSERT(layer);
LayerComposite* layerComposite = aLayerParent->AsLayer()->AsLayerComposite();

View File

@ -22,7 +22,7 @@ class RenderFrameParent;
namespace layers {
class Layer;
class LayerManagerComposite;
class ShadowLayerManager;
class ShadowLayerParent;
class CompositableParent;
@ -34,14 +34,14 @@ class LayerTransactionParent : public PLayerTransactionParent,
typedef InfallibleTArray<EditReply> EditReplyArray;
public:
LayerTransactionParent(LayerManagerComposite* aManager,
LayerTransactionParent(ShadowLayerManager* aManager,
ShadowLayersManager* aLayersManager,
uint64_t aId);
~LayerTransactionParent();
void Destroy();
LayerManagerComposite* layer_manager() const { return mLayerManager; }
ShadowLayerManager* layer_manager() const { return mLayerManager; }
uint64_t GetId() const { return mId; }
ContainerLayer* GetRoot() const { return mRoot; }
@ -88,11 +88,11 @@ protected:
virtual PCompositableParent* AllocPCompositable(const TextureInfo& aInfo) MOZ_OVERRIDE;
virtual bool DeallocPCompositable(PCompositableParent* actor) MOZ_OVERRIDE;
void Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable);
private:
nsRefPtr<LayerManagerComposite> mLayerManager;
nsRefPtr<ShadowLayerManager> mLayerManager;
ShadowLayersManager* mShadowLayersManager;
// Hold the root because it might be grafted under various
// containers in the "real" layer tree

View File

@ -8,7 +8,6 @@
#include <d3d10_1.h>
#include <dxgi.h>
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/PLayerTransaction.h"
#include "ShadowLayers.h"
@ -79,21 +78,21 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
}
/*static*/ already_AddRefed<TextureImage>
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
{
return nullptr;
}
/*static*/ bool
LayerManagerComposite::SupportsDirectTexturing()
ShadowLayerManager::SupportsDirectTexturing()
{
return true;
}
/*static*/ void
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
{
}

View File

@ -11,8 +11,6 @@
#include "mozilla/layers/PGrallocBufferParent.h"
#include "mozilla/layers/PLayerTransactionChild.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/unused.h"
#include "nsXULAppAPI.h"
@ -222,11 +220,11 @@ GrallocBufferActor::Create(const gfxIntSize& aSize,
}
/*static*/ already_AddRefed<TextureImage>
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext* aGL,
const SurfaceDescriptor& aDescriptor,
GLenum aWrapMode)
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
const SurfaceDescriptor& aDescriptor,
GLenum aWrapMode)
{
PROFILER_LABEL("LayerManagerComposite", "OpenDescriptorForDirectTexturing");
PROFILER_LABEL("ShadowLayerManager", "OpenDescriptorForDirectTexturing");
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
return nullptr;
}
@ -235,13 +233,13 @@ LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext* aGL,
}
/*static*/ bool
LayerManagerComposite::SupportsDirectTexturing()
ShadowLayerManager::SupportsDirectTexturing()
{
return true;
}
/*static*/ void
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
{
// Nothing to be done for gralloc.
}

View File

@ -60,7 +60,7 @@ class GrallocBufferActor : public PGrallocBufferChild
, public PGrallocBufferParent
{
friend class ShadowLayerForwarder;
friend class LayerManagerComposite;
friend class ShadowLayerManager;
friend class ImageBridgeChild;
typedef android::GraphicBuffer GraphicBuffer;

View File

@ -7,8 +7,6 @@
#include "mozilla/layers/PLayerTransaction.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/CompositorTypes.h"
#include "gfxPlatform.h"
@ -74,7 +72,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
}
/*static*/ void
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
{
}
@ -85,15 +83,15 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
}
/*static*/ already_AddRefed<TextureImage>
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
{
return nullptr;
}
/*static*/ bool
LayerManagerComposite::SupportsDirectTexturing()
ShadowLayerManager::SupportsDirectTexturing()
{
return false;
}

View File

@ -6,11 +6,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/layers/PLayerTransaction.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/ISurfaceAllocator.h"
#include "mozilla/layers/ShadowLayers.h"
#include "gfxPlatform.h"
#include "gfxXlibSurface.h"
@ -187,7 +184,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
}
/*static*/ void
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
{
if (UsingXCompositing()) {
// If we're using X surfaces, we need to finish all pending
@ -200,16 +197,16 @@ LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
}
/*static*/ already_AddRefed<TextureImage>
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
{
// FIXME/bug XXXXXX: implement this using texture-from-pixmap
return nullptr;
}
/*static*/ bool
LayerManagerComposite::SupportsDirectTexturing()
ShadowLayerManager::SupportsDirectTexturing()
{
return false;
}

View File

@ -591,6 +591,25 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
return false;
}
/*static*/ already_AddRefed<TextureImage>
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
const SurfaceDescriptor&,
GLenum)
{
return nullptr;
}
/*static*/ bool
ShadowLayerManager::SupportsDirectTexturing()
{
return false;
}
/*static*/ void
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
{
}
#endif // !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
AutoOpenSurface::AutoOpenSurface(OpenMode aMode,

View File

@ -18,7 +18,6 @@
#include "mozilla/layers/ISurfaceAllocator.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/layers/CompositableForwarder.h"
#include "mozilla/layers/CompositorTypes.h"
class gfxSharedImageSurface;
@ -39,12 +38,12 @@ class PLayerChild;
class PLayerTransactionChild;
class PLayerTransactionParent;
class ShadowableLayer;
class ThebesLayerComposite;
class ContainerLayerComposite;
class ImageLayerComposite;
class ColorLayerComposite;
class CanvasLayerComposite;
class RefLayerComposite;
class ShadowThebesLayer;
class ShadowContainerLayer;
class ShadowImageLayer;
class ShadowColorLayer;
class ShadowCanvasLayer;
class ShadowRefLayer;
class SurfaceDescriptor;
class ThebesBuffer;
class TiledLayerComposer;
@ -58,6 +57,12 @@ class ImageClient;
class CanvasClient;
class ContentClient;
enum OpenMode {
OPEN_READ_ONLY,
OPEN_READ_WRITE
};
/**
* We want to share layer trees across thread contexts and address
@ -86,13 +91,13 @@ class ContentClient;
* parent context. This comprises recording layer-tree modifications
* into atomic transactions and pushing them over IPC.
*
* LayerManagerComposite grafts layer subtrees published by child-context
* ShadowLayerManager grafts layer subtrees published by child-context
* ShadowLayerForwarder(s) into a parent-context layer tree.
*
* (Advanced note: because our process tree may have a height >2, a
* non-leaf subprocess may both receive updates from child processes
* and publish them to parent processes. Put another way,
* LayerManagers may be both LayerManagerComposites and
* LayerManagers may be both ShadowLayerManagers and
* ShadowLayerForwarders.)
*
* There are only shadow types for layers that have different shadow
@ -123,7 +128,7 @@ class ContentClient;
* compositable transactions.
* A transaction is a set of changes to the layers and/or the compositables
* that are sent and applied together to the compositor thread to keep the
* LayerComposite in a coherent state.
* ShadowLayer in a coherent state.
* Layer transactions maintain the shape of the shadow layer tree, and
* synchronize the texture data held by compositables. Layer transactions
* are always between the content thread and the compositor thread.
@ -181,7 +186,7 @@ public:
/**
* Begin recording a transaction to be forwarded atomically to a
* LayerManagerComposite.
* ShadowLayerManager.
*/
void BeginTransaction(const nsIntRect& aTargetBounds,
ScreenRotation aRotation,
@ -288,8 +293,8 @@ public:
const nsIntRect& aRect);
/**
* End the current transaction and forward it to LayerManagerComposite.
* |aReplies| are directions from the LayerManagerComposite to the
* End the current transaction and forward it to ShadowLayerManager.
* |aReplies| are directions from the ShadowLayerManager to the
* caller of EndTransaction().
*/
bool EndTransaction(InfallibleTArray<EditReply>* aReplies);
@ -303,7 +308,7 @@ public:
}
/**
* True if this is forwarding to a LayerManagerComposite.
* True if this is forwarding to a ShadowLayerManager.
*/
bool HasShadowManager() const { return !!mShadowManager; }
PLayerTransactionChild* GetShadowManager() const { return mShadowManager; }
@ -312,23 +317,23 @@ public:
* The following Alloc/Open/Destroy interfaces abstract over the
* details of working with surfaces that are shared across
* processes. They provide the glue between C++ Layers and the
* LayerComposite IPC system.
* ShadowLayer IPC system.
*
* The basic lifecycle is
*
* - a Layer needs a buffer. Its ShadowableLayer subclass calls
* AllocBuffer(), then calls one of the Created*Buffer() methods
* above to transfer the (temporary) front buffer to its
* LayerComposite in the other process. The Layer needs a
* ShadowLayer in the other process. The Layer needs a
* gfxASurface to paint, so the ShadowableLayer uses
* OpenDescriptor(backBuffer) to get that surface, and hands it
* out to the Layer.
*
* - a Layer has painted new pixels. Its ShadowableLayer calls one
* of the Painted*Buffer() methods above with the back buffer
* descriptor. This notification is forwarded to the LayerComposite,
* descriptor. This notification is forwarded to the ShadowLayer,
* which uses OpenDescriptor() to access the newly-painted pixels.
* The LayerComposite then updates its front buffer in a Layer- and
* The ShadowLayer then updates its front buffer in a Layer- and
* platform-dependent way, and sends a surface descriptor back to
* the ShadowableLayer that becomes its new back back buffer.
*
@ -337,7 +342,7 @@ public:
* buffer descriptor. The actual back buffer surface is then
* destroyed using DestroySharedSurface() just before notifying
* the parent process. When the parent process is notified, the
* LayerComposite also calls DestroySharedSurface() on its front
* ShadowLayer also calls DestroySharedSurface() on its front
* buffer, and the double-buffer pair is gone.
*/
@ -352,7 +357,7 @@ public:
/**
* Construct a shadow of |aLayer| on the "other side", at the
* LayerManagerComposite.
* ShadowLayerManager.
*/
PLayerChild* ConstructShadowFor(ShadowableLayer* aLayer);
@ -427,6 +432,66 @@ private:
bool mIsFirstPaint;
};
class ShadowLayerManager : public LayerManager
{
public:
virtual ~ShadowLayerManager() {}
virtual void GetBackendName(nsAString& name) { name.AssignLiteral("Shadow"); }
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowThebesLayer> CreateShadowThebesLayer() = 0;
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowContainerLayer> CreateShadowContainerLayer() = 0;
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer() = 0;
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer() = 0;
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer() = 0;
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowRefLayer> CreateShadowRefLayer() { return nullptr; }
virtual void NotifyShadowTreeTransaction() {}
/**
* Try to open |aDescriptor| for direct texturing. If the
* underlying surface supports direct texturing, a non-null
* TextureImage is returned. Otherwise null is returned.
*/
static already_AddRefed<gl::TextureImage>
OpenDescriptorForDirectTexturing(gl::GLContext* aContext,
const SurfaceDescriptor& aDescriptor,
GLenum aWrapMode);
/**
* returns true if PlatformAllocBuffer will return a buffer that supports
* direct texturing
*/
static bool SupportsDirectTexturing();
static void PlatformSyncBeforeReplyUpdate();
void SetCompositorID(uint32_t aID)
{
NS_ASSERTION(mCompositor, "No compositor");
mCompositor->SetCompositorID(aID);
}
Compositor* GetCompositor() const
{
return mCompositor;
}
protected:
ShadowLayerManager()
: mCompositor(nullptr)
{}
bool PlatformDestroySharedSurface(SurfaceDescriptor* aSurface);
RefPtr<Compositor> mCompositor;
};
class CompositableClient;
/**
@ -461,6 +526,199 @@ protected:
PLayerChild* mShadow;
};
/**
* A ShadowLayer is the representation of a child-context's Layer in a
* parent context. They can be transformed, clipped,
* etc. independently of their origin Layers.
*
* Note that ShadowLayers can themselves have a shadow in a parent
* context.
*/
class ShadowLayer
{
public:
virtual ~ShadowLayer() {}
virtual void DestroyFrontBuffer() { }
/**
* The following methods are
*
* CONSTRUCTION PHASE ONLY
*
* They are analogous to the Layer interface.
*/
void SetShadowVisibleRegion(const nsIntRegion& aRegion)
{
mShadowVisibleRegion = aRegion;
}
void SetShadowOpacity(float aOpacity)
{
mShadowOpacity = aOpacity;
}
void SetShadowClipRect(const nsIntRect* aRect)
{
mUseShadowClipRect = aRect != nullptr;
if (aRect) {
mShadowClipRect = *aRect;
}
}
void SetShadowTransform(const gfx3DMatrix& aMatrix)
{
mShadowTransform = aMatrix;
}
// These getters can be used anytime.
float GetShadowOpacity() { return mShadowOpacity; }
const nsIntRect* GetShadowClipRect() { return mUseShadowClipRect ? &mShadowClipRect : nullptr; }
const nsIntRegion& GetShadowVisibleRegion() { return mShadowVisibleRegion; }
const gfx3DMatrix& GetShadowTransform() { return mShadowTransform; }
protected:
ShadowLayer()
: mShadowOpacity(1.0f)
, mUseShadowClipRect(false)
{}
nsIntRegion mShadowVisibleRegion;
gfx3DMatrix mShadowTransform;
nsIntRect mShadowClipRect;
float mShadowOpacity;
bool mUseShadowClipRect;
};
class ShadowThebesLayer : public ShadowLayer,
public ThebesLayer
{
public:
virtual void InvalidateRegion(const nsIntRegion& aRegion)
{
NS_RUNTIMEABORT("ShadowThebesLayers can't fill invalidated regions");
}
/**
* CONSTRUCTION PHASE ONLY
*/
virtual void SetValidRegion(const nsIntRegion& aRegion)
{
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ValidRegion", this));
mValidRegion = aRegion;
Mutated();
}
const nsIntRegion& GetValidRegion() { return mValidRegion; }
virtual void
Swap(const ThebesBuffer& aNewFront, const nsIntRegion& aUpdatedRegion,
OptionalThebesBuffer* aNewBack, nsIntRegion* aNewBackValidRegion,
OptionalThebesBuffer* aReadOnlyFront, nsIntRegion* aFrontUpdatedRegion) {
NS_RUNTIMEABORT("should not use layer swap");
};
virtual ShadowLayer* AsShadowLayer() { return this; }
MOZ_LAYER_DECL_NAME("ShadowThebesLayer", TYPE_SHADOW)
protected:
ShadowThebesLayer(LayerManager* aManager, void* aImplData)
: ThebesLayer(aManager, aImplData)
{}
};
class ShadowContainerLayer : public ShadowLayer,
public ContainerLayer
{
public:
virtual ShadowLayer* AsShadowLayer() { return this; }
MOZ_LAYER_DECL_NAME("ShadowContainerLayer", TYPE_SHADOW)
protected:
ShadowContainerLayer(LayerManager* aManager, void* aImplData)
: ContainerLayer(aManager, aImplData)
{}
};
class ShadowCanvasLayer : public ShadowLayer,
public CanvasLayer
{
public:
/**
* CONSTRUCTION PHASE ONLY
*
* Publish the remote layer's back surface to this shadow, swapping
* out the old front surface (the new back surface for the remote
* layer).
*/
virtual void Swap(const SurfaceDescriptor& aNewFront, bool needYFlip,
SurfaceDescriptor* aNewBack) = 0;
virtual ShadowLayer* AsShadowLayer() { return this; }
void SetBounds(nsIntRect aBounds) { mBounds = aBounds; }
MOZ_LAYER_DECL_NAME("ShadowCanvasLayer", TYPE_SHADOW)
protected:
ShadowCanvasLayer(LayerManager* aManager, void* aImplData)
: CanvasLayer(aManager, aImplData)
{}
};
class ShadowImageLayer : public ShadowLayer,
public ImageLayer
{
public:
/**
* CONSTRUCTION PHASE ONLY
* @see ShadowCanvasLayer::Swap
*/
virtual ShadowLayer* AsShadowLayer() { return this; }
MOZ_LAYER_DECL_NAME("ShadowImageLayer", TYPE_SHADOW)
protected:
ShadowImageLayer(LayerManager* aManager, void* aImplData)
: ImageLayer(aManager, aImplData)
{}
};
class ShadowColorLayer : public ShadowLayer,
public ColorLayer
{
public:
virtual ShadowLayer* AsShadowLayer() { return this; }
MOZ_LAYER_DECL_NAME("ShadowColorLayer", TYPE_SHADOW)
protected:
ShadowColorLayer(LayerManager* aManager, void* aImplData)
: ColorLayer(aManager, aImplData)
{}
};
class ShadowRefLayer : public ShadowLayer,
public RefLayer
{
public:
virtual ShadowLayer* AsShadowLayer() { return this; }
MOZ_LAYER_DECL_NAME("ShadowRefLayer", TYPE_SHADOW)
protected:
ShadowRefLayer(LayerManager* aManager, void* aImplData)
: RefLayer(aManager, aImplData)
{}
};
} // namespace layers
} // namespace mozilla

View File

@ -14,6 +14,7 @@ EXPORTS += [
'BasicTiledThebesLayer.h',
'BasicThebesLayer.h',
'CompositableHost.h',
'LayerManagerComposite.h',
'Composer2D.h',
'GonkIOSurfaceImage.h',
'FrameMetrics.h',
@ -61,14 +62,11 @@ EXPORTS.mozilla.layers += [
'AsyncPanZoomController.h',
'Axis.h',
'CanvasClient.h',
'CanvasLayerComposite.h',
'ColorLayerComposite.h',
'CompositableClient.h',
'CompositableTransactionParent.h',
'Compositor.h',
'CompositorOGL.h',
'CompositorTypes.h',
'ContainerLayerComposite.h',
'ContentHost.h',
'CompositingRenderTargetOGL.h',
'CompositorCocoaWidgetHelper.h',
@ -82,14 +80,12 @@ EXPORTS.mozilla.layers += [
'ImageBridgeChild.h',
'ImageBridgeParent.h',
'ImageClient.h',
'ImageLayerComposite.h',
'ImageHost.h',
'ISurfaceAllocator.h',
'LayerManagerComposite.h',
'LayersTypes.h',
'ShadowLayers.h',
'LayerTransactionChild.h',
'LayerTransactionParent.h',
'ShadowLayers.h',
'ShadowLayersManager.h',
'RenderTrace.h',
'SharedRGBImage.h',
@ -100,7 +96,6 @@ EXPORTS.mozilla.layers += [
'TextureHost.h',
'TextureClientOGL.h',
'TextureHostOGL.h',
'ThebesLayerComposite.h',
'TiledContentClient.h',
]

View File

@ -1,7 +1,7 @@
#include "GLManager.h"
#include "LayerManagerOGL.h"
#include "CompositorOGL.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "GLContext.h"
using namespace mozilla::gl;

View File

@ -32,11 +32,11 @@ namespace layers {
class Composer2D;
class LayerOGL;
class ThebesLayerComposite;
class ContainerLayerComposite;
class ImageLayerComposite;
class CanvasLayerComposite;
class ColorLayerComposite;
class ShadowThebesLayer;
class ShadowContainerLayer;
class ShadowImageLayer;
class ShadowCanvasLayer;
class ShadowColorLayer;
struct FPSState;
/**

View File

@ -254,7 +254,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader,
float aTempScaleDiffX = 1.0,
float aTempScaleDiffY = 1.0)
{
LayerComposite* shadow = aLayer->AsLayerComposite();
ShadowLayer* shadow = aLayer->AsShadowLayer();
shadow->SetShadowClipRect(aLayer->GetClipRect());
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
shadow->SetShadowOpacity(aLayer->GetOpacity());
@ -435,7 +435,7 @@ BuildBackgroundPatternFor(ContainerLayer* aContainer,
LayerManager* aManager,
nsIFrame* aFrame)
{
LayerComposite* shadowRoot = aShadowRoot->AsLayerComposite();
ShadowLayer* shadowRoot = aShadowRoot->AsShadowLayer();
gfxMatrix t;
if (!shadowRoot->GetShadowTransform().Is2D(&t)) {
return;
@ -603,7 +603,7 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
// Perhaps the document containing this frame currently has no presentation?
if (lm && lm->AsLayerManagerComposite()) {
if (lm && lm->AsShadowManager()) {
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
} else {
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
@ -853,7 +853,7 @@ RenderFrameParent::AllocPLayerTransaction()
return nullptr;
}
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, 0);
return new LayerTransactionParent(lm->AsShadowManager(), this, 0);
}
bool

View File

@ -39,7 +39,7 @@ using mozilla::unused;
#include "Layers.h"
#include "BasicLayers.h"
#include "LayerManagerOGL.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "GLContext.h"
#include "GLContextProvider.h"

View File

@ -51,7 +51,7 @@
#include "nsRegion.h"
#include "Layers.h"
#include "LayerManagerOGL.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "LayerManagerComposite.h"
#include "GLTextureImage.h"
#include "mozilla/layers/GLManager.h"
#include "mozilla/layers/CompositorCocoaWidgetHelper.h"
@ -2842,7 +2842,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
// Mac OS X bug that stops windows updating on OS X when we use OpenGL.
LayerManager *layerManager = mGeckoChild->GetLayerManager(nullptr);
if (mUsingOMTCompositor && painted && !mDidForceRefreshOpenGL &&
layerManager->AsLayerManagerComposite()) {
layerManager->AsShadowManager()) {
if (!mDidForceRefreshOpenGL) {
[self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
mDidForceRefreshOpenGL = YES;