Bug 856079 - Merge ShadowLayer and LayerComposite (keeping the later). r=nrc
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
* # Main interfaces and abstractions
|
* # Main interfaces and abstractions
|
||||||
*
|
*
|
||||||
* - Layer, ShadowableLayer and ShadowLayer
|
* - Layer, ShadowableLayer and LayerComposite
|
||||||
* (see Layers.h and ipc/ShadowLayers.h)
|
* (see Layers.h and ipc/ShadowLayers.h)
|
||||||
* - CompositableClient and CompositableHost
|
* - CompositableClient and CompositableHost
|
||||||
* (client/CompositableClient.h composite/CompositableHost.h)
|
* (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 layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
|
|
||||||
#include "mozilla/layers/PLayerTransaction.h"
|
#include "mozilla/layers/PLayerTransaction.h"
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
#include "ImageLayers.h"
|
#include "ImageLayers.h"
|
||||||
@@ -460,7 +460,7 @@ Layer::CanUseOpaqueSurface()
|
|||||||
const nsIntRect*
|
const nsIntRect*
|
||||||
Layer::GetEffectiveClipRect()
|
Layer::GetEffectiveClipRect()
|
||||||
{
|
{
|
||||||
if (ShadowLayer* shadow = AsShadowLayer()) {
|
if (LayerComposite* shadow = AsLayerComposite()) {
|
||||||
return shadow->GetShadowClipRect();
|
return shadow->GetShadowClipRect();
|
||||||
}
|
}
|
||||||
return GetClipRect();
|
return GetClipRect();
|
||||||
@@ -469,7 +469,7 @@ Layer::GetEffectiveClipRect()
|
|||||||
const nsIntRegion&
|
const nsIntRegion&
|
||||||
Layer::GetEffectiveVisibleRegion()
|
Layer::GetEffectiveVisibleRegion()
|
||||||
{
|
{
|
||||||
if (ShadowLayer* shadow = AsShadowLayer()) {
|
if (LayerComposite* shadow = AsLayerComposite()) {
|
||||||
return shadow->GetShadowVisibleRegion();
|
return shadow->GetShadowVisibleRegion();
|
||||||
}
|
}
|
||||||
return GetVisibleRegion();
|
return GetVisibleRegion();
|
||||||
@@ -640,7 +640,7 @@ const gfx3DMatrix
|
|||||||
Layer::GetLocalTransform()
|
Layer::GetLocalTransform()
|
||||||
{
|
{
|
||||||
gfx3DMatrix transform;
|
gfx3DMatrix transform;
|
||||||
if (ShadowLayer* shadow = AsShadowLayer())
|
if (LayerComposite* shadow = AsLayerComposite())
|
||||||
transform = shadow->GetShadowTransform();
|
transform = shadow->GetShadowTransform();
|
||||||
else
|
else
|
||||||
transform = mTransform;
|
transform = mTransform;
|
||||||
@@ -665,7 +665,7 @@ Layer::ApplyPendingUpdatesForThisTransaction()
|
|||||||
const float
|
const float
|
||||||
Layer::GetLocalOpacity()
|
Layer::GetLocalOpacity()
|
||||||
{
|
{
|
||||||
if (ShadowLayer* shadow = AsShadowLayer())
|
if (LayerComposite* shadow = AsLayerComposite())
|
||||||
return shadow->GetShadowOpacity();
|
return shadow->GetShadowOpacity();
|
||||||
return mOpacity;
|
return mOpacity;
|
||||||
}
|
}
|
||||||
@@ -975,7 +975,7 @@ LayerManager::BeginTabSwitch()
|
|||||||
|
|
||||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||||
|
|
||||||
static nsACString& PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer);
|
static nsACString& PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite);
|
||||||
|
|
||||||
#ifdef MOZ_DUMP_PAINTING
|
#ifdef MOZ_DUMP_PAINTING
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -1101,7 +1101,7 @@ Layer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
|||||||
aTo += aPrefix;
|
aTo += aPrefix;
|
||||||
aTo += nsPrintfCString("%s%s (0x%p)", mManager->Name(), Name(), this);
|
aTo += nsPrintfCString("%s%s (0x%p)", mManager->Name(), Name(), this);
|
||||||
|
|
||||||
::PrintInfo(aTo, AsShadowLayer());
|
::PrintInfo(aTo, AsLayerComposite());
|
||||||
|
|
||||||
if (mUseClipRect) {
|
if (mUseClipRect) {
|
||||||
AppendToString(aTo, mClipRect, " [clip=", "]");
|
AppendToString(aTo, mClipRect, " [clip=", "]");
|
||||||
@@ -1312,19 +1312,19 @@ LayerManager::IsLogEnabled()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsACString&
|
static nsACString&
|
||||||
PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
|
PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite)
|
||||||
{
|
{
|
||||||
if (!aShadowLayer) {
|
if (!aLayerComposite) {
|
||||||
return aTo;
|
return aTo;
|
||||||
}
|
}
|
||||||
if (const nsIntRect* clipRect = aShadowLayer->GetShadowClipRect()) {
|
if (const nsIntRect* clipRect = aLayerComposite->GetShadowClipRect()) {
|
||||||
AppendToString(aTo, *clipRect, " [shadow-clip=", "]");
|
AppendToString(aTo, *clipRect, " [shadow-clip=", "]");
|
||||||
}
|
}
|
||||||
if (!aShadowLayer->GetShadowTransform().IsIdentity()) {
|
if (!aLayerComposite->GetShadowTransform().IsIdentity()) {
|
||||||
AppendToString(aTo, aShadowLayer->GetShadowTransform(), " [shadow-transform=", "]");
|
AppendToString(aTo, aLayerComposite->GetShadowTransform(), " [shadow-transform=", "]");
|
||||||
}
|
}
|
||||||
if (!aShadowLayer->GetShadowVisibleRegion().IsEmpty()) {
|
if (!aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
|
||||||
AppendToString(aTo, aShadowLayer->GetShadowVisibleRegion(), " [shadow-visible=", "]");
|
AppendToString(aTo, aLayerComposite->GetShadowVisibleRegion(), " [shadow-visible=", "]");
|
||||||
}
|
}
|
||||||
return aTo;
|
return aTo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ class CanvasLayer;
|
|||||||
class ReadbackLayer;
|
class ReadbackLayer;
|
||||||
class ReadbackProcessor;
|
class ReadbackProcessor;
|
||||||
class RefLayer;
|
class RefLayer;
|
||||||
class ShadowLayer;
|
class LayerComposite;
|
||||||
class ShadowableLayer;
|
class ShadowableLayer;
|
||||||
class ShadowLayerForwarder;
|
class ShadowLayerForwarder;
|
||||||
class ShadowLayerManager;
|
class LayerManagerComposite;
|
||||||
class SpecificLayerAttributes;
|
class SpecificLayerAttributes;
|
||||||
class SurfaceDescriptor;
|
class SurfaceDescriptor;
|
||||||
class Compositor;
|
class Compositor;
|
||||||
@@ -168,7 +168,7 @@ public:
|
|||||||
virtual ShadowLayerForwarder* AsShadowForwarder()
|
virtual ShadowLayerForwarder* AsShadowForwarder()
|
||||||
{ return nullptr; }
|
{ return nullptr; }
|
||||||
|
|
||||||
virtual ShadowLayerManager* AsShadowManager()
|
virtual LayerManagerComposite* AsLayerManagerComposite()
|
||||||
{ return nullptr; }
|
{ return nullptr; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1015,10 +1015,10 @@ public:
|
|||||||
virtual ColorLayer* AsColorLayer() { return nullptr; }
|
virtual ColorLayer* AsColorLayer() { return nullptr; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic cast to a ShadowLayer. Return null if this is not a
|
* Dynamic cast to a LayerComposite. Return null if this is not a
|
||||||
* ShadowLayer. Can be used anytime.
|
* 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
|
* Dynamic cast to a ShadowableLayer. Return null if this is not a
|
||||||
@@ -1026,12 +1026,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual ShadowableLayer* AsShadowableLayer() { return nullptr; }
|
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
|
// These getters can be used anytime. They return the effective
|
||||||
// values that should be used when drawing this layer to screen,
|
// values that should be used when drawing this layer to screen,
|
||||||
// accounting for this layer possibly being a shadow.
|
// 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);
|
trans.TransformBounds(rect);
|
||||||
|
|
||||||
if (strcmp(aLayer->Name(), "ContainerLayer") != 0 &&
|
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",
|
printf_stderr("%s RENDERTRACE %u rect #%02X%s %i %i %i %i\n",
|
||||||
aLayer->Name(), (int)PR_IntervalNow(),
|
aLayer->Name(), (int)PR_IntervalNow(),
|
||||||
colorId, aColor,
|
colorId, aColor,
|
||||||
|
|||||||
@@ -1251,7 +1251,7 @@ BasicShadowLayerManager::ForwardTransaction()
|
|||||||
RenderTraceScope rendertrace("Foward Transaction", "000090");
|
RenderTraceScope rendertrace("Foward Transaction", "000090");
|
||||||
mPhase = PHASE_FORWARD;
|
mPhase = PHASE_FORWARD;
|
||||||
|
|
||||||
// forward this transaction's changeset to our ShadowLayerManager
|
// forward this transaction's changeset to our LayerManagerComposite
|
||||||
AutoInfallibleTArray<EditReply, 10> replies;
|
AutoInfallibleTArray<EditReply, 10> replies;
|
||||||
if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies)) {
|
if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies)) {
|
||||||
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
|
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ namespace mozilla {
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class BasicShadowableLayer;
|
class BasicShadowableLayer;
|
||||||
class ShadowThebesLayer;
|
class ThebesLayerComposite;
|
||||||
class ShadowContainerLayer;
|
class ContainerLayerComposite;
|
||||||
class ShadowImageLayer;
|
class ImageLayerComposite;
|
||||||
class ShadowCanvasLayer;
|
class CanvasLayerComposite;
|
||||||
class ShadowColorLayer;
|
class ColorLayerComposite;
|
||||||
class ReadbackProcessor;
|
class ReadbackProcessor;
|
||||||
class ImageFactory;
|
class ImageFactory;
|
||||||
class PaintLayerContext;
|
class PaintLayerContext;
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ protected:
|
|||||||
virtual already_AddRefed<gfxASurface>
|
virtual already_AddRefed<gfxASurface>
|
||||||
CreateBuffer(ContentType, const nsIntRect&, uint32_t, gfxASurface**)
|
CreateBuffer(ContentType, const nsIntRect&, uint32_t, gfxASurface**)
|
||||||
{
|
{
|
||||||
NS_RUNTIMEABORT("ShadowThebesLayer can't paint content");
|
NS_RUNTIMEABORT("ThebesLayerComposite can't paint content");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class CompositableChild;
|
|||||||
*
|
*
|
||||||
* To do in-transaction texture transfer (the default), call
|
* To do in-transaction texture transfer (the default), call
|
||||||
* ShadowLayerForwarder::Attach(CompositableClient*, ShadowableLayer*). This
|
* 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 use for compositing.
|
||||||
*
|
*
|
||||||
* To do async texture transfer (like async-video), the CompositableClient
|
* To do async texture transfer (like async-video), the CompositableClient
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "nsIWidget.h"
|
#include "nsIWidget.h"
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
|
|||||||
if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) {
|
if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (ShadowLayerManager::SupportsDirectTexturing() ||
|
if (LayerManagerComposite::SupportsDirectTexturing() ||
|
||||||
PR_GetEnv("MOZ_FORCE_DOUBLE_BUFFERING")) {
|
PR_GetEnv("MOZ_FORCE_DOUBLE_BUFFERING")) {
|
||||||
return new ContentClientDoubleBuffered(aForwarder);
|
return new ContentClientDoubleBuffered(aForwarder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ class GLContext;
|
|||||||
|
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class PTextureChild;
|
|
||||||
class ContentClient;
|
class ContentClient;
|
||||||
class PlanarYCbCrImage;
|
class PlanarYCbCrImage;
|
||||||
class Image;
|
class Image;
|
||||||
class PTextureChild;
|
|
||||||
class CompositableForwarder;
|
class CompositableForwarder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ using namespace mozilla;
|
|||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
|
|
||||||
CanvasLayerComposite::CanvasLayerComposite(LayerManagerComposite* aManager)
|
CanvasLayerComposite::CanvasLayerComposite(LayerManagerComposite* aManager)
|
||||||
: ShadowCanvasLayer(aManager, nullptr)
|
: CanvasLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
, mImageHost(nullptr)
|
, mImageHost(nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define GFX_CanvasLayerComposite_H
|
#define GFX_CanvasLayerComposite_H
|
||||||
|
|
||||||
|
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "gfxASurface.h"
|
#include "gfxASurface.h"
|
||||||
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
|
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
|
||||||
#include "mozilla/X11Util.h"
|
#include "mozilla/X11Util.h"
|
||||||
@@ -20,14 +20,12 @@ namespace layers {
|
|||||||
// canvas is identical to compositing an image.
|
// canvas is identical to compositing an image.
|
||||||
class ImageHost;
|
class ImageHost;
|
||||||
|
|
||||||
// NB: eventually we'll have separate shadow canvas2d and shadow
|
class CanvasLayerComposite : public CanvasLayer,
|
||||||
// canvas3d layers, but currently they look the same from the
|
|
||||||
// perspective of the compositor process
|
|
||||||
class CanvasLayerComposite : public ShadowCanvasLayer,
|
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CanvasLayerComposite(LayerManagerComposite* aManager);
|
CanvasLayerComposite(LayerManagerComposite* aManager);
|
||||||
|
|
||||||
virtual ~CanvasLayerComposite();
|
virtual ~CanvasLayerComposite();
|
||||||
|
|
||||||
// CanvasLayer impl
|
// CanvasLayer impl
|
||||||
@@ -38,14 +36,6 @@ public:
|
|||||||
|
|
||||||
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
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 SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual void Disconnect() MOZ_OVERRIDE
|
virtual void Disconnect() MOZ_OVERRIDE
|
||||||
@@ -53,7 +43,6 @@ public:
|
|||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// LayerComposite impl
|
|
||||||
virtual Layer* GetLayer() MOZ_OVERRIDE;
|
virtual Layer* GetLayer() MOZ_OVERRIDE;
|
||||||
virtual void RenderLayer(const nsIntPoint& aOffset,
|
virtual void RenderLayer(const nsIntPoint& aOffset,
|
||||||
const nsIntRect& aClipRect) MOZ_OVERRIDE;
|
const nsIntRect& aClipRect) MOZ_OVERRIDE;
|
||||||
@@ -64,6 +53,8 @@ public:
|
|||||||
|
|
||||||
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
|
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
|
||||||
|
|
||||||
|
void SetBounds(nsIntRect aBounds) { mBounds = aBounds; }
|
||||||
|
|
||||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||||
virtual const char* Name() const MOZ_OVERRIDE { return "CanvasLayerComposite"; }
|
virtual const char* Name() const MOZ_OVERRIDE { return "CanvasLayerComposite"; }
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,18 @@
|
|||||||
#include "mozilla/layers/PLayerTransaction.h"
|
#include "mozilla/layers/PLayerTransaction.h"
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
|
|
||||||
class ColorLayerComposite : public ShadowColorLayer,
|
class ColorLayerComposite : public ColorLayer,
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColorLayerComposite(LayerManagerComposite *aManager)
|
ColorLayerComposite(LayerManagerComposite *aManager)
|
||||||
: ShadowColorLayer(aManager, nullptr)
|
: ColorLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(ColorLayerComposite);
|
MOZ_COUNT_CTOR(ColorLayerComposite);
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ ContainerRender(ContainerT* aContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContainerLayerComposite::ContainerLayerComposite(LayerManagerComposite *aManager)
|
ContainerLayerComposite::ContainerLayerComposite(LayerManagerComposite *aManager)
|
||||||
: ShadowContainerLayer(aManager, nullptr)
|
: ContainerLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(ContainerLayerComposite);
|
MOZ_COUNT_CTOR(ContainerLayerComposite);
|
||||||
@@ -329,7 +329,7 @@ ContainerLayerComposite::CleanupResources()
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
|
RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
|
||||||
: ShadowRefLayer(aManager, nullptr)
|
: RefLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
{
|
{
|
||||||
mImplData = static_cast<LayerComposite*>(this);
|
mImplData = static_cast<LayerComposite*>(this);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
|
||||||
#include "Layers.h"
|
#include "Layers.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "mozilla/layers/Effects.h"
|
#include "mozilla/layers/Effects.h"
|
||||||
|
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class ContainerLayerComposite : public ShadowContainerLayer,
|
class ContainerLayerComposite : public ContainerLayer,
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
template<class ContainerT>
|
template<class ContainerT>
|
||||||
@@ -29,6 +29,7 @@ class ContainerLayerComposite : public ShadowContainerLayer,
|
|||||||
const nsIntRect& aClipRect);
|
const nsIntRect& aClipRect);
|
||||||
public:
|
public:
|
||||||
ContainerLayerComposite(LayerManagerComposite *aManager);
|
ContainerLayerComposite(LayerManagerComposite *aManager);
|
||||||
|
|
||||||
~ContainerLayerComposite();
|
~ContainerLayerComposite();
|
||||||
|
|
||||||
void InsertAfter(Layer* aChild, Layer* aAfter);
|
void InsertAfter(Layer* aChild, Layer* aAfter);
|
||||||
@@ -64,7 +65,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class RefLayerComposite : public ShadowRefLayer,
|
class RefLayerComposite : public RefLayer,
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
template<class ContainerT>
|
template<class ContainerT>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define MOZILLA_GFX_IMAGEHOST_H
|
#define MOZILLA_GFX_IMAGEHOST_H
|
||||||
|
|
||||||
#include "CompositableHost.h"
|
#include "CompositableHost.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace mozilla {
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
ImageLayerComposite::ImageLayerComposite(LayerManagerComposite* aManager)
|
ImageLayerComposite::ImageLayerComposite(LayerManagerComposite* aManager)
|
||||||
: ShadowImageLayer(aManager, nullptr)
|
: ImageLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
, mImageHost(nullptr)
|
, mImageHost(nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "mozilla/layers/PLayerTransaction.h"
|
#include "mozilla/layers/PLayerTransaction.h"
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "ImageLayers.h"
|
#include "ImageLayers.h"
|
||||||
#include "mozilla/Mutex.h"
|
#include "mozilla/Mutex.h"
|
||||||
|
|
||||||
@@ -18,24 +18,18 @@ namespace layers {
|
|||||||
|
|
||||||
class ImageHost;
|
class ImageHost;
|
||||||
|
|
||||||
class ImageLayerComposite : public ShadowImageLayer,
|
class ImageLayerComposite : public ImageLayer,
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
typedef gl::TextureImage TextureImage;
|
typedef gl::TextureImage TextureImage;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ImageLayerComposite(LayerManagerComposite* aManager);
|
ImageLayerComposite(LayerManagerComposite* aManager);
|
||||||
|
|
||||||
virtual ~ImageLayerComposite();
|
virtual ~ImageLayerComposite();
|
||||||
|
|
||||||
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
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 Disconnect() MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual void SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
|
virtual void SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// typedefs conflicts.
|
// typedefs conflicts.
|
||||||
#include "mozilla/Util.h"
|
#include "mozilla/Util.h"
|
||||||
|
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "ThebesLayerComposite.h"
|
#include "ThebesLayerComposite.h"
|
||||||
#include "ContainerLayerComposite.h"
|
#include "ContainerLayerComposite.h"
|
||||||
#include "ImageLayerComposite.h"
|
#include "ImageLayerComposite.h"
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/layers/ImageHost.h"
|
#include "mozilla/layers/ImageHost.h"
|
||||||
#include "mozilla/layers/ContentHost.h"
|
#include "mozilla/layers/ContentHost.h"
|
||||||
|
#include "mozilla/layers/Compositor.h"
|
||||||
|
|
||||||
#include "gfxContext.h"
|
#include "gfxContext.h"
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
@@ -78,16 +79,20 @@ LayerManagerComposite::ClearCachedResources(Layer* aSubtree)
|
|||||||
// Do we need that?
|
// Do we need that?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LayerManagerComposite
|
* LayerManagerComposite
|
||||||
*/
|
*/
|
||||||
LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
|
LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
|
||||||
|
: mCompositor(aCompositor)
|
||||||
{
|
{
|
||||||
mCompositor = aCompositor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LayerManagerComposite::~LayerManagerComposite()
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
LayerManagerComposite::Initialize()
|
LayerManagerComposite::Initialize()
|
||||||
{
|
{
|
||||||
@@ -543,38 +548,38 @@ LayerManagerComposite::ComputeRenderIntegrity()
|
|||||||
return 1.f;
|
return 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowThebesLayer>
|
already_AddRefed<ThebesLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowThebesLayer()
|
LayerManagerComposite::CreateThebesLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
|
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowContainerLayer>
|
already_AddRefed<ContainerLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowContainerLayer()
|
LayerManagerComposite::CreateContainerLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return nsRefPtr<ContainerLayerComposite>(new ContainerLayerComposite(this)).forget();
|
return nsRefPtr<ContainerLayerComposite>(new ContainerLayerComposite(this)).forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowImageLayer>
|
already_AddRefed<ImageLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowImageLayer()
|
LayerManagerComposite::CreateImageLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return nsRefPtr<ImageLayerComposite>(new ImageLayerComposite(this)).forget();
|
return nsRefPtr<ImageLayerComposite>(new ImageLayerComposite(this)).forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowColorLayer>
|
already_AddRefed<ColorLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowColorLayer()
|
LayerManagerComposite::CreateColorLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (LayerManagerComposite::mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
@@ -583,8 +588,8 @@ LayerManagerComposite::CreateShadowColorLayer()
|
|||||||
return nsRefPtr<ColorLayerComposite>(new ColorLayerComposite(this)).forget();
|
return nsRefPtr<ColorLayerComposite>(new ColorLayerComposite(this)).forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowCanvasLayer>
|
already_AddRefed<CanvasLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowCanvasLayer()
|
LayerManagerComposite::CreateCanvasLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (LayerManagerComposite::mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
@@ -593,8 +598,8 @@ LayerManagerComposite::CreateShadowCanvasLayer()
|
|||||||
return nsRefPtr<CanvasLayerComposite>(new CanvasLayerComposite(this)).forget();
|
return nsRefPtr<CanvasLayerComposite>(new CanvasLayerComposite(this)).forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ShadowRefLayer>
|
already_AddRefed<RefLayerComposite>
|
||||||
LayerManagerComposite::CreateShadowRefLayer()
|
LayerManagerComposite::CreateRefLayerComposite()
|
||||||
{
|
{
|
||||||
if (LayerManagerComposite::mDestroyed) {
|
if (LayerManagerComposite::mDestroyed) {
|
||||||
NS_WARNING("Call on destroyed layer manager");
|
NS_WARNING("Call on destroyed layer manager");
|
||||||
@@ -640,6 +645,18 @@ LayerManagerComposite::CreateDrawTarget(const IntSize &aSize,
|
|||||||
return LayerManager::CreateDrawTarget(aSize, aFormat);
|
return LayerManager::CreateDrawTarget(aSize, aFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LayerComposite::LayerComposite(LayerManagerComposite *aManager)
|
||||||
|
: mCompositeManager(aManager)
|
||||||
|
, mCompositor(aManager->GetCompositor())
|
||||||
|
, mShadowOpacity(1.0)
|
||||||
|
, mDestroyed(false)
|
||||||
|
, mUseShadowClipRect(false)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
LayerComposite::~LayerComposite()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayerComposite::Destroy()
|
LayerComposite::Destroy()
|
||||||
{
|
{
|
||||||
@@ -649,5 +666,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 */
|
} /* layers */
|
||||||
} /* mozilla */
|
} /* mozilla */
|
||||||
|
|||||||
@@ -6,10 +6,9 @@
|
|||||||
#ifndef GFX_LayerManagerComposite_H
|
#ifndef GFX_LayerManagerComposite_H
|
||||||
#define GFX_LayerManagerComposite_H
|
#define GFX_LayerManagerComposite_H
|
||||||
|
|
||||||
#include "mozilla/layers/Compositor.h"
|
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
|
||||||
#include "Composer2D.h"
|
#include "Composer2D.h"
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
|
#include "Layers.h"
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -22,43 +21,23 @@ namespace mozilla {
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class LayerComposite;
|
class LayerComposite;
|
||||||
class ShadowThebesLayer;
|
class ThebesLayerComposite;
|
||||||
class ShadowContainerLayer;
|
class ContainerLayerComposite;
|
||||||
class ShadowImageLayer;
|
class ImageLayerComposite;
|
||||||
class ShadowCanvasLayer;
|
class CanvasLayerComposite;
|
||||||
class ShadowColorLayer;
|
class ColorLayerComposite;
|
||||||
|
class RefLayerComposite;
|
||||||
class CompositableHost;
|
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:
|
public:
|
||||||
LayerManagerComposite(Compositor* aCompositor);
|
LayerManagerComposite(Compositor* aCompositor);
|
||||||
virtual ~LayerManagerComposite()
|
~LayerManagerComposite();
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Destroy();
|
virtual void Destroy() MOZ_OVERRIDE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return True if initialization was succesful, false when it was not.
|
* return True if initialization was succesful, false when it was not.
|
||||||
@@ -82,7 +61,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* LayerManager implementation.
|
* LayerManager implementation.
|
||||||
*/
|
*/
|
||||||
virtual ShadowLayerManager* AsShadowManager() MOZ_OVERRIDE
|
virtual LayerManagerComposite* AsLayerManagerComposite() MOZ_OVERRIDE
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -92,10 +71,7 @@ public:
|
|||||||
void BeginTransaction() MOZ_OVERRIDE;
|
void BeginTransaction() MOZ_OVERRIDE;
|
||||||
void BeginTransactionWithTarget(gfxContext* aTarget) MOZ_OVERRIDE;
|
void BeginTransactionWithTarget(gfxContext* aTarget) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual void NotifyShadowTreeTransaction() MOZ_OVERRIDE
|
void NotifyShadowTreeTransaction();
|
||||||
{
|
|
||||||
mCompositor->NotifyLayersTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||||
@@ -104,20 +80,11 @@ public:
|
|||||||
|
|
||||||
virtual void SetRoot(Layer* aLayer) MOZ_OVERRIDE { mRoot = aLayer; }
|
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;
|
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
|
||||||
|
|
||||||
@@ -126,12 +93,12 @@ public:
|
|||||||
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
|
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
|
||||||
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
|
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
|
||||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
|
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
|
||||||
virtual already_AddRefed<ShadowThebesLayer> CreateShadowThebesLayer() MOZ_OVERRIDE;
|
already_AddRefed<ThebesLayerComposite> CreateThebesLayerComposite();
|
||||||
virtual already_AddRefed<ShadowContainerLayer> CreateShadowContainerLayer() MOZ_OVERRIDE;
|
already_AddRefed<ContainerLayerComposite> CreateContainerLayerComposite();
|
||||||
virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer() MOZ_OVERRIDE;
|
already_AddRefed<ImageLayerComposite> CreateImageLayerComposite();
|
||||||
virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer() MOZ_OVERRIDE;
|
already_AddRefed<ColorLayerComposite> CreateColorLayerComposite();
|
||||||
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer() MOZ_OVERRIDE;
|
already_AddRefed<CanvasLayerComposite> CreateCanvasLayerComposite();
|
||||||
virtual already_AddRefed<ShadowRefLayer> CreateShadowRefLayer() MOZ_OVERRIDE;
|
already_AddRefed<RefLayerComposite> CreateRefLayerComposite();
|
||||||
|
|
||||||
virtual LayersBackend GetBackendType() MOZ_OVERRIDE
|
virtual LayersBackend GetBackendType() MOZ_OVERRIDE
|
||||||
{
|
{
|
||||||
@@ -196,10 +163,7 @@ public:
|
|||||||
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
|
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
|
||||||
mozilla::gfx::SurfaceFormat aFormat) MOZ_OVERRIDE;
|
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
|
* Calculates the 'completeness' of the rendering that intersected with the
|
||||||
@@ -210,6 +174,34 @@ public:
|
|||||||
*/
|
*/
|
||||||
float ComputeRenderIntegrity();
|
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:
|
private:
|
||||||
/** Region we're clipping our current drawing to. */
|
/** Region we're clipping our current drawing to. */
|
||||||
nsIntRegion mClippingRegion;
|
nsIntRegion mClippingRegion;
|
||||||
@@ -247,24 +239,32 @@ private:
|
|||||||
bool mInTransaction;
|
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
|
class LayerComposite
|
||||||
{
|
{
|
||||||
public:
|
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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -289,9 +289,53 @@ public:
|
|||||||
|
|
||||||
virtual TiledLayerComposer* GetTiledLayerComposer() { return nullptr; }
|
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:
|
protected:
|
||||||
|
gfx3DMatrix mShadowTransform;
|
||||||
|
nsIntRegion mShadowVisibleRegion;
|
||||||
|
nsIntRect mShadowClipRect;
|
||||||
LayerManagerComposite* mCompositeManager;
|
LayerManagerComposite* mCompositeManager;
|
||||||
RefPtr<Compositor> mCompositor;
|
RefPtr<Compositor> mCompositor;
|
||||||
|
float mShadowOpacity;
|
||||||
|
bool mUseShadowClipRect;
|
||||||
bool mDestroyed;
|
bool mDestroyed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace mozilla {
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
|
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
|
||||||
: ShadowThebesLayer(aManager, nullptr)
|
: ThebesLayer(aManager, nullptr)
|
||||||
, LayerComposite(aManager)
|
, LayerComposite(aManager)
|
||||||
, mBuffer(nullptr)
|
, mBuffer(nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
|
||||||
#include "Layers.h"
|
#include "Layers.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "base/task.h"
|
#include "base/task.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ namespace layers {
|
|||||||
|
|
||||||
class ContentHost;
|
class ContentHost;
|
||||||
|
|
||||||
class ThebesLayerComposite : public ShadowThebesLayer,
|
class ThebesLayerComposite : public ThebesLayer,
|
||||||
public LayerComposite
|
public LayerComposite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -34,11 +34,6 @@ public:
|
|||||||
|
|
||||||
virtual void Disconnect() MOZ_OVERRIDE;
|
virtual void Disconnect() MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual void SetValidRegion(const nsIntRegion& aRegion) MOZ_OVERRIDE
|
|
||||||
{
|
|
||||||
ShadowThebesLayer::SetValidRegion(aRegion);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
||||||
|
|
||||||
CompositableHost* GetCompositableHost() MOZ_OVERRIDE;
|
CompositableHost* GetCompositableHost() MOZ_OVERRIDE;
|
||||||
@@ -60,10 +55,23 @@ public:
|
|||||||
|
|
||||||
void EnsureTiled() { mRequiresTiledProperties = true; }
|
void EnsureTiled() { mRequiresTiledProperties = true; }
|
||||||
|
|
||||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||||
virtual const char* Name() const MOZ_OVERRIDE { return "ThebesLayerComposite"; }
|
{
|
||||||
|
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:
|
protected:
|
||||||
|
|
||||||
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
#include "mozilla/layers/ContentHost.h"
|
#include "mozilla/layers/ContentHost.h"
|
||||||
#include "ShadowLayerParent.h"
|
#include "ShadowLayerParent.h"
|
||||||
#include "TiledLayerBuffer.h"
|
#include "TiledLayerBuffer.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
|
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||||
#include "CompositorParent.h"
|
#include "CompositorParent.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@@ -56,7 +57,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||||||
compositableParent->GetCompositableHost();
|
compositableParent->GetCompositableHost();
|
||||||
|
|
||||||
Layer* layer = compositable ? compositable->GetLayer() : nullptr;
|
Layer* layer = compositable ? compositable->GetLayer() : nullptr;
|
||||||
ShadowLayer* shadowLayer = layer ? layer->AsShadowLayer() : nullptr;
|
LayerComposite* shadowLayer = layer ? layer->AsLayerComposite() : nullptr;
|
||||||
if (shadowLayer) {
|
if (shadowLayer) {
|
||||||
Compositor* compositor = static_cast<LayerManagerComposite*>(layer->Manager())->GetCompositor();
|
Compositor* compositor = static_cast<LayerManagerComposite*>(layer->Manager())->GetCompositor();
|
||||||
compositable->SetCompositor(compositor);
|
compositable->SetCompositor(compositor);
|
||||||
@@ -106,8 +107,8 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||||||
CompositableParent* compositableParent = static_cast<CompositableParent*>(op.compositableParent());
|
CompositableParent* compositableParent = static_cast<CompositableParent*>(op.compositableParent());
|
||||||
CompositableHost* compositable =
|
CompositableHost* compositable =
|
||||||
compositableParent->GetCompositableHost();
|
compositableParent->GetCompositableHost();
|
||||||
ShadowThebesLayer* thebes =
|
ThebesLayerComposite* thebes =
|
||||||
static_cast<ShadowThebesLayer*>(compositable->GetLayer());
|
static_cast<ThebesLayerComposite*>(compositable->GetLayer());
|
||||||
|
|
||||||
const ThebesBufferData& bufferData = op.bufferData();
|
const ThebesBufferData& bufferData = op.bufferData();
|
||||||
|
|
||||||
|
|||||||
@@ -403,9 +403,9 @@ void
|
|||||||
CompositorParent::NotifyShadowTreeTransaction()
|
CompositorParent::NotifyShadowTreeTransaction()
|
||||||
{
|
{
|
||||||
if (mLayerManager) {
|
if (mLayerManager) {
|
||||||
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
|
LayerManagerComposite* managerComposite = mLayerManager->AsLayerManagerComposite();
|
||||||
if (shadow) {
|
if (managerComposite) {
|
||||||
shadow->NotifyShadowTreeTransaction();
|
managerComposite->NotifyShadowTreeTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScheduleComposition();
|
ScheduleComposition();
|
||||||
@@ -662,14 +662,14 @@ CompositorParent::TransformFixedLayers(Layer* aLayer,
|
|||||||
layerTransform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
layerTransform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
||||||
1.0f/aLayer->GetPostYScale(),
|
1.0f/aLayer->GetPostYScale(),
|
||||||
1);
|
1);
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||||
shadow->SetShadowTransform(layerTransform);
|
layerComposite->SetShadowTransform(layerTransform);
|
||||||
|
|
||||||
const nsIntRect* clipRect = aLayer->GetClipRect();
|
const nsIntRect* clipRect = aLayer->GetClipRect();
|
||||||
if (clipRect) {
|
if (clipRect) {
|
||||||
nsIntRect transformedClipRect(*clipRect);
|
nsIntRect transformedClipRect(*clipRect);
|
||||||
transformedClipRect.MoveBy(translation.x, translation.y);
|
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
|
// 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
|
// Go down the composite layer tree, setting properties to match their
|
||||||
// counterparts.
|
// content-side counterparts.
|
||||||
static void
|
static void
|
||||||
SetShadowProperties(Layer* aLayer)
|
SetShadowProperties(Layer* aLayer)
|
||||||
{
|
{
|
||||||
// FIXME: Bug 717688 -- Do these updates in LayerTransactionParent::RecvUpdate.
|
// FIXME: Bug 717688 -- Do these updates in LayerTransactionParent::RecvUpdate.
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||||
// Set the shadow's base transform to the layer's base transform.
|
// Set the layerComposite's base transform to the layer's base transform.
|
||||||
shadow->SetShadowTransform(aLayer->GetBaseTransform());
|
layerComposite->SetShadowTransform(aLayer->GetBaseTransform());
|
||||||
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
|
layerComposite->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
|
||||||
shadow->SetShadowClipRect(aLayer->GetClipRect());
|
layerComposite->SetShadowClipRect(aLayer->GetClipRect());
|
||||||
shadow->SetShadowOpacity(aLayer->GetOpacity());
|
layerComposite->SetShadowOpacity(aLayer->GetOpacity());
|
||||||
|
|
||||||
for (Layer* child = aLayer->GetFirstChild();
|
for (Layer* child = aLayer->GetFirstChild();
|
||||||
child; child = child->GetNextSibling()) {
|
child; child = child->GetNextSibling()) {
|
||||||
@@ -793,11 +793,11 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint)
|
|||||||
Animatable interpolatedValue;
|
Animatable interpolatedValue;
|
||||||
SampleValue(portion, animation, animData.mStartValues[segmentIndex],
|
SampleValue(portion, animation, animData.mStartValues[segmentIndex],
|
||||||
animData.mEndValues[segmentIndex], &interpolatedValue);
|
animData.mEndValues[segmentIndex], &interpolatedValue);
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||||
switch (animation.property()) {
|
switch (animation.property()) {
|
||||||
case eCSSProperty_opacity:
|
case eCSSProperty_opacity:
|
||||||
{
|
{
|
||||||
shadow->SetShadowOpacity(interpolatedValue.get_float());
|
layerComposite->SetShadowOpacity(interpolatedValue.get_float());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eCSSProperty_transform:
|
case eCSSProperty_transform:
|
||||||
@@ -809,7 +809,7 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint)
|
|||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
NS_ASSERTION(!aLayer->GetIsFixedPosition(), "Can't animate transforms on fixed-position layers");
|
NS_ASSERTION(!aLayer->GetIsFixedPosition(), "Can't animate transforms on fixed-position layers");
|
||||||
shadow->SetShadowTransform(matrix);
|
layerComposite->SetShadowTransform(matrix);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -843,7 +843,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController()) {
|
if (AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController()) {
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||||
|
|
||||||
ViewTransform treeTransform;
|
ViewTransform treeTransform;
|
||||||
*aWantNextFrame |=
|
*aWantNextFrame |=
|
||||||
@@ -861,7 +861,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
|
|||||||
transform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
transform.ScalePost(1.0f/aLayer->GetPostXScale(),
|
||||||
1.0f/aLayer->GetPostYScale(),
|
1.0f/aLayer->GetPostYScale(),
|
||||||
1);
|
1);
|
||||||
shadow->SetShadowTransform(transform);
|
layerComposite->SetShadowTransform(transform);
|
||||||
|
|
||||||
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
|
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
|
||||||
TransformFixedLayers(
|
TransformFixedLayers(
|
||||||
@@ -879,7 +879,7 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
|
|||||||
void
|
void
|
||||||
CompositorParent::TransformScrollableLayer(Layer* aLayer, const gfx3DMatrix& aRootTransform)
|
CompositorParent::TransformScrollableLayer(Layer* aLayer, const gfx3DMatrix& aRootTransform)
|
||||||
{
|
{
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* layerComposite = aLayer->AsLayerComposite();
|
||||||
ContainerLayer* container = aLayer->AsContainerLayer();
|
ContainerLayer* container = aLayer->AsContainerLayer();
|
||||||
|
|
||||||
const FrameMetrics& metrics = container->GetFrameMetrics();
|
const FrameMetrics& metrics = container->GetFrameMetrics();
|
||||||
@@ -991,7 +991,7 @@ CompositorParent::TransformScrollableLayer(Layer* aLayer, const gfx3DMatrix& aRo
|
|||||||
computedTransform.ScalePost(1.0f/container->GetPostXScale(),
|
computedTransform.ScalePost(1.0f/container->GetPostXScale(),
|
||||||
1.0f/container->GetPostYScale(),
|
1.0f/container->GetPostYScale(),
|
||||||
1);
|
1);
|
||||||
shadow->SetShadowTransform(computedTransform);
|
layerComposite->SetShadowTransform(computedTransform);
|
||||||
TransformFixedLayers(aLayer, offset, scaleDiff, fixedLayerMargins);
|
TransformFixedLayers(aLayer, offset, scaleDiff, fixedLayerMargins);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1063,9 +1063,9 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
|||||||
SetShadowProperties(root);
|
SetShadowProperties(root);
|
||||||
}
|
}
|
||||||
ScheduleComposition();
|
ScheduleComposition();
|
||||||
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
|
LayerManagerComposite *layerComposite = mLayerManager->AsLayerManagerComposite();
|
||||||
if (shadow) {
|
if (layerComposite) {
|
||||||
shadow->NotifyShadowTreeTransaction();
|
layerComposite->NotifyShadowTreeTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,7 +1132,7 @@ CompositorParent::AllocPLayerTransaction(const LayersBackend& aBackendHint,
|
|||||||
nsRefPtr<LayerManager> layerManager = new BasicShadowLayerManager(mWidget);
|
nsRefPtr<LayerManager> layerManager = new BasicShadowLayerManager(mWidget);
|
||||||
mWidget = NULL;
|
mWidget = NULL;
|
||||||
mLayerManager = layerManager;
|
mLayerManager = layerManager;
|
||||||
ShadowLayerManager* slm = layerManager->AsShadowManager();
|
LayerManagerComposite* slm = layerManager->AsLayerManagerComposite();
|
||||||
if (!slm) {
|
if (!slm) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1375,7 +1375,7 @@ CrossProcessCompositorParent::AllocPLayerTransaction(const LayersBackend& aBacke
|
|||||||
|
|
||||||
nsRefPtr<LayerManager> lm = sCurrentCompositor->GetLayerManager();
|
nsRefPtr<LayerManager> lm = sCurrentCompositor->GetLayerManager();
|
||||||
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
||||||
return new LayerTransactionParent(lm->AsShadowManager(), this, aId);
|
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, aId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "mozilla/Monitor.h"
|
#include "mozilla/Monitor.h"
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
#include "ShadowLayersManager.h"
|
#include "ShadowLayersManager.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
class nsIWidget;
|
class nsIWidget;
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "mozilla/layers/TextureClient.h"
|
#include "mozilla/layers/TextureClient.h"
|
||||||
#include "mozilla/layers/ImageClient.h"
|
#include "mozilla/layers/ImageClient.h"
|
||||||
#include "mozilla/layers/LayersTypes.h"
|
#include "mozilla/layers/LayersTypes.h"
|
||||||
|
#include "ShadowLayers.h"
|
||||||
|
|
||||||
using namespace base;
|
using namespace base;
|
||||||
using namespace mozilla::ipc;
|
using namespace mozilla::ipc;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ ImageBridgeParent::RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply)
|
|||||||
// Ensure that any pending operations involving back and front
|
// Ensure that any pending operations involving back and front
|
||||||
// buffers have completed, so that neither process stomps on the
|
// buffers have completed, so that neither process stomps on the
|
||||||
// other's buffer contents.
|
// other's buffer contents.
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
#include "TiledLayerBuffer.h"
|
#include "TiledLayerBuffer.h"
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
#include "CompositableHost.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;
|
typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
|
||||||
|
|
||||||
@@ -47,13 +52,13 @@ cast(const PCompositableParent* in)
|
|||||||
|
|
||||||
template<class OpCreateT>
|
template<class OpCreateT>
|
||||||
static ShadowLayerParent*
|
static ShadowLayerParent*
|
||||||
AsShadowLayer(const OpCreateT& op)
|
AsLayerComposite(const OpCreateT& op)
|
||||||
{
|
{
|
||||||
return cast(op.layerParent());
|
return cast(op.layerParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
static ShadowLayerParent*
|
static ShadowLayerParent*
|
||||||
AsShadowLayer(const OpSetRoot& op)
|
AsLayerComposite(const OpSetRoot& op)
|
||||||
{
|
{
|
||||||
return cast(op.rootParent());
|
return cast(op.rootParent());
|
||||||
}
|
}
|
||||||
@@ -125,7 +130,7 @@ ShadowChild(const OpRaiseToTopChild& op)
|
|||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// LayerTransactionParent
|
// LayerTransactionParent
|
||||||
LayerTransactionParent::LayerTransactionParent(ShadowLayerManager* aManager,
|
LayerTransactionParent::LayerTransactionParent(LayerManagerComposite* aManager,
|
||||||
ShadowLayersManager* aLayersManager,
|
ShadowLayersManager* aLayersManager,
|
||||||
uint64_t aId)
|
uint64_t aId)
|
||||||
: mLayerManager(aManager)
|
: mLayerManager(aManager)
|
||||||
@@ -189,47 +194,47 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
case Edit::TOpCreateThebesLayer: {
|
case Edit::TOpCreateThebesLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
||||||
|
|
||||||
nsRefPtr<ShadowThebesLayer> layer =
|
nsRefPtr<ThebesLayerComposite> layer =
|
||||||
layer_manager()->CreateShadowThebesLayer();
|
layer_manager()->CreateThebesLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateThebesLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpCreateContainerLayer: {
|
case Edit::TOpCreateContainerLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
|
||||||
|
|
||||||
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateShadowContainerLayer();
|
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateContainerLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateContainerLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateContainerLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpCreateImageLayer: {
|
case Edit::TOpCreateImageLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
|
||||||
|
|
||||||
nsRefPtr<ShadowImageLayer> layer =
|
nsRefPtr<ImageLayerComposite> layer =
|
||||||
layer_manager()->CreateShadowImageLayer();
|
layer_manager()->CreateImageLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateImageLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateImageLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpCreateColorLayer: {
|
case Edit::TOpCreateColorLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
|
||||||
|
|
||||||
nsRefPtr<ShadowColorLayer> layer = layer_manager()->CreateShadowColorLayer();
|
nsRefPtr<ColorLayerComposite> layer = layer_manager()->CreateColorLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateColorLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateColorLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpCreateCanvasLayer: {
|
case Edit::TOpCreateCanvasLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
|
||||||
|
|
||||||
nsRefPtr<ShadowCanvasLayer> layer =
|
nsRefPtr<CanvasLayerComposite> layer =
|
||||||
layer_manager()->CreateShadowCanvasLayer();
|
layer_manager()->CreateCanvasLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateCanvasLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateCanvasLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpCreateRefLayer: {
|
case Edit::TOpCreateRefLayer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
|
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
|
||||||
|
|
||||||
nsRefPtr<ShadowRefLayer> layer =
|
nsRefPtr<RefLayerComposite> layer =
|
||||||
layer_manager()->CreateShadowRefLayer();
|
layer_manager()->CreateRefLayerComposite();
|
||||||
AsShadowLayer(edit.get_OpCreateRefLayer())->Bind(layer);
|
AsLayerComposite(edit.get_OpCreateRefLayer())->Bind(layer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +243,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
|
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
|
||||||
|
|
||||||
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
||||||
Layer* layer = AsShadowLayer(osla)->AsLayer();
|
Layer* layer = AsLayerComposite(osla)->AsLayer();
|
||||||
const LayerAttributes& attrs = osla.attrs();
|
const LayerAttributes& attrs = osla.attrs();
|
||||||
|
|
||||||
const CommonLayerAttributes& common = attrs.common();
|
const CommonLayerAttributes& common = attrs.common();
|
||||||
@@ -267,8 +272,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
case Specific::TThebesLayerAttributes: {
|
case Specific::TThebesLayerAttributes: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
||||||
|
|
||||||
ShadowThebesLayer* thebesLayer =
|
ThebesLayerComposite* thebesLayer =
|
||||||
static_cast<ShadowThebesLayer*>(layer);
|
static_cast<ThebesLayerComposite*>(layer);
|
||||||
const ThebesLayerAttributes& attrs =
|
const ThebesLayerAttributes& attrs =
|
||||||
specific.get_ThebesLayerAttributes();
|
specific.get_ThebesLayerAttributes();
|
||||||
|
|
||||||
@@ -300,7 +305,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
|
|
||||||
static_cast<CanvasLayer*>(layer)->SetFilter(
|
static_cast<CanvasLayer*>(layer)->SetFilter(
|
||||||
specific.get_CanvasLayerAttributes().filter());
|
specific.get_CanvasLayerAttributes().filter());
|
||||||
static_cast<ShadowCanvasLayer*>(layer)->SetBounds(
|
static_cast<CanvasLayerComposite*>(layer)->SetBounds(
|
||||||
specific.get_CanvasLayerAttributes().bounds());
|
specific.get_CanvasLayerAttributes().bounds());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -328,7 +333,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
case Edit::TOpSetRoot: {
|
case Edit::TOpSetRoot: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
|
MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
|
||||||
|
|
||||||
mRoot = AsShadowLayer(edit.get_OpSetRoot())->AsContainer();
|
mRoot = AsLayerComposite(edit.get_OpSetRoot())->AsContainer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Edit::TOpInsertAfter: {
|
case Edit::TOpInsertAfter: {
|
||||||
@@ -406,7 +411,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
// Ensure that any pending operations involving back and front
|
// Ensure that any pending operations involving back and front
|
||||||
// buffers have completed, so that neither process stomps on the
|
// buffers have completed, so that neither process stomps on the
|
||||||
// other's buffer contents.
|
// other's buffer contents.
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
||||||
|
|
||||||
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
|
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
|
||||||
|
|
||||||
@@ -423,7 +428,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||||||
void
|
void
|
||||||
LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable)
|
LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable)
|
||||||
{
|
{
|
||||||
ShadowLayer* layer = aLayerParent->AsLayer()->AsShadowLayer();
|
LayerComposite* layer = aLayerParent->AsLayer()->AsLayerComposite();
|
||||||
MOZ_ASSERT(layer);
|
MOZ_ASSERT(layer);
|
||||||
LayerComposite* layerComposite = aLayerParent->AsLayer()->AsLayerComposite();
|
LayerComposite* layerComposite = aLayerParent->AsLayer()->AsLayerComposite();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class RenderFrameParent;
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class Layer;
|
class Layer;
|
||||||
class ShadowLayerManager;
|
class LayerManagerComposite;
|
||||||
class ShadowLayerParent;
|
class ShadowLayerParent;
|
||||||
class CompositableParent;
|
class CompositableParent;
|
||||||
|
|
||||||
@@ -34,14 +34,14 @@ class LayerTransactionParent : public PLayerTransactionParent,
|
|||||||
typedef InfallibleTArray<EditReply> EditReplyArray;
|
typedef InfallibleTArray<EditReply> EditReplyArray;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LayerTransactionParent(ShadowLayerManager* aManager,
|
LayerTransactionParent(LayerManagerComposite* aManager,
|
||||||
ShadowLayersManager* aLayersManager,
|
ShadowLayersManager* aLayersManager,
|
||||||
uint64_t aId);
|
uint64_t aId);
|
||||||
~LayerTransactionParent();
|
~LayerTransactionParent();
|
||||||
|
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
ShadowLayerManager* layer_manager() const { return mLayerManager; }
|
LayerManagerComposite* layer_manager() const { return mLayerManager; }
|
||||||
|
|
||||||
uint64_t GetId() const { return mId; }
|
uint64_t GetId() const { return mId; }
|
||||||
ContainerLayer* GetRoot() const { return mRoot; }
|
ContainerLayer* GetRoot() const { return mRoot; }
|
||||||
@@ -92,7 +92,7 @@ protected:
|
|||||||
void Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable);
|
void Attach(ShadowLayerParent* aLayerParent, CompositableParent* aCompositable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsRefPtr<ShadowLayerManager> mLayerManager;
|
nsRefPtr<LayerManagerComposite> mLayerManager;
|
||||||
ShadowLayersManager* mShadowLayersManager;
|
ShadowLayersManager* mShadowLayersManager;
|
||||||
// Hold the root because it might be grafted under various
|
// Hold the root because it might be grafted under various
|
||||||
// containers in the "real" layer tree
|
// containers in the "real" layer tree
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ already_AddRefed<TextureImage>
|
/*static*/ already_AddRefed<TextureImage>
|
||||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||||
const SurfaceDescriptor&,
|
const SurfaceDescriptor&,
|
||||||
GLenum)
|
GLenum)
|
||||||
{
|
{
|
||||||
@@ -86,13 +86,13 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
ShadowLayerManager::SupportsDirectTexturing()
|
LayerManagerComposite::SupportsDirectTexturing()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void
|
/*static*/ void
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "mozilla/layers/PGrallocBufferParent.h"
|
#include "mozilla/layers/PGrallocBufferParent.h"
|
||||||
#include "mozilla/layers/PLayerTransactionChild.h"
|
#include "mozilla/layers/PLayerTransactionChild.h"
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
#include "mozilla/layers/CompositorTypes.h"
|
||||||
#include "mozilla/unused.h"
|
#include "mozilla/unused.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
@@ -220,11 +221,11 @@ GrallocBufferActor::Create(const gfxIntSize& aSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ already_AddRefed<TextureImage>
|
/*static*/ already_AddRefed<TextureImage>
|
||||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
||||||
const SurfaceDescriptor& aDescriptor,
|
const SurfaceDescriptor& aDescriptor,
|
||||||
GLenum aWrapMode)
|
GLenum aWrapMode)
|
||||||
{
|
{
|
||||||
PROFILER_LABEL("ShadowLayerManager", "OpenDescriptorForDirectTexturing");
|
PROFILER_LABEL("LayerManagerComposite", "OpenDescriptorForDirectTexturing");
|
||||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -233,13 +234,13 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
ShadowLayerManager::SupportsDirectTexturing()
|
LayerManagerComposite::SupportsDirectTexturing()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void
|
/*static*/ void
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||||
{
|
{
|
||||||
// Nothing to be done for gralloc.
|
// Nothing to be done for gralloc.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class GrallocBufferActor : public PGrallocBufferChild
|
|||||||
, public PGrallocBufferParent
|
, public PGrallocBufferParent
|
||||||
{
|
{
|
||||||
friend class ShadowLayerForwarder;
|
friend class ShadowLayerForwarder;
|
||||||
friend class ShadowLayerManager;
|
friend class LayerManagerComposite;
|
||||||
friend class ImageBridgeChild;
|
friend class ImageBridgeChild;
|
||||||
typedef android::GraphicBuffer GraphicBuffer;
|
typedef android::GraphicBuffer GraphicBuffer;
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "mozilla/layers/PLayerTransaction.h"
|
#include "mozilla/layers/PLayerTransaction.h"
|
||||||
#include "mozilla/layers/ShadowLayers.h"
|
#include "mozilla/layers/ShadowLayers.h"
|
||||||
|
#include "mozilla/layers/CompositorTypes.h"
|
||||||
|
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void
|
/*static*/ void
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ already_AddRefed<TextureImage>
|
/*static*/ already_AddRefed<TextureImage>
|
||||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||||
const SurfaceDescriptor&,
|
const SurfaceDescriptor&,
|
||||||
GLenum)
|
GLenum)
|
||||||
{
|
{
|
||||||
@@ -91,7 +92,7 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
ShadowLayerManager::SupportsDirectTexturing()
|
LayerManagerComposite::SupportsDirectTexturing()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/layers/PLayerTransaction.h"
|
#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 "mozilla/layers/ShadowLayers.h"
|
||||||
|
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
@@ -184,7 +187,7 @@ ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void
|
/*static*/ void
|
||||||
ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
||||||
{
|
{
|
||||||
if (UsingXCompositing()) {
|
if (UsingXCompositing()) {
|
||||||
// If we're using X surfaces, we need to finish all pending
|
// If we're using X surfaces, we need to finish all pending
|
||||||
@@ -197,7 +200,7 @@ ShadowLayerManager::PlatformSyncBeforeReplyUpdate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ already_AddRefed<TextureImage>
|
/*static*/ already_AddRefed<TextureImage>
|
||||||
ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext*,
|
||||||
const SurfaceDescriptor&,
|
const SurfaceDescriptor&,
|
||||||
GLenum)
|
GLenum)
|
||||||
{
|
{
|
||||||
@@ -206,7 +209,7 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext*,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
ShadowLayerManager::SupportsDirectTexturing()
|
LayerManagerComposite::SupportsDirectTexturing()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -591,25 +591,6 @@ ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor*)
|
|||||||
return false;
|
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)
|
#endif // !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
||||||
|
|
||||||
AutoOpenSurface::AutoOpenSurface(OpenMode aMode,
|
AutoOpenSurface::AutoOpenSurface(OpenMode aMode,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "mozilla/layers/ISurfaceAllocator.h"
|
#include "mozilla/layers/ISurfaceAllocator.h"
|
||||||
#include "mozilla/dom/ScreenOrientation.h"
|
#include "mozilla/dom/ScreenOrientation.h"
|
||||||
#include "mozilla/layers/CompositableForwarder.h"
|
#include "mozilla/layers/CompositableForwarder.h"
|
||||||
|
#include "mozilla/layers/CompositorTypes.h"
|
||||||
|
|
||||||
class gfxSharedImageSurface;
|
class gfxSharedImageSurface;
|
||||||
|
|
||||||
@@ -38,12 +39,12 @@ class PLayerChild;
|
|||||||
class PLayerTransactionChild;
|
class PLayerTransactionChild;
|
||||||
class PLayerTransactionParent;
|
class PLayerTransactionParent;
|
||||||
class ShadowableLayer;
|
class ShadowableLayer;
|
||||||
class ShadowThebesLayer;
|
class ThebesLayerComposite;
|
||||||
class ShadowContainerLayer;
|
class ContainerLayerComposite;
|
||||||
class ShadowImageLayer;
|
class ImageLayerComposite;
|
||||||
class ShadowColorLayer;
|
class ColorLayerComposite;
|
||||||
class ShadowCanvasLayer;
|
class CanvasLayerComposite;
|
||||||
class ShadowRefLayer;
|
class RefLayerComposite;
|
||||||
class SurfaceDescriptor;
|
class SurfaceDescriptor;
|
||||||
class ThebesBuffer;
|
class ThebesBuffer;
|
||||||
class TiledLayerComposer;
|
class TiledLayerComposer;
|
||||||
@@ -57,12 +58,6 @@ class ImageClient;
|
|||||||
class CanvasClient;
|
class CanvasClient;
|
||||||
class ContentClient;
|
class ContentClient;
|
||||||
|
|
||||||
enum OpenMode {
|
|
||||||
OPEN_READ_ONLY,
|
|
||||||
OPEN_READ_WRITE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We want to share layer trees across thread contexts and address
|
* 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
|
* parent context. This comprises recording layer-tree modifications
|
||||||
* into atomic transactions and pushing them over IPC.
|
* 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.
|
* ShadowLayerForwarder(s) into a parent-context layer tree.
|
||||||
*
|
*
|
||||||
* (Advanced note: because our process tree may have a height >2, a
|
* (Advanced note: because our process tree may have a height >2, a
|
||||||
* non-leaf subprocess may both receive updates from child processes
|
* non-leaf subprocess may both receive updates from child processes
|
||||||
* and publish them to parent processes. Put another way,
|
* and publish them to parent processes. Put another way,
|
||||||
* LayerManagers may be both ShadowLayerManagers and
|
* LayerManagers may be both LayerManagerComposites and
|
||||||
* ShadowLayerForwarders.)
|
* ShadowLayerForwarders.)
|
||||||
*
|
*
|
||||||
* There are only shadow types for layers that have different shadow
|
* There are only shadow types for layers that have different shadow
|
||||||
@@ -128,7 +123,7 @@ enum OpenMode {
|
|||||||
* compositable transactions.
|
* compositable transactions.
|
||||||
* A transaction is a set of changes to the layers and/or the compositables
|
* 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
|
* 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
|
* Layer transactions maintain the shape of the shadow layer tree, and
|
||||||
* synchronize the texture data held by compositables. Layer transactions
|
* synchronize the texture data held by compositables. Layer transactions
|
||||||
* are always between the content thread and the compositor thread.
|
* 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
|
* Begin recording a transaction to be forwarded atomically to a
|
||||||
* ShadowLayerManager.
|
* LayerManagerComposite.
|
||||||
*/
|
*/
|
||||||
void BeginTransaction(const nsIntRect& aTargetBounds,
|
void BeginTransaction(const nsIntRect& aTargetBounds,
|
||||||
ScreenRotation aRotation,
|
ScreenRotation aRotation,
|
||||||
@@ -293,8 +288,8 @@ public:
|
|||||||
const nsIntRect& aRect);
|
const nsIntRect& aRect);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* End the current transaction and forward it to ShadowLayerManager.
|
* End the current transaction and forward it to LayerManagerComposite.
|
||||||
* |aReplies| are directions from the ShadowLayerManager to the
|
* |aReplies| are directions from the LayerManagerComposite to the
|
||||||
* caller of EndTransaction().
|
* caller of EndTransaction().
|
||||||
*/
|
*/
|
||||||
bool EndTransaction(InfallibleTArray<EditReply>* aReplies);
|
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; }
|
bool HasShadowManager() const { return !!mShadowManager; }
|
||||||
PLayerTransactionChild* GetShadowManager() const { return mShadowManager; }
|
PLayerTransactionChild* GetShadowManager() const { return mShadowManager; }
|
||||||
@@ -317,23 +312,23 @@ public:
|
|||||||
* The following Alloc/Open/Destroy interfaces abstract over the
|
* The following Alloc/Open/Destroy interfaces abstract over the
|
||||||
* details of working with surfaces that are shared across
|
* details of working with surfaces that are shared across
|
||||||
* processes. They provide the glue between C++ Layers and the
|
* processes. They provide the glue between C++ Layers and the
|
||||||
* ShadowLayer IPC system.
|
* LayerComposite IPC system.
|
||||||
*
|
*
|
||||||
* The basic lifecycle is
|
* The basic lifecycle is
|
||||||
*
|
*
|
||||||
* - a Layer needs a buffer. Its ShadowableLayer subclass calls
|
* - a Layer needs a buffer. Its ShadowableLayer subclass calls
|
||||||
* AllocBuffer(), then calls one of the Created*Buffer() methods
|
* AllocBuffer(), then calls one of the Created*Buffer() methods
|
||||||
* above to transfer the (temporary) front buffer to its
|
* 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
|
* gfxASurface to paint, so the ShadowableLayer uses
|
||||||
* OpenDescriptor(backBuffer) to get that surface, and hands it
|
* OpenDescriptor(backBuffer) to get that surface, and hands it
|
||||||
* out to the Layer.
|
* out to the Layer.
|
||||||
*
|
*
|
||||||
* - a Layer has painted new pixels. Its ShadowableLayer calls one
|
* - a Layer has painted new pixels. Its ShadowableLayer calls one
|
||||||
* of the Painted*Buffer() methods above with the back buffer
|
* 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.
|
* 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
|
* platform-dependent way, and sends a surface descriptor back to
|
||||||
* the ShadowableLayer that becomes its new back back buffer.
|
* the ShadowableLayer that becomes its new back back buffer.
|
||||||
*
|
*
|
||||||
@@ -342,7 +337,7 @@ public:
|
|||||||
* buffer descriptor. The actual back buffer surface is then
|
* buffer descriptor. The actual back buffer surface is then
|
||||||
* destroyed using DestroySharedSurface() just before notifying
|
* destroyed using DestroySharedSurface() just before notifying
|
||||||
* the parent process. When the parent process is notified, the
|
* 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.
|
* buffer, and the double-buffer pair is gone.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -357,7 +352,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a shadow of |aLayer| on the "other side", at the
|
* Construct a shadow of |aLayer| on the "other side", at the
|
||||||
* ShadowLayerManager.
|
* LayerManagerComposite.
|
||||||
*/
|
*/
|
||||||
PLayerChild* ConstructShadowFor(ShadowableLayer* aLayer);
|
PLayerChild* ConstructShadowFor(ShadowableLayer* aLayer);
|
||||||
|
|
||||||
@@ -432,66 +427,6 @@ private:
|
|||||||
bool mIsFirstPaint;
|
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;
|
class CompositableClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -526,199 +461,6 @@ protected:
|
|||||||
PLayerChild* mShadow;
|
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 layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ EXPORTS += [
|
|||||||
'BasicTiledThebesLayer.h',
|
'BasicTiledThebesLayer.h',
|
||||||
'BasicThebesLayer.h',
|
'BasicThebesLayer.h',
|
||||||
'CompositableHost.h',
|
'CompositableHost.h',
|
||||||
'LayerManagerComposite.h',
|
|
||||||
'Composer2D.h',
|
'Composer2D.h',
|
||||||
'GonkIOSurfaceImage.h',
|
'GonkIOSurfaceImage.h',
|
||||||
'FrameMetrics.h',
|
'FrameMetrics.h',
|
||||||
@@ -62,11 +61,14 @@ EXPORTS.mozilla.layers += [
|
|||||||
'AsyncPanZoomController.h',
|
'AsyncPanZoomController.h',
|
||||||
'Axis.h',
|
'Axis.h',
|
||||||
'CanvasClient.h',
|
'CanvasClient.h',
|
||||||
|
'CanvasLayerComposite.h',
|
||||||
|
'ColorLayerComposite.h',
|
||||||
'CompositableClient.h',
|
'CompositableClient.h',
|
||||||
'CompositableTransactionParent.h',
|
'CompositableTransactionParent.h',
|
||||||
'Compositor.h',
|
'Compositor.h',
|
||||||
'CompositorOGL.h',
|
'CompositorOGL.h',
|
||||||
'CompositorTypes.h',
|
'CompositorTypes.h',
|
||||||
|
'ContainerLayerComposite.h',
|
||||||
'ContentHost.h',
|
'ContentHost.h',
|
||||||
'CompositingRenderTargetOGL.h',
|
'CompositingRenderTargetOGL.h',
|
||||||
'CompositorCocoaWidgetHelper.h',
|
'CompositorCocoaWidgetHelper.h',
|
||||||
@@ -80,12 +82,14 @@ EXPORTS.mozilla.layers += [
|
|||||||
'ImageBridgeChild.h',
|
'ImageBridgeChild.h',
|
||||||
'ImageBridgeParent.h',
|
'ImageBridgeParent.h',
|
||||||
'ImageClient.h',
|
'ImageClient.h',
|
||||||
|
'ImageLayerComposite.h',
|
||||||
'ImageHost.h',
|
'ImageHost.h',
|
||||||
'ISurfaceAllocator.h',
|
'ISurfaceAllocator.h',
|
||||||
|
'LayerManagerComposite.h',
|
||||||
'LayersTypes.h',
|
'LayersTypes.h',
|
||||||
'ShadowLayers.h',
|
|
||||||
'LayerTransactionChild.h',
|
'LayerTransactionChild.h',
|
||||||
'LayerTransactionParent.h',
|
'LayerTransactionParent.h',
|
||||||
|
'ShadowLayers.h',
|
||||||
'ShadowLayersManager.h',
|
'ShadowLayersManager.h',
|
||||||
'RenderTrace.h',
|
'RenderTrace.h',
|
||||||
'SharedRGBImage.h',
|
'SharedRGBImage.h',
|
||||||
@@ -96,6 +100,7 @@ EXPORTS.mozilla.layers += [
|
|||||||
'TextureHost.h',
|
'TextureHost.h',
|
||||||
'TextureClientOGL.h',
|
'TextureClientOGL.h',
|
||||||
'TextureHostOGL.h',
|
'TextureHostOGL.h',
|
||||||
|
'ThebesLayerComposite.h',
|
||||||
'TiledContentClient.h',
|
'TiledContentClient.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "GLManager.h"
|
#include "GLManager.h"
|
||||||
#include "LayerManagerOGL.h"
|
#include "LayerManagerOGL.h"
|
||||||
#include "CompositorOGL.h"
|
#include "CompositorOGL.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "GLContext.h"
|
#include "GLContext.h"
|
||||||
|
|
||||||
using namespace mozilla::gl;
|
using namespace mozilla::gl;
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ namespace layers {
|
|||||||
|
|
||||||
class Composer2D;
|
class Composer2D;
|
||||||
class LayerOGL;
|
class LayerOGL;
|
||||||
class ShadowThebesLayer;
|
class ThebesLayerComposite;
|
||||||
class ShadowContainerLayer;
|
class ContainerLayerComposite;
|
||||||
class ShadowImageLayer;
|
class ImageLayerComposite;
|
||||||
class ShadowCanvasLayer;
|
class CanvasLayerComposite;
|
||||||
class ShadowColorLayer;
|
class ColorLayerComposite;
|
||||||
struct FPSState;
|
struct FPSState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader,
|
|||||||
float aTempScaleDiffX = 1.0,
|
float aTempScaleDiffX = 1.0,
|
||||||
float aTempScaleDiffY = 1.0)
|
float aTempScaleDiffY = 1.0)
|
||||||
{
|
{
|
||||||
ShadowLayer* shadow = aLayer->AsShadowLayer();
|
LayerComposite* shadow = aLayer->AsLayerComposite();
|
||||||
shadow->SetShadowClipRect(aLayer->GetClipRect());
|
shadow->SetShadowClipRect(aLayer->GetClipRect());
|
||||||
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
|
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
|
||||||
shadow->SetShadowOpacity(aLayer->GetOpacity());
|
shadow->SetShadowOpacity(aLayer->GetOpacity());
|
||||||
@@ -435,7 +435,7 @@ BuildBackgroundPatternFor(ContainerLayer* aContainer,
|
|||||||
LayerManager* aManager,
|
LayerManager* aManager,
|
||||||
nsIFrame* aFrame)
|
nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
ShadowLayer* shadowRoot = aShadowRoot->AsShadowLayer();
|
LayerComposite* shadowRoot = aShadowRoot->AsLayerComposite();
|
||||||
gfxMatrix t;
|
gfxMatrix t;
|
||||||
if (!shadowRoot->GetShadowTransform().Is2D(&t)) {
|
if (!shadowRoot->GetShadowTransform().Is2D(&t)) {
|
||||||
return;
|
return;
|
||||||
@@ -603,7 +603,7 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
|
|||||||
|
|
||||||
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
||||||
// Perhaps the document containing this frame currently has no presentation?
|
// Perhaps the document containing this frame currently has no presentation?
|
||||||
if (lm && lm->AsShadowManager()) {
|
if (lm && lm->AsLayerManagerComposite()) {
|
||||||
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
|
||||||
} else {
|
} else {
|
||||||
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
|
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
|
||||||
@@ -853,7 +853,7 @@ RenderFrameParent::AllocPLayerTransaction()
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
||||||
return new LayerTransactionParent(lm->AsShadowManager(), this, 0);
|
return new LayerTransactionParent(lm->AsLayerManagerComposite(), this, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ using mozilla::unused;
|
|||||||
#include "Layers.h"
|
#include "Layers.h"
|
||||||
#include "BasicLayers.h"
|
#include "BasicLayers.h"
|
||||||
#include "LayerManagerOGL.h"
|
#include "LayerManagerOGL.h"
|
||||||
#include "LayerManagerComposite.h"
|
#include "mozilla/layers/LayerManagerComposite.h"
|
||||||
#include "GLContext.h"
|
#include "GLContext.h"
|
||||||
#include "GLContextProvider.h"
|
#include "GLContextProvider.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2844,7 +2844,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||||||
// Mac OS X bug that stops windows updating on OS X when we use OpenGL.
|
// Mac OS X bug that stops windows updating on OS X when we use OpenGL.
|
||||||
LayerManager *layerManager = mGeckoChild->GetLayerManager(nullptr);
|
LayerManager *layerManager = mGeckoChild->GetLayerManager(nullptr);
|
||||||
if (mUsingOMTCompositor && painted && !mDidForceRefreshOpenGL &&
|
if (mUsingOMTCompositor && painted && !mDidForceRefreshOpenGL &&
|
||||||
layerManager->AsShadowManager()) {
|
layerManager->AsManagerComposite()) {
|
||||||
if (!mDidForceRefreshOpenGL) {
|
if (!mDidForceRefreshOpenGL) {
|
||||||
[self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
|
[self performSelector:@selector(forceRefreshOpenGL) withObject:nil afterDelay:0];
|
||||||
mDidForceRefreshOpenGL = YES;
|
mDidForceRefreshOpenGL = YES;
|
||||||
|
|||||||
Reference in New Issue
Block a user