зеркало из https://github.com/mozilla/gecko-dev.git
Bug 856079 - Merge ShadowLayer and LayerComposite (keeping the later). r=nrc
This commit is contained in:
Родитель
26dca3b0bb
Коммит
f2669ce1ed
|
@ -26,7 +26,7 @@
|
|||
*
|
||||
* # Main interfaces and abstractions
|
||||
*
|
||||
* - Layer, ShadowableLayer and ShadowLayer
|
||||
* - Layer, ShadowableLayer and LayerComposite
|
||||
* (see Layers.h and ipc/ShadowLayers.h)
|
||||
* - CompositableClient and CompositableHost
|
||||
* (client/CompositableClient.h composite/CompositableHost.h)
|
||||
|
|
|
@ -136,6 +136,15 @@ 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
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
#include "mozilla/layers/PLayerTransaction.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include "ImageLayers.h"
|
||||
|
@ -460,7 +460,7 @@ Layer::CanUseOpaqueSurface()
|
|||
const nsIntRect*
|
||||
Layer::GetEffectiveClipRect()
|
||||
{
|
||||
if (ShadowLayer* shadow = AsShadowLayer()) {
|
||||
if (LayerComposite* shadow = AsLayerComposite()) {
|
||||
return shadow->GetShadowClipRect();
|
||||
}
|
||||
return GetClipRect();
|
||||
|
@ -469,7 +469,7 @@ Layer::GetEffectiveClipRect()
|
|||
const nsIntRegion&
|
||||
Layer::GetEffectiveVisibleRegion()
|
||||
{
|
||||
if (ShadowLayer* shadow = AsShadowLayer()) {
|
||||
if (LayerComposite* shadow = AsLayerComposite()) {
|
||||
return shadow->GetShadowVisibleRegion();
|
||||
}
|
||||
return GetVisibleRegion();
|
||||
|
@ -640,7 +640,7 @@ const gfx3DMatrix
|
|||
Layer::GetLocalTransform()
|
||||
{
|
||||
gfx3DMatrix transform;
|
||||
if (ShadowLayer* shadow = AsShadowLayer())
|
||||
if (LayerComposite* shadow = AsLayerComposite())
|
||||
transform = shadow->GetShadowTransform();
|
||||
else
|
||||
transform = mTransform;
|
||||
|
@ -665,7 +665,7 @@ Layer::ApplyPendingUpdatesForThisTransaction()
|
|||
const float
|
||||
Layer::GetLocalOpacity()
|
||||
{
|
||||
if (ShadowLayer* shadow = AsShadowLayer())
|
||||
if (LayerComposite* shadow = AsLayerComposite())
|
||||
return shadow->GetShadowOpacity();
|
||||
return mOpacity;
|
||||
}
|
||||
|
@ -975,7 +975,7 @@ LayerManager::BeginTabSwitch()
|
|||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
static nsACString& PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer);
|
||||
static nsACString& PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite);
|
||||
|
||||
#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, AsShadowLayer());
|
||||
::PrintInfo(aTo, AsLayerComposite());
|
||||
|
||||
if (mUseClipRect) {
|
||||
AppendToString(aTo, mClipRect, " [clip=", "]");
|
||||
|
@ -1312,19 +1312,19 @@ LayerManager::IsLogEnabled()
|
|||
}
|
||||
|
||||
static nsACString&
|
||||
PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
|
||||
PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite)
|
||||
{
|
||||
if (!aShadowLayer) {
|
||||
if (!aLayerComposite) {
|
||||
return aTo;
|
||||
}
|
||||
if (const nsIntRect* clipRect = aShadowLayer->GetShadowClipRect()) {
|
||||
if (const nsIntRect* clipRect = aLayerComposite->GetShadowClipRect()) {
|
||||
AppendToString(aTo, *clipRect, " [shadow-clip=", "]");
|
||||
}
|
||||
if (!aShadowLayer->GetShadowTransform().IsIdentity()) {
|
||||
AppendToString(aTo, aShadowLayer->GetShadowTransform(), " [shadow-transform=", "]");
|
||||
if (!aLayerComposite->GetShadowTransform().IsIdentity()) {
|
||||
AppendToString(aTo, aLayerComposite->GetShadowTransform(), " [shadow-transform=", "]");
|
||||
}
|
||||
if (!aShadowLayer->GetShadowVisibleRegion().IsEmpty()) {
|
||||
AppendToString(aTo, aShadowLayer->GetShadowVisibleRegion(), " [shadow-visible=", "]");
|
||||
if (!aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
|
||||
AppendToString(aTo, aLayerComposite->GetShadowVisibleRegion(), " [shadow-visible=", "]");
|
||||
}
|
||||
return aTo;
|
||||
}
|
||||
|
|
|
@ -60,10 +60,10 @@ class CanvasLayer;
|
|||
class ReadbackLayer;
|
||||
class ReadbackProcessor;
|
||||
class RefLayer;
|
||||
class ShadowLayer;
|
||||
class LayerComposite;
|
||||
class ShadowableLayer;
|
||||
class ShadowLayerForwarder;
|
||||
class ShadowLayerManager;
|
||||
class LayerManagerComposite;
|
||||
class SpecificLayerAttributes;
|
||||
class SurfaceDescriptor;
|
||||
class Compositor;
|
||||
|
@ -168,7 +168,7 @@ public:
|
|||
virtual ShadowLayerForwarder* AsShadowForwarder()
|
||||
{ return nullptr; }
|
||||
|
||||
virtual ShadowLayerManager* AsShadowManager()
|
||||
virtual LayerManagerComposite* AsLayerManagerComposite()
|
||||
{ return nullptr; }
|
||||
|
||||
/**
|
||||
|
@ -1015,10 +1015,10 @@ public:
|
|||
virtual ColorLayer* AsColorLayer() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ShadowLayer. Return null if this is not a
|
||||
* ShadowLayer. Can be used anytime.
|
||||
* Dynamic cast to a LayerComposite. Return null if this is not a
|
||||
* LayerComposite. Can be used anytime.
|
||||
*/
|
||||
virtual ShadowLayer* AsShadowLayer() { return nullptr; }
|
||||
virtual LayerComposite* AsLayerComposite() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ShadowableLayer. Return null if this is not a
|
||||
|
@ -1026,12 +1026,6 @@ 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.
|
||||
|
|
|
@ -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(), "ShadowContainerLayer") != 0) {
|
||||
strcmp(aLayer->Name(), "ContainerLayerComposite") != 0) {
|
||||
printf_stderr("%s RENDERTRACE %u rect #%02X%s %i %i %i %i\n",
|
||||
aLayer->Name(), (int)PR_IntervalNow(),
|
||||
colorId, aColor,
|
||||
|
|
|
@ -1251,7 +1251,7 @@ BasicShadowLayerManager::ForwardTransaction()
|
|||
RenderTraceScope rendertrace("Foward Transaction", "000090");
|
||||
mPhase = PHASE_FORWARD;
|
||||
|
||||
// forward this transaction's changeset to our ShadowLayerManager
|
||||
// forward this transaction's changeset to our LayerManagerComposite
|
||||
AutoInfallibleTArray<EditReply, 10> replies;
|
||||
if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies)) {
|
||||
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
|
||||
|
|
|
@ -21,11 +21,11 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
class BasicShadowableLayer;
|
||||
class ShadowThebesLayer;
|
||||
class ShadowContainerLayer;
|
||||
class ShadowImageLayer;
|
||||
class ShadowCanvasLayer;
|
||||
class ShadowColorLayer;
|
||||
class ThebesLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class CanvasLayerComposite;
|
||||
class ColorLayerComposite;
|
||||
class ReadbackProcessor;
|
||||
class ImageFactory;
|
||||
class PaintLayerContext;
|
||||
|
|
|
@ -349,7 +349,7 @@ protected:
|
|||
virtual already_AddRefed<gfxASurface>
|
||||
CreateBuffer(ContentType, const nsIntRect&, uint32_t, gfxASurface**)
|
||||
{
|
||||
NS_RUNTIMEABORT("ShadowThebesLayer can't paint content");
|
||||
NS_RUNTIMEABORT("ThebesLayerComposite can't paint content");
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ class CompositableChild;
|
|||
*
|
||||
* To do in-transaction texture transfer (the default), call
|
||||
* ShadowLayerForwarder::Attach(CompositableClient*, ShadowableLayer*). This
|
||||
* will let the ShadowLayer on the compositor side know which CompositableHost
|
||||
* will let the LayerComposite on the compositor side know which CompositableHost
|
||||
* to use for compositing.
|
||||
*
|
||||
* To do async texture transfer (like async-video), the CompositableClient
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "nsIWidget.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -22,7 +23,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
|
|||
if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ShadowLayerManager::SupportsDirectTexturing() ||
|
||||
if (LayerManagerComposite::SupportsDirectTexturing() ||
|
||||
PR_GetEnv("MOZ_FORCE_DOUBLE_BUFFERING")) {
|
||||
return new ContentClientDoubleBuffered(aForwarder);
|
||||
}
|
||||
|
|
|
@ -21,11 +21,9 @@ class GLContext;
|
|||
|
||||
namespace layers {
|
||||
|
||||
class PTextureChild;
|
||||
class ContentClient;
|
||||
class PlanarYCbCrImage;
|
||||
class Image;
|
||||
class PTextureChild;
|
||||
class CompositableForwarder;
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,7 +17,7 @@ using namespace mozilla;
|
|||
using namespace mozilla::layers;
|
||||
|
||||
CanvasLayerComposite::CanvasLayerComposite(LayerManagerComposite* aManager)
|
||||
: ShadowCanvasLayer(aManager, nullptr)
|
||||
: CanvasLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
, mImageHost(nullptr)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define GFX_CanvasLayerComposite_H
|
||||
|
||||
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "gfxASurface.h"
|
||||
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#include "mozilla/X11Util.h"
|
||||
|
@ -20,14 +20,12 @@ namespace layers {
|
|||
// canvas is identical to compositing an image.
|
||||
class ImageHost;
|
||||
|
||||
// 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,
|
||||
class CanvasLayerComposite : public CanvasLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
public:
|
||||
CanvasLayerComposite(LayerManagerComposite* aManager);
|
||||
|
||||
virtual ~CanvasLayerComposite();
|
||||
|
||||
// CanvasLayer impl
|
||||
|
@ -38,14 +36,6 @@ 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
|
||||
|
@ -53,7 +43,6 @@ public:
|
|||
Destroy();
|
||||
}
|
||||
|
||||
// LayerComposite impl
|
||||
virtual Layer* GetLayer() MOZ_OVERRIDE;
|
||||
virtual void RenderLayer(const nsIntPoint& aOffset,
|
||||
const nsIntRect& aClipRect) MOZ_OVERRIDE;
|
||||
|
@ -64,6 +53,8 @@ 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"; }
|
||||
|
||||
|
|
|
@ -9,18 +9,18 @@
|
|||
#include "mozilla/layers/PLayerTransaction.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
|
||||
class ColorLayerComposite : public ShadowColorLayer,
|
||||
class ColorLayerComposite : public ColorLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
public:
|
||||
ColorLayerComposite(LayerManagerComposite *aManager)
|
||||
: ShadowColorLayer(aManager, nullptr)
|
||||
: ColorLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ColorLayerComposite);
|
||||
|
|
|
@ -152,7 +152,7 @@ ContainerRender(ContainerT* aContainer,
|
|||
}
|
||||
|
||||
ContainerLayerComposite::ContainerLayerComposite(LayerManagerComposite *aManager)
|
||||
: ShadowContainerLayer(aManager, nullptr)
|
||||
: ContainerLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ContainerLayerComposite);
|
||||
|
@ -329,7 +329,7 @@ ContainerLayerComposite::CleanupResources()
|
|||
}
|
||||
|
||||
RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
|
||||
: ShadowRefLayer(aManager, nullptr)
|
||||
: RefLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerComposite*>(this);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "mozilla/layers/ShadowLayers.h"
|
||||
|
||||
#include "Layers.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/Effects.h"
|
||||
|
||||
#include "gfxUtils.h"
|
||||
|
@ -19,7 +19,7 @@
|
|||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ContainerLayerComposite : public ShadowContainerLayer,
|
||||
class ContainerLayerComposite : public ContainerLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
template<class ContainerT>
|
||||
|
@ -29,6 +29,7 @@ class ContainerLayerComposite : public ShadowContainerLayer,
|
|||
const nsIntRect& aClipRect);
|
||||
public:
|
||||
ContainerLayerComposite(LayerManagerComposite *aManager);
|
||||
|
||||
~ContainerLayerComposite();
|
||||
|
||||
void InsertAfter(Layer* aChild, Layer* aAfter);
|
||||
|
@ -64,7 +65,7 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
class RefLayerComposite : public ShadowRefLayer,
|
||||
class RefLayerComposite : public RefLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
template<class ContainerT>
|
||||
|
@ -93,6 +94,8 @@ public:
|
|||
|
||||
virtual void CleanupResources() MOZ_OVERRIDE;
|
||||
|
||||
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
|
||||
|
||||
// ref layers don't use a compositable
|
||||
CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; }
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define MOZILLA_GFX_IMAGEHOST_H
|
||||
|
||||
#include "CompositableHost.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
ImageLayerComposite::ImageLayerComposite(LayerManagerComposite* aManager)
|
||||
: ShadowImageLayer(aManager, nullptr)
|
||||
: ImageLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
, mImageHost(nullptr)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "mozilla/layers/PLayerTransaction.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "ImageLayers.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
|
@ -18,24 +18,18 @@ namespace layers {
|
|||
|
||||
class ImageHost;
|
||||
|
||||
class ImageLayerComposite : public ShadowImageLayer,
|
||||
class ImageLayerComposite : public ImageLayer,
|
||||
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;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// typedefs conflicts.
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "ThebesLayerComposite.h"
|
||||
#include "ContainerLayerComposite.h"
|
||||
#include "ImageLayerComposite.h"
|
||||
|
@ -21,6 +21,7 @@
|
|||
#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"
|
||||
|
@ -47,6 +48,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
using namespace mozilla::gl;
|
||||
|
||||
static LayerComposite*
|
||||
ToLayerComposite(Layer* aLayer)
|
||||
|
@ -78,16 +80,20 @@ LayerManagerComposite::ClearCachedResources(Layer* aSubtree)
|
|||
// Do we need that?
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* LayerManagerComposite
|
||||
*/
|
||||
LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
|
||||
: mCompositor(aCompositor)
|
||||
{
|
||||
mCompositor = aCompositor;
|
||||
}
|
||||
|
||||
LayerManagerComposite::~LayerManagerComposite()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
LayerManagerComposite::Initialize()
|
||||
{
|
||||
|
@ -543,38 +549,38 @@ LayerManagerComposite::ComputeRenderIntegrity()
|
|||
return 1.f;
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowThebesLayer>
|
||||
LayerManagerComposite::CreateShadowThebesLayer()
|
||||
already_AddRefed<ThebesLayerComposite>
|
||||
LayerManagerComposite::CreateThebesLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return nullptr;
|
||||
}
|
||||
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowContainerLayer>
|
||||
LayerManagerComposite::CreateShadowContainerLayer()
|
||||
already_AddRefed<ContainerLayerComposite>
|
||||
LayerManagerComposite::CreateContainerLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return nullptr;
|
||||
}
|
||||
return nsRefPtr<ContainerLayerComposite>(new ContainerLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowImageLayer>
|
||||
LayerManagerComposite::CreateShadowImageLayer()
|
||||
already_AddRefed<ImageLayerComposite>
|
||||
LayerManagerComposite::CreateImageLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return nullptr;
|
||||
}
|
||||
return nsRefPtr<ImageLayerComposite>(new ImageLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowColorLayer>
|
||||
LayerManagerComposite::CreateShadowColorLayer()
|
||||
already_AddRefed<ColorLayerComposite>
|
||||
LayerManagerComposite::CreateColorLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
|
@ -583,8 +589,8 @@ LayerManagerComposite::CreateShadowColorLayer()
|
|||
return nsRefPtr<ColorLayerComposite>(new ColorLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowCanvasLayer>
|
||||
LayerManagerComposite::CreateShadowCanvasLayer()
|
||||
already_AddRefed<CanvasLayerComposite>
|
||||
LayerManagerComposite::CreateCanvasLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
|
@ -593,8 +599,8 @@ LayerManagerComposite::CreateShadowCanvasLayer()
|
|||
return nsRefPtr<CanvasLayerComposite>(new CanvasLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowRefLayer>
|
||||
LayerManagerComposite::CreateShadowRefLayer()
|
||||
already_AddRefed<RefLayerComposite>
|
||||
LayerManagerComposite::CreateRefLayerComposite()
|
||||
{
|
||||
if (LayerManagerComposite::mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
|
@ -640,6 +646,18 @@ 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()
|
||||
{
|
||||
|
@ -649,5 +667,65 @@ 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 */
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "mozilla/layers/ShadowLayers.h"
|
||||
#include "Composer2D.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "Layers.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
|
@ -30,43 +31,23 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
class LayerComposite;
|
||||
class ShadowThebesLayer;
|
||||
class ShadowContainerLayer;
|
||||
class ShadowImageLayer;
|
||||
class ShadowCanvasLayer;
|
||||
class ShadowColorLayer;
|
||||
class ThebesLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class CanvasLayerComposite;
|
||||
class ColorLayerComposite;
|
||||
class RefLayerComposite;
|
||||
class CompositableHost;
|
||||
class EffectChain;
|
||||
class TiledLayerComposer;
|
||||
|
||||
/**
|
||||
* 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
|
||||
class THEBES_API LayerManagerComposite : public LayerManager
|
||||
{
|
||||
public:
|
||||
LayerManagerComposite(Compositor* aCompositor);
|
||||
virtual ~LayerManagerComposite()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
~LayerManagerComposite();
|
||||
|
||||
virtual void Destroy();
|
||||
virtual void Destroy() MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* return True if initialization was succesful, false when it was not.
|
||||
|
@ -90,7 +71,7 @@ public:
|
|||
/**
|
||||
* LayerManager implementation.
|
||||
*/
|
||||
virtual ShadowLayerManager* AsShadowManager() MOZ_OVERRIDE
|
||||
virtual LayerManagerComposite* AsLayerManagerComposite() MOZ_OVERRIDE
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
@ -100,10 +81,7 @@ public:
|
|||
void BeginTransaction() MOZ_OVERRIDE;
|
||||
void BeginTransactionWithTarget(gfxContext* aTarget) MOZ_OVERRIDE;
|
||||
|
||||
virtual void NotifyShadowTreeTransaction() MOZ_OVERRIDE
|
||||
{
|
||||
mCompositor->NotifyLayersTransaction();
|
||||
}
|
||||
void NotifyShadowTreeTransaction();
|
||||
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
|
@ -112,20 +90,11 @@ public:
|
|||
|
||||
virtual void SetRoot(Layer* aLayer) MOZ_OVERRIDE { mRoot = aLayer; }
|
||||
|
||||
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE
|
||||
{
|
||||
return mCompositor->CanUseCanvasLayerForSize(aSize);
|
||||
}
|
||||
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE;
|
||||
|
||||
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE
|
||||
{
|
||||
return mCompositor->GetTextureFactoryIdentifier();
|
||||
}
|
||||
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE;
|
||||
|
||||
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE
|
||||
{
|
||||
return mCompositor->GetMaxTextureSize();
|
||||
}
|
||||
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE;
|
||||
|
||||
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -134,12 +103,12 @@ public:
|
|||
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
|
||||
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;
|
||||
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 LayersBackend GetBackendType() MOZ_OVERRIDE
|
||||
{
|
||||
|
@ -204,10 +173,7 @@ public:
|
|||
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
|
||||
mozilla::gfx::SurfaceFormat aFormat) MOZ_OVERRIDE;
|
||||
|
||||
const nsIntSize& GetWidgetSize()
|
||||
{
|
||||
return mCompositor->GetWidgetSize();
|
||||
}
|
||||
const nsIntSize& GetWidgetSize();
|
||||
|
||||
/**
|
||||
* Calculates the 'completeness' of the rendering that intersected with the
|
||||
|
@ -218,6 +184,34 @@ 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;
|
||||
|
@ -255,24 +249,32 @@ private:
|
|||
bool mInTransaction;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* General information and tree management for layers.
|
||||
* 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.
|
||||
*/
|
||||
class LayerComposite
|
||||
{
|
||||
public:
|
||||
LayerComposite(LayerManagerComposite *aManager)
|
||||
: mCompositeManager(aManager)
|
||||
, mCompositor(aManager->GetCompositor())
|
||||
, mDestroyed(false)
|
||||
{ }
|
||||
LayerComposite(LayerManagerComposite* aManager);
|
||||
|
||||
virtual ~LayerComposite() {}
|
||||
virtual ~LayerComposite();
|
||||
|
||||
virtual LayerComposite *GetFirstChildComposite()
|
||||
virtual LayerComposite* GetFirstChildComposite()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -297,9 +299,53 @@ 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;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
|
||||
: ShadowThebesLayer(aManager, nullptr)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
, mBuffer(nullptr)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "mozilla/layers/ShadowLayers.h"
|
||||
|
||||
#include "Layers.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "base/task.h"
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace layers {
|
|||
|
||||
class ContentHost;
|
||||
|
||||
class ThebesLayerComposite : public ShadowThebesLayer,
|
||||
class ThebesLayerComposite : public ThebesLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
public:
|
||||
|
@ -34,11 +34,6 @@ 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;
|
||||
|
@ -60,10 +55,23 @@ public:
|
|||
|
||||
void EnsureTiled() { mRequiresTiledProperties = true; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return "ThebesLayerComposite"; }
|
||||
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)
|
||||
|
||||
protected:
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
#include "mozilla/layers/ContentHost.h"
|
||||
#include "ShadowLayerParent.h"
|
||||
#include "TiledLayerBuffer.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "CompositorParent.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -56,7 +57,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||
compositableParent->GetCompositableHost();
|
||||
|
||||
Layer* layer = compositable ? compositable->GetLayer() : nullptr;
|
||||
ShadowLayer* shadowLayer = layer ? layer->AsShadowLayer() : nullptr;
|
||||
LayerComposite* shadowLayer = layer ? layer->AsLayerComposite() : nullptr;
|
||||
if (shadowLayer) {
|
||||
Compositor* compositor = static_cast<LayerManagerComposite*>(layer->Manager())->GetCompositor();
|
||||
compositable->SetCompositor(compositor);
|
||||
|
@ -109,8 +110,8 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||
CompositableParent* compositableParent = static_cast<CompositableParent*>(op.compositableParent());
|
||||
CompositableHost* compositable =
|
||||
compositableParent->GetCompositableHost();
|
||||
ShadowThebesLayer* thebes =
|
||||
static_cast<ShadowThebesLayer*>(compositable->GetLayer());
|
||||
ThebesLayerComposite* thebes =
|
||||
static_cast<ThebesLayerComposite*>(compositable->GetLayer());
|
||||
|
||||
const ThebesBufferData& bufferData = op.bufferData();
|
||||
|
||||
|
|
|
@ -403,9 +403,9 @@ void
|
|||
CompositorParent::NotifyShadowTreeTransaction()
|
||||
{
|
||||
if (mLayerManager) {
|
||||
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
|
||||
if (shadow) {
|
||||
shadow->NotifyShadowTreeTransaction();
|
||||
LayerManagerComposite* managerComposite = mLayerManager->AsLayerManagerComposite();
|
||||
if (managerComposite) {
|
||||
managerComposite->NotifyShadowTreeTransaction();
|
||||
}
|
||||
}
|
||||
ScheduleComposition();
|
||||
|
@ -662,14 +662,14 @@ CompositorParent::TransformFixedLayers(Layer* aLayer,
|
|||
layerTransform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
||||
1.0f/aLayer->GetPostYScale(),
|
||||
1);
|
||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
||||
shadow->SetShadowTransform(layerTransform);
|
||||
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||
layerComposite->SetShadowTransform(layerTransform);
|
||||
|
||||
const nsIntRect* clipRect = aLayer->GetClipRect();
|
||||
if (clipRect) {
|
||||
nsIntRect transformedClipRect(*clipRect);
|
||||
transformedClipRect.MoveBy(translation.x, translation.y);
|
||||
shadow->SetShadowClipRect(&transformedClipRect);
|
||||
layerComposite->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 shadow layer tree, setting properties to match their non-shadow
|
||||
// counterparts.
|
||||
// Go down the composite layer tree, setting properties to match their
|
||||
// content-side counterparts.
|
||||
static void
|
||||
SetShadowProperties(Layer* aLayer)
|
||||
{
|
||||
// FIXME: Bug 717688 -- Do these updates in LayerTransactionParent::RecvUpdate.
|
||||
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());
|
||||
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());
|
||||
|
||||
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);
|
||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
||||
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||
switch (animation.property()) {
|
||||
case eCSSProperty_opacity:
|
||||
{
|
||||
shadow->SetShadowOpacity(interpolatedValue.get_float());
|
||||
layerComposite->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");
|
||||
shadow->SetShadowTransform(matrix);
|
||||
layerComposite->SetShadowTransform(matrix);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -843,7 +843,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
|
|||
}
|
||||
|
||||
if (AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController()) {
|
||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
||||
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||
|
||||
ViewTransform treeTransform;
|
||||
*aWantNextFrame |=
|
||||
|
@ -861,7 +861,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
|
|||
transform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
||||
1.0f/aLayer->GetPostYScale(),
|
||||
1);
|
||||
shadow->SetShadowTransform(transform);
|
||||
layerComposite->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)
|
||||
{
|
||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
||||
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||
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);
|
||||
shadow->SetShadowTransform(computedTransform);
|
||||
layerComposite->SetShadowTransform(computedTransform);
|
||||
TransformFixedLayers(aLayer, offset, scaleDiff, fixedLayerMargins);
|
||||
}
|
||||
|
||||
|
@ -1063,9 +1063,9 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
|||
SetShadowProperties(root);
|
||||
}
|
||||
ScheduleComposition();
|
||||
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
|
||||
if (shadow) {
|
||||
shadow->NotifyShadowTreeTransaction();
|
||||
LayerManagerComposite *layerComposite = mLayerManager->AsLayerManagerComposite();
|
||||
if (layerComposite) {
|
||||
layerComposite->NotifyShadowTreeTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ CompositorParent::AllocPLayerTransaction(const LayersBackend& aBackendHint,
|
|||
nsRefPtr<LayerManager> layerManager = new BasicShadowLayerManager(mWidget);
|
||||
mWidget = NULL;
|
||||
mLayerManager = layerManager;
|
||||
ShadowLayerManager* slm = layerManager->AsShadowManager();
|
||||
LayerManagerComposite* slm = layerManager->AsLayerManagerComposite();
|
||||
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->AsShadowManager(), this, aId);
|
||||
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, aId);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "ShadowLayersManager.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
class nsIWidget;
|
||||
|
||||
namespace base {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#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;
|
||||
|
|
|
@ -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.
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
#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;
|
||||
|
||||
|
@ -47,13 +52,13 @@ cast(const PCompositableParent* in)
|
|||
|
||||
template<class OpCreateT>
|
||||
static ShadowLayerParent*
|
||||
AsShadowLayer(const OpCreateT& op)
|
||||
AsLayerComposite(const OpCreateT& op)
|
||||
{
|
||||
return cast(op.layerParent());
|
||||
}
|
||||
|
||||
static ShadowLayerParent*
|
||||
AsShadowLayer(const OpSetRoot& op)
|
||||
AsLayerComposite(const OpSetRoot& op)
|
||||
{
|
||||
return cast(op.rootParent());
|
||||
}
|
||||
|
@ -125,7 +130,7 @@ ShadowChild(const OpRaiseToTopChild& op)
|
|||
|
||||
//--------------------------------------------------
|
||||
// LayerTransactionParent
|
||||
LayerTransactionParent::LayerTransactionParent(ShadowLayerManager* aManager,
|
||||
LayerTransactionParent::LayerTransactionParent(LayerManagerComposite* aManager,
|
||||
ShadowLayersManager* aLayersManager,
|
||||
uint64_t aId)
|
||||
: mLayerManager(aManager)
|
||||
|
@ -189,47 +194,47 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
case Edit::TOpCreateThebesLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
||||
|
||||
nsRefPtr<ShadowThebesLayer> layer =
|
||||
layer_manager()->CreateShadowThebesLayer();
|
||||
AsShadowLayer(edit.get_OpCreateThebesLayer())->Bind(layer);
|
||||
nsRefPtr<ThebesLayerComposite> layer =
|
||||
layer_manager()->CreateThebesLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateContainerLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
|
||||
|
||||
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateShadowContainerLayer();
|
||||
AsShadowLayer(edit.get_OpCreateContainerLayer())->Bind(layer);
|
||||
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateContainerLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateContainerLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateImageLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
|
||||
|
||||
nsRefPtr<ShadowImageLayer> layer =
|
||||
layer_manager()->CreateShadowImageLayer();
|
||||
AsShadowLayer(edit.get_OpCreateImageLayer())->Bind(layer);
|
||||
nsRefPtr<ImageLayerComposite> layer =
|
||||
layer_manager()->CreateImageLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateImageLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateColorLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
|
||||
|
||||
nsRefPtr<ShadowColorLayer> layer = layer_manager()->CreateShadowColorLayer();
|
||||
AsShadowLayer(edit.get_OpCreateColorLayer())->Bind(layer);
|
||||
nsRefPtr<ColorLayerComposite> layer = layer_manager()->CreateColorLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateColorLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateCanvasLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
|
||||
|
||||
nsRefPtr<ShadowCanvasLayer> layer =
|
||||
layer_manager()->CreateShadowCanvasLayer();
|
||||
AsShadowLayer(edit.get_OpCreateCanvasLayer())->Bind(layer);
|
||||
nsRefPtr<CanvasLayerComposite> layer =
|
||||
layer_manager()->CreateCanvasLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateCanvasLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateRefLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
|
||||
|
||||
nsRefPtr<ShadowRefLayer> layer =
|
||||
layer_manager()->CreateShadowRefLayer();
|
||||
AsShadowLayer(edit.get_OpCreateRefLayer())->Bind(layer);
|
||||
nsRefPtr<RefLayerComposite> layer =
|
||||
layer_manager()->CreateRefLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateRefLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -238,7 +243,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
|
||||
|
||||
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
||||
Layer* layer = AsShadowLayer(osla)->AsLayer();
|
||||
Layer* layer = AsLayerComposite(osla)->AsLayer();
|
||||
const LayerAttributes& attrs = osla.attrs();
|
||||
|
||||
const CommonLayerAttributes& common = attrs.common();
|
||||
|
@ -267,8 +272,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
case Specific::TThebesLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
||||
|
||||
ShadowThebesLayer* thebesLayer =
|
||||
static_cast<ShadowThebesLayer*>(layer);
|
||||
ThebesLayerComposite* thebesLayer =
|
||||
static_cast<ThebesLayerComposite*>(layer);
|
||||
const ThebesLayerAttributes& attrs =
|
||||
specific.get_ThebesLayerAttributes();
|
||||
|
||||
|
@ -300,7 +305,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
|
||||
static_cast<CanvasLayer*>(layer)->SetFilter(
|
||||
specific.get_CanvasLayerAttributes().filter());
|
||||
static_cast<ShadowCanvasLayer*>(layer)->SetBounds(
|
||||
static_cast<CanvasLayerComposite*>(layer)->SetBounds(
|
||||
specific.get_CanvasLayerAttributes().bounds());
|
||||
break;
|
||||
|
||||
|
@ -328,7 +333,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
case Edit::TOpSetRoot: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
|
||||
|
||||
mRoot = AsShadowLayer(edit.get_OpSetRoot())->AsContainer();
|
||||
mRoot = AsLayerComposite(edit.get_OpSetRoot())->AsContainer();
|
||||
break;
|
||||
}
|
||||
case Edit::TOpInsertAfter: {
|
||||
|
@ -406,7 +411,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.
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
||||
|
||||
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
|
||||
|
||||
|
@ -423,7 +428,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
void
|
||||
LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable)
|
||||
{
|
||||
ShadowLayer* layer = aLayerParent->AsLayer()->AsShadowLayer();
|
||||
LayerComposite* layer = aLayerParent->AsLayer()->AsLayerComposite();
|
||||
MOZ_ASSERT(layer);
|
||||
LayerComposite* layerComposite = aLayerParent->AsLayer()->AsLayerComposite();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class RenderFrameParent;
|
|||
namespace layers {
|
||||
|
||||
class Layer;
|
||||
class ShadowLayerManager;
|
||||
class LayerManagerComposite;
|
||||
class ShadowLayerParent;
|
||||
class CompositableParent;
|
||||
|
||||
|
@ -34,14 +34,14 @@ class LayerTransactionParent : public PLayerTransactionParent,
|
|||
typedef InfallibleTArray<EditReply> EditReplyArray;
|
||||
|
||||
public:
|
||||
LayerTransactionParent(ShadowLayerManager* aManager,
|
||||
LayerTransactionParent(LayerManagerComposite* aManager,
|
||||
ShadowLayersManager* aLayersManager,
|
||||
uint64_t aId);
|
||||
~LayerTransactionParent();
|
||||
|
||||
void Destroy();
|
||||
|
||||
ShadowLayerManager* layer_manager() const { return mLayerManager; }
|
||||
LayerManagerComposite* layer_manager() const { return mLayerManager; }
|
||||
|
||||
uint64_t GetId() const { return mId; }
|
||||
ContainerLayer* GetRoot() const { return mRoot; }
|
||||
|
@ -92,7 +92,7 @@ protected:
|
|||
void Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable);
|
||||
|
||||
private:
|
||||
nsRefPtr<ShadowLayerManager> mLayerManager;
|
||||
nsRefPtr<LayerManagerComposite> mLayerManager;
|
||||
ShadowLayersManager* mShadowLayersManager;
|
||||
// Hold the root because it might be grafted under various
|
||||
// containers in the "real" layer tree
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <d3d10_1.h>
|
||||
#include <dxgi.h>
|
||||
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/PLayerTransaction.h"
|
||||
#include "ShadowLayers.h"
|
||||
|
||||
|
@ -78,21 +79,21 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|||
}
|
||||
|
||||
/*static*/ already_AddRefed<TextureImage>
|
||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
ShadowLayerManager::SupportsDirectTexturing()
|
||||
LayerManagerComposite::SupportsDirectTexturing()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*static*/ void
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#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"
|
||||
|
||||
|
@ -220,11 +222,11 @@ GrallocBufferActor::Create(const gfxIntSize& aSize,
|
|||
}
|
||||
|
||||
/*static*/ already_AddRefed<TextureImage>
|
||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
||||
const SurfaceDescriptor& aDescriptor,
|
||||
GLenum aWrapMode)
|
||||
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
||||
const SurfaceDescriptor& aDescriptor,
|
||||
GLenum aWrapMode)
|
||||
{
|
||||
PROFILER_LABEL("ShadowLayerManager", "OpenDescriptorForDirectTexturing");
|
||||
PROFILER_LABEL("LayerManagerComposite", "OpenDescriptorForDirectTexturing");
|
||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -233,13 +235,13 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
|||
}
|
||||
|
||||
/*static*/ bool
|
||||
ShadowLayerManager::SupportsDirectTexturing()
|
||||
LayerManagerComposite::SupportsDirectTexturing()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*static*/ void
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||
{
|
||||
// Nothing to be done for gralloc.
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class GrallocBufferActor : public PGrallocBufferChild
|
|||
, public PGrallocBufferParent
|
||||
{
|
||||
friend class ShadowLayerForwarder;
|
||||
friend class ShadowLayerManager;
|
||||
friend class LayerManagerComposite;
|
||||
friend class ImageBridgeChild;
|
||||
typedef android::GraphicBuffer GraphicBuffer;
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
#include "mozilla/layers/PLayerTransaction.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
|
@ -72,7 +74,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|||
}
|
||||
|
||||
/*static*/ void
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -83,15 +85,15 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|||
}
|
||||
|
||||
/*static*/ already_AddRefed<TextureImage>
|
||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
ShadowLayerManager::SupportsDirectTexturing()
|
||||
LayerManagerComposite::SupportsDirectTexturing()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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"
|
||||
|
@ -184,7 +187,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|||
}
|
||||
|
||||
/*static*/ void
|
||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||
{
|
||||
if (UsingXCompositing()) {
|
||||
// If we're using X surfaces, we need to finish all pending
|
||||
|
@ -197,16 +200,16 @@ ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
|||
}
|
||||
|
||||
/*static*/ already_AddRefed<TextureImage>
|
||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||
const SurfaceDescriptor&,
|
||||
GLenum)
|
||||
{
|
||||
// FIXME/bug XXXXXX: implement this using texture-from-pixmap
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
ShadowLayerManager::SupportsDirectTexturing()
|
||||
LayerManagerComposite::SupportsDirectTexturing()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -591,25 +591,6 @@ 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,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "mozilla/layers/ISurfaceAllocator.h"
|
||||
#include "mozilla/dom/ScreenOrientation.h"
|
||||
#include "mozilla/layers/CompositableForwarder.h"
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
|
||||
class gfxSharedImageSurface;
|
||||
|
||||
|
@ -38,12 +39,12 @@ class PLayerChild;
|
|||
class PLayerTransactionChild;
|
||||
class PLayerTransactionParent;
|
||||
class ShadowableLayer;
|
||||
class ShadowThebesLayer;
|
||||
class ShadowContainerLayer;
|
||||
class ShadowImageLayer;
|
||||
class ShadowColorLayer;
|
||||
class ShadowCanvasLayer;
|
||||
class ShadowRefLayer;
|
||||
class ThebesLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class ColorLayerComposite;
|
||||
class CanvasLayerComposite;
|
||||
class RefLayerComposite;
|
||||
class SurfaceDescriptor;
|
||||
class ThebesBuffer;
|
||||
class TiledLayerComposer;
|
||||
|
@ -57,12 +58,6 @@ 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
|
||||
|
@ -91,13 +86,13 @@ enum OpenMode {
|
|||
* parent context. This comprises recording layer-tree modifications
|
||||
* into atomic transactions and pushing them over IPC.
|
||||
*
|
||||
* ShadowLayerManager grafts layer subtrees published by child-context
|
||||
* LayerManagerComposite 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 ShadowLayerManagers and
|
||||
* LayerManagers may be both LayerManagerComposites and
|
||||
* ShadowLayerForwarders.)
|
||||
*
|
||||
* There are only shadow types for layers that have different shadow
|
||||
|
@ -128,7 +123,7 @@ enum OpenMode {
|
|||
* 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
|
||||
* ShadowLayer in a coherent state.
|
||||
* LayerComposite 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.
|
||||
|
@ -186,7 +181,7 @@ public:
|
|||
|
||||
/**
|
||||
* Begin recording a transaction to be forwarded atomically to a
|
||||
* ShadowLayerManager.
|
||||
* LayerManagerComposite.
|
||||
*/
|
||||
void BeginTransaction(const nsIntRect& aTargetBounds,
|
||||
ScreenRotation aRotation,
|
||||
|
@ -293,8 +288,8 @@ public:
|
|||
const nsIntRect& aRect);
|
||||
|
||||
/**
|
||||
* End the current transaction and forward it to ShadowLayerManager.
|
||||
* |aReplies| are directions from the ShadowLayerManager to the
|
||||
* End the current transaction and forward it to LayerManagerComposite.
|
||||
* |aReplies| are directions from the LayerManagerComposite to the
|
||||
* caller of EndTransaction().
|
||||
*/
|
||||
bool EndTransaction(InfallibleTArray<EditReply>* aReplies);
|
||||
|
@ -308,7 +303,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* True if this is forwarding to a ShadowLayerManager.
|
||||
* True if this is forwarding to a LayerManagerComposite.
|
||||
*/
|
||||
bool HasShadowManager() const { return !!mShadowManager; }
|
||||
PLayerTransactionChild* GetShadowManager() const { return mShadowManager; }
|
||||
|
@ -317,23 +312,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
|
||||
* ShadowLayer IPC system.
|
||||
* LayerComposite 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
|
||||
* ShadowLayer in the other process. The Layer needs a
|
||||
* LayerComposite 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 ShadowLayer,
|
||||
* descriptor. This notification is forwarded to the LayerComposite,
|
||||
* which uses OpenDescriptor() to access the newly-painted pixels.
|
||||
* The ShadowLayer then updates its front buffer in a Layer- and
|
||||
* The LayerComposite 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.
|
||||
*
|
||||
|
@ -342,7 +337,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
|
||||
* ShadowLayer also calls DestroySharedSurface() on its front
|
||||
* LayerComposite also calls DestroySharedSurface() on its front
|
||||
* buffer, and the double-buffer pair is gone.
|
||||
*/
|
||||
|
||||
|
@ -357,7 +352,7 @@ public:
|
|||
|
||||
/**
|
||||
* Construct a shadow of |aLayer| on the "other side", at the
|
||||
* ShadowLayerManager.
|
||||
* LayerManagerComposite.
|
||||
*/
|
||||
PLayerChild* ConstructShadowFor(ShadowableLayer* aLayer);
|
||||
|
||||
|
@ -432,66 +427,6 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -526,199 +461,6 @@ 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
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ EXPORTS += [
|
|||
'BasicTiledThebesLayer.h',
|
||||
'BasicThebesLayer.h',
|
||||
'CompositableHost.h',
|
||||
'LayerManagerComposite.h',
|
||||
'Composer2D.h',
|
||||
'GonkIOSurfaceImage.h',
|
||||
'FrameMetrics.h',
|
||||
|
@ -62,11 +61,14 @@ 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',
|
||||
|
@ -80,12 +82,14 @@ 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',
|
||||
|
@ -96,6 +100,7 @@ EXPORTS.mozilla.layers += [
|
|||
'TextureHost.h',
|
||||
'TextureClientOGL.h',
|
||||
'TextureHostOGL.h',
|
||||
'ThebesLayerComposite.h',
|
||||
'TiledContentClient.h',
|
||||
]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "GLManager.h"
|
||||
#include "LayerManagerOGL.h"
|
||||
#include "CompositorOGL.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "GLContext.h"
|
||||
|
||||
using namespace mozilla::gl;
|
||||
|
|
|
@ -32,11 +32,11 @@ namespace layers {
|
|||
|
||||
class Composer2D;
|
||||
class LayerOGL;
|
||||
class ShadowThebesLayer;
|
||||
class ShadowContainerLayer;
|
||||
class ShadowImageLayer;
|
||||
class ShadowCanvasLayer;
|
||||
class ShadowColorLayer;
|
||||
class ThebesLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class CanvasLayerComposite;
|
||||
class ColorLayerComposite;
|
||||
struct FPSState;
|
||||
|
||||
/**
|
||||
|
|
|
@ -254,7 +254,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader,
|
|||
float aTempScaleDiffX = 1.0,
|
||||
float aTempScaleDiffY = 1.0)
|
||||
{
|
||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
||||
LayerComposite* shadow = aLayer->AsLayerComposite();
|
||||
shadow->SetShadowClipRect(aLayer->GetClipRect());
|
||||
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
|
||||
shadow->SetShadowOpacity(aLayer->GetOpacity());
|
||||
|
@ -435,7 +435,7 @@ BuildBackgroundPatternFor(ContainerLayer* aContainer,
|
|||
LayerManager* aManager,
|
||||
nsIFrame* aFrame)
|
||||
{
|
||||
ShadowLayer* shadowRoot = aShadowRoot->AsShadowLayer();
|
||||
LayerComposite* shadowRoot = aShadowRoot->AsLayerComposite();
|
||||
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->AsShadowManager()) {
|
||||
if (lm && lm->AsLayerManagerComposite()) {
|
||||
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
||||
} else {
|
||||
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
|
||||
|
@ -853,7 +853,7 @@ RenderFrameParent::AllocPLayerTransaction()
|
|||
return nullptr;
|
||||
}
|
||||
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
||||
return new LayerTransactionParent(lm->AsShadowManager(), this, 0);
|
||||
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, 0);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -39,7 +39,7 @@ using mozilla::unused;
|
|||
#include "Layers.h"
|
||||
#include "BasicLayers.h"
|
||||
#include "LayerManagerOGL.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "GLContext.h"
|
||||
#include "GLContextProvider.h"
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#include "nsRegion.h"
|
||||
#include "Layers.h"
|
||||
#include "LayerManagerOGL.h"
|
||||
#include "LayerManagerComposite.h"
|
||||
#include "mozilla/layers/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->AsShadowManager()) {
|
||||
layerManager->AsLayerManagerComposite()) {
|
||||
if (!mDidForceRefreshOpenGL) {
|
||||
[self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
|
||||
mDidForceRefreshOpenGL = YES;
|
||||
|
|
Загрузка…
Ссылка в новой задаче