mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
backout because of Fennec breakage
This commit is contained in:
parent
3a611eb9da
commit
a600cd781b
@ -58,7 +58,6 @@
|
|||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
#include "ThebesLayerBuffer.h"
|
#include "ThebesLayerBuffer.h"
|
||||||
#include "nsIWidget.h"
|
#include "nsIWidget.h"
|
||||||
#include "ReadbackProcessor.h"
|
|
||||||
|
|
||||||
#include "GLContext.h"
|
#include "GLContext.h"
|
||||||
|
|
||||||
@ -107,16 +106,9 @@ public:
|
|||||||
* set up to account for all the properties of the layer (transform,
|
* set up to account for all the properties of the layer (transform,
|
||||||
* opacity, etc).
|
* opacity, etc).
|
||||||
*/
|
*/
|
||||||
virtual void Paint(gfxContext* aContext) {}
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
/**
|
void* aCallbackData) {}
|
||||||
* Like Paint() but called for ThebesLayers with the additional parameters
|
|
||||||
* they need.
|
|
||||||
*/
|
|
||||||
virtual void PaintThebes(gfxContext* aContext,
|
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
|
||||||
void* aCallbackData,
|
|
||||||
ReadbackProcessor* aReadback) {}
|
|
||||||
|
|
||||||
virtual ShadowableLayer* AsShadowableLayer() { return nsnull; }
|
virtual ShadowableLayer* AsShadowableLayer() { return nsnull; }
|
||||||
|
|
||||||
@ -388,10 +380,9 @@ public:
|
|||||||
mValidRegion.Sub(mValidRegion, aRegion);
|
mValidRegion.Sub(mValidRegion, aRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void PaintThebes(gfxContext* aContext,
|
virtual void Paint(gfxContext* aContext,
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData);
|
||||||
ReadbackProcessor* aReadback);
|
|
||||||
|
|
||||||
virtual void ClearCachedResources() { mBuffer.Clear(); mValidRegion.SetEmpty(); }
|
virtual void ClearCachedResources() { mBuffer.Clear(); mValidRegion.SetEmpty(); }
|
||||||
|
|
||||||
@ -516,20 +507,14 @@ PushGroupForLayer(gfxContext* aContext, Layer* aLayer, const nsIntRegion& aRegio
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
BasicThebesLayer::Paint(gfxContext* aContext,
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData)
|
||||||
ReadbackProcessor* aReadback)
|
|
||||||
{
|
{
|
||||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||||
"Can only draw in drawing phase");
|
"Can only draw in drawing phase");
|
||||||
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
|
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
|
||||||
|
|
||||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
|
||||||
if (aReadback && UsedForReadback()) {
|
|
||||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
|
|
||||||
}
|
|
||||||
|
|
||||||
PRBool canUseOpaqueSurface = CanUseOpaqueSurface();
|
PRBool canUseOpaqueSurface = CanUseOpaqueSurface();
|
||||||
Buffer::ContentType contentType =
|
Buffer::ContentType contentType =
|
||||||
canUseOpaqueSurface ? gfxASurface::CONTENT_COLOR :
|
canUseOpaqueSurface ? gfxASurface::CONTENT_COLOR :
|
||||||
@ -540,8 +525,6 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
|||||||
(!canUseOpaqueSurface &&
|
(!canUseOpaqueSurface &&
|
||||||
(mContentFlags & CONTENT_COMPONENT_ALPHA) &&
|
(mContentFlags & CONTENT_COMPONENT_ALPHA) &&
|
||||||
!MustRetainContent())) {
|
!MustRetainContent())) {
|
||||||
NS_ASSERTION(readbackUpdates.IsEmpty(), "Can't do readback for non-retained layer");
|
|
||||||
|
|
||||||
mValidRegion.SetEmpty();
|
mValidRegion.SetEmpty();
|
||||||
mBuffer.Clear();
|
mBuffer.Clear();
|
||||||
|
|
||||||
@ -604,20 +587,6 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mBuffer.DrawTo(this, aContext, opacity);
|
mBuffer.DrawTo(this, aContext, opacity);
|
||||||
|
|
||||||
for (PRUint32 i = 0; i < readbackUpdates.Length(); ++i) {
|
|
||||||
ReadbackProcessor::Update& update = readbackUpdates[i];
|
|
||||||
nsIntPoint offset = update.mLayer->GetBackgroundLayerOffset();
|
|
||||||
nsRefPtr<gfxContext> ctx =
|
|
||||||
update.mLayer->GetSink()->BeginUpdate(update.mUpdateRect + offset,
|
|
||||||
update.mSequenceCounter);
|
|
||||||
if (ctx) {
|
|
||||||
NS_ASSERTION(opacity == 1.0, "Should only read back opaque layers");
|
|
||||||
ctx->Translate(gfxPoint(offset.x, offset.y));
|
|
||||||
mBuffer.DrawTo(this, ctx, 1.0);
|
|
||||||
update.mLayer->GetSink()->EndUpdate(ctx, update.mUpdateRect + offset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PRBool
|
static PRBool
|
||||||
@ -698,7 +667,9 @@ public:
|
|||||||
ImageLayer::SetVisibleRegion(aRegion);
|
ImageLayer::SetVisibleRegion(aRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
static void PaintContext(gfxPattern* aPattern,
|
static void PaintContext(gfxPattern* aPattern,
|
||||||
const nsIntRegion& aVisible,
|
const nsIntRegion& aVisible,
|
||||||
@ -720,7 +691,9 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicImageLayer::Paint(gfxContext* aContext)
|
BasicImageLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
nsRefPtr<gfxPattern> dontcare =
|
nsRefPtr<gfxPattern> dontcare =
|
||||||
GetAndPaintCurrentImage(aContext, GetEffectiveOpacity());
|
GetAndPaintCurrentImage(aContext, GetEffectiveOpacity());
|
||||||
@ -826,7 +799,9 @@ public:
|
|||||||
ColorLayer::SetVisibleRegion(aRegion);
|
ColorLayer::SetVisibleRegion(aRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext)
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
PaintColorTo(mColor, GetEffectiveOpacity(), aContext);
|
PaintColorTo(mColor, GetEffectiveOpacity(), aContext);
|
||||||
}
|
}
|
||||||
@ -872,7 +847,9 @@ public:
|
|||||||
|
|
||||||
virtual void Initialize(const Data& aData);
|
virtual void Initialize(const Data& aData);
|
||||||
virtual void Updated(const nsIntRect& aRect);
|
virtual void Updated(const nsIntRect& aRect);
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
virtual void PaintWithOpacity(gfxContext* aContext,
|
virtual void PaintWithOpacity(gfxContext* aContext,
|
||||||
float aOpacity);
|
float aOpacity);
|
||||||
@ -982,7 +959,9 @@ BasicCanvasLayer::Updated(const nsIntRect& aRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicCanvasLayer::Paint(gfxContext* aContext)
|
BasicCanvasLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
PaintWithOpacity(aContext, GetEffectiveOpacity());
|
PaintWithOpacity(aContext, GetEffectiveOpacity());
|
||||||
}
|
}
|
||||||
@ -1019,34 +998,6 @@ BasicCanvasLayer::PaintWithOpacity(gfxContext* aContext,
|
|||||||
mUpdatedRect.Empty();
|
mUpdatedRect.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
class BasicReadbackLayer : public ReadbackLayer,
|
|
||||||
BasicImplData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BasicReadbackLayer(BasicLayerManager* aLayerManager) :
|
|
||||||
ReadbackLayer(aLayerManager, static_cast<BasicImplData*>(this))
|
|
||||||
{
|
|
||||||
MOZ_COUNT_CTOR(BasicReadbackLayer);
|
|
||||||
}
|
|
||||||
virtual ~BasicReadbackLayer()
|
|
||||||
{
|
|
||||||
MOZ_COUNT_DTOR(BasicReadbackLayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void SetVisibleRegion(const nsIntRegion& aRegion)
|
|
||||||
{
|
|
||||||
NS_ASSERTION(BasicManager()->InConstruction(),
|
|
||||||
"Can only set properties in construction phase");
|
|
||||||
ReadbackLayer::SetVisibleRegion(aRegion);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
BasicLayerManager* BasicManager()
|
|
||||||
{
|
|
||||||
return static_cast<BasicLayerManager*>(mManager);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static nsIntRect
|
static nsIntRect
|
||||||
ToOutsideIntRect(const gfxRect &aRect)
|
ToOutsideIntRect(const gfxRect &aRect)
|
||||||
{
|
{
|
||||||
@ -1349,7 +1300,7 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
|||||||
MarkLeafLayersCoveredByOpaque(mRoot,
|
MarkLeafLayersCoveredByOpaque(mRoot,
|
||||||
mRoot->GetEffectiveVisibleRegion().GetBounds(),
|
mRoot->GetEffectiveVisibleRegion().GetBounds(),
|
||||||
region);
|
region);
|
||||||
PaintLayer(mRoot, aCallback, aCallbackData, nsnull);
|
PaintLayer(mRoot, aCallback, aCallbackData);
|
||||||
|
|
||||||
// If we're doing manual double-buffering, we need to avoid drawing
|
// If we're doing manual double-buffering, we need to avoid drawing
|
||||||
// the results of an incomplete transaction to the destination surface.
|
// the results of an incomplete transaction to the destination surface.
|
||||||
@ -1420,8 +1371,7 @@ BasicLayerManager::SetRoot(Layer* aLayer)
|
|||||||
void
|
void
|
||||||
BasicLayerManager::PaintLayer(Layer* aLayer,
|
BasicLayerManager::PaintLayer(Layer* aLayer,
|
||||||
DrawThebesLayerCallback aCallback,
|
DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData)
|
||||||
ReadbackProcessor* aReadback)
|
|
||||||
{
|
{
|
||||||
const nsIntRect* clipRect = aLayer->GetEffectiveClipRect();
|
const nsIntRect* clipRect = aLayer->GetEffectiveClipRect();
|
||||||
const gfx3DMatrix& effectiveTransform = aLayer->GetEffectiveTransform();
|
const gfx3DMatrix& effectiveTransform = aLayer->GetEffectiveTransform();
|
||||||
@ -1483,21 +1433,11 @@ BasicLayerManager::PaintLayer(Layer* aLayer,
|
|||||||
(void*)aLayer, data->IsCoveredByOpaque()));
|
(void*)aLayer, data->IsCoveredByOpaque()));
|
||||||
#endif
|
#endif
|
||||||
if (!data->IsCoveredByOpaque()) {
|
if (!data->IsCoveredByOpaque()) {
|
||||||
if (aLayer->GetType() == Layer::TYPE_THEBES) {
|
data->Paint(mTarget, aCallback, aCallbackData);
|
||||||
data->PaintThebes(mTarget, aCallback, aCallbackData, aReadback);
|
|
||||||
} else {
|
|
||||||
data->Paint(mTarget);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ReadbackProcessor readback;
|
|
||||||
if (IsRetained()) {
|
|
||||||
ContainerLayer* container = static_cast<ContainerLayer*>(aLayer);
|
|
||||||
readback.BuildUpdates(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; child; child = child->GetNextSibling()) {
|
for (; child; child = child->GetNextSibling()) {
|
||||||
PaintLayer(child, aCallback, aCallbackData, &readback);
|
PaintLayer(child, aCallback, aCallbackData);
|
||||||
if (mTransactionIncomplete)
|
if (mTransactionIncomplete)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1581,13 +1521,6 @@ BasicLayerManager::CreateCanvasLayer()
|
|||||||
return layer.forget();
|
return layer.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<ReadbackLayer>
|
|
||||||
BasicLayerManager::CreateReadbackLayer()
|
|
||||||
{
|
|
||||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
|
||||||
nsRefPtr<ReadbackLayer> layer = new BasicReadbackLayer(this);
|
|
||||||
return layer.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MOZ_IPC
|
#ifdef MOZ_IPC
|
||||||
|
|
||||||
@ -1644,19 +1577,6 @@ ToShadowable(Layer* aLayer)
|
|||||||
return ToData(aLayer)->AsShadowableLayer();
|
return ToData(aLayer)->AsShadowableLayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some layers, like ReadbackLayers, can't be shadowed and shadowing
|
|
||||||
// them doesn't make sense anyway
|
|
||||||
static bool
|
|
||||||
ShouldShadow(Layer* aLayer)
|
|
||||||
{
|
|
||||||
if (!ToShadowable(aLayer)) {
|
|
||||||
NS_ABORT_IF_FALSE(aLayer->GetType() == Layer::TYPE_READBACK,
|
|
||||||
"Only expect not to shadow ReadbackLayers");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class OpT>
|
template<class OpT>
|
||||||
static BasicShadowableLayer*
|
static BasicShadowableLayer*
|
||||||
GetBasicShadowable(const OpT& op)
|
GetBasicShadowable(const OpT& op)
|
||||||
@ -1704,10 +1624,7 @@ private:
|
|||||||
void
|
void
|
||||||
BasicShadowableContainerLayer::InsertAfter(Layer* aChild, Layer* aAfter)
|
BasicShadowableContainerLayer::InsertAfter(Layer* aChild, Layer* aAfter)
|
||||||
{
|
{
|
||||||
if (HasShadow() && ShouldShadow(aChild)) {
|
if (HasShadow()) {
|
||||||
while (aAfter && !ShouldShadow(aAfter)) {
|
|
||||||
aAfter = aAfter->GetPrevSibling();
|
|
||||||
}
|
|
||||||
ShadowManager()->InsertAfter(ShadowManager()->Hold(this),
|
ShadowManager()->InsertAfter(ShadowManager()->Hold(this),
|
||||||
ShadowManager()->Hold(aChild),
|
ShadowManager()->Hold(aChild),
|
||||||
aAfter ? ShadowManager()->Hold(aAfter) : nsnull);
|
aAfter ? ShadowManager()->Hold(aAfter) : nsnull);
|
||||||
@ -1718,7 +1635,7 @@ BasicShadowableContainerLayer::InsertAfter(Layer* aChild, Layer* aAfter)
|
|||||||
void
|
void
|
||||||
BasicShadowableContainerLayer::RemoveChild(Layer* aChild)
|
BasicShadowableContainerLayer::RemoveChild(Layer* aChild)
|
||||||
{
|
{
|
||||||
if (HasShadow() && ShouldShadow(aChild)) {
|
if (HasShadow()) {
|
||||||
ShadowManager()->RemoveChild(ShadowManager()->Hold(this),
|
ShadowManager()->RemoveChild(ShadowManager()->Hold(this),
|
||||||
ShadowManager()->Hold(aChild));
|
ShadowManager()->Hold(aChild));
|
||||||
}
|
}
|
||||||
@ -1942,7 +1859,9 @@ public:
|
|||||||
MOZ_COUNT_DTOR(BasicShadowableImageLayer);
|
MOZ_COUNT_DTOR(BasicShadowableImageLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||||
{
|
{
|
||||||
@ -1973,7 +1892,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowableImageLayer::Paint(gfxContext* aContext)
|
BasicShadowableImageLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
gfxIntSize oldSize = mSize;
|
gfxIntSize oldSize = mSize;
|
||||||
nsRefPtr<gfxPattern> pat = GetAndPaintCurrentImage(aContext, GetEffectiveOpacity());
|
nsRefPtr<gfxPattern> pat = GetAndPaintCurrentImage(aContext, GetEffectiveOpacity());
|
||||||
@ -2058,7 +1979,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void Initialize(const Data& aData);
|
virtual void Initialize(const Data& aData);
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||||
{
|
{
|
||||||
@ -2119,9 +2042,11 @@ BasicShadowableCanvasLayer::Initialize(const Data& aData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowableCanvasLayer::Paint(gfxContext* aContext)
|
BasicShadowableCanvasLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
BasicCanvasLayer::Paint(aContext);
|
BasicCanvasLayer::Paint(aContext, aCallback, aCallbackData);
|
||||||
if (!HasShadow())
|
if (!HasShadow())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2244,10 +2169,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void PaintThebes(gfxContext* aContext,
|
virtual void Paint(gfxContext* aContext,
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData);
|
||||||
ReadbackProcessor* aReadback);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicShadowLayerManager* BasicManager()
|
BasicShadowLayerManager* BasicManager()
|
||||||
@ -2339,10 +2263,9 @@ BasicShadowThebesLayer::Swap(const ThebesBuffer& aNewFront,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowThebesLayer::PaintThebes(gfxContext* aContext,
|
BasicShadowThebesLayer::Paint(gfxContext* aContext,
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData)
|
||||||
ReadbackProcessor* aReadback)
|
|
||||||
{
|
{
|
||||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||||
"Can only draw in drawing phase");
|
"Can only draw in drawing phase");
|
||||||
@ -2436,7 +2359,9 @@ public:
|
|||||||
mFrontSurface = nsnull;
|
mFrontSurface = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BasicShadowLayerManager* BasicManager()
|
BasicShadowLayerManager* BasicManager()
|
||||||
@ -2467,7 +2392,9 @@ BasicShadowImageLayer::Swap(gfxSharedImageSurface* newFront)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowImageLayer::Paint(gfxContext* aContext)
|
BasicShadowImageLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
if (!mFrontSurface) {
|
if (!mFrontSurface) {
|
||||||
return;
|
return;
|
||||||
@ -2493,7 +2420,9 @@ public:
|
|||||||
MOZ_COUNT_DTOR(BasicShadowColorLayer);
|
MOZ_COUNT_DTOR(BasicShadowColorLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext)
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
BasicColorLayer::PaintColorTo(mColor, GetEffectiveOpacity(), aContext);
|
BasicColorLayer::PaintColorTo(mColor, GetEffectiveOpacity(), aContext);
|
||||||
}
|
}
|
||||||
@ -2535,7 +2464,9 @@ public:
|
|||||||
mFrontSurface = nsnull;
|
mFrontSurface = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Paint(gfxContext* aContext);
|
virtual void Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicShadowLayerManager* BasicManager()
|
BasicShadowLayerManager* BasicManager()
|
||||||
@ -2567,7 +2498,9 @@ BasicShadowCanvasLayer::Swap(gfxSharedImageSurface* newFront)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowCanvasLayer::Paint(gfxContext* aContext)
|
BasicShadowCanvasLayer::Paint(gfxContext* aContext,
|
||||||
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||||
"Can only draw in drawing phase");
|
"Can only draw in drawing phase");
|
||||||
@ -2738,7 +2671,7 @@ BasicShadowLayerManager::Mutated(Layer* aLayer)
|
|||||||
BasicLayerManager::Mutated(aLayer);
|
BasicLayerManager::Mutated(aLayer);
|
||||||
|
|
||||||
NS_ASSERTION(InConstruction() || InDrawing(), "wrong phase");
|
NS_ASSERTION(InConstruction() || InDrawing(), "wrong phase");
|
||||||
if (HasShadowManager() && ShouldShadow(aLayer)) {
|
if (HasShadowManager()) {
|
||||||
ShadowLayerForwarder::Mutated(Hold(aLayer));
|
ShadowLayerForwarder::Mutated(Hold(aLayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,6 @@ class ShadowContainerLayer;
|
|||||||
class ShadowImageLayer;
|
class ShadowImageLayer;
|
||||||
class ShadowCanvasLayer;
|
class ShadowCanvasLayer;
|
||||||
class ShadowColorLayer;
|
class ShadowColorLayer;
|
||||||
class ReadbackProcessor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
|
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
|
||||||
@ -153,17 +152,16 @@ public:
|
|||||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
||||||
virtual already_AddRefed<ImageContainer> CreateImageContainer();
|
virtual already_AddRefed<ImageContainer> CreateImageContainer();
|
||||||
virtual already_AddRefed<ColorLayer> CreateColorLayer();
|
virtual already_AddRefed<ColorLayer> CreateColorLayer();
|
||||||
virtual already_AddRefed<ReadbackLayer> CreateReadbackLayer();
|
|
||||||
virtual already_AddRefed<ShadowThebesLayer> CreateShadowThebesLayer()
|
virtual already_AddRefed<ShadowThebesLayer> CreateShadowThebesLayer()
|
||||||
{ return nsnull; }
|
{ return NULL; }
|
||||||
virtual already_AddRefed<ShadowContainerLayer> CreateShadowContainerLayer()
|
virtual already_AddRefed<ShadowContainerLayer> CreateShadowContainerLayer()
|
||||||
{ return nsnull; }
|
{ return NULL; }
|
||||||
virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer()
|
virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer()
|
||||||
{ return nsnull; }
|
{ return NULL; }
|
||||||
virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer()
|
virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer()
|
||||||
{ return nsnull; }
|
{ return NULL; }
|
||||||
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer()
|
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer()
|
||||||
{ return nsnull; }
|
{ return NULL; }
|
||||||
|
|
||||||
virtual LayersBackend GetBackendType() { return LAYERS_BASIC; }
|
virtual LayersBackend GetBackendType() { return LAYERS_BASIC; }
|
||||||
virtual void GetBackendName(nsAString& name) { name.AssignLiteral("Basic"); }
|
virtual void GetBackendName(nsAString& name) { name.AssignLiteral("Basic"); }
|
||||||
@ -199,8 +197,7 @@ protected:
|
|||||||
// Paints aLayer to mTarget.
|
// Paints aLayer to mTarget.
|
||||||
void PaintLayer(Layer* aLayer,
|
void PaintLayer(Layer* aLayer,
|
||||||
DrawThebesLayerCallback aCallback,
|
DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData,
|
void* aCallbackData);
|
||||||
ReadbackProcessor* aReadback);
|
|
||||||
|
|
||||||
// Clear the contents of a layer
|
// Clear the contents of a layer
|
||||||
void ClearLayer(Layer* aLayer);
|
void ClearLayer(Layer* aLayer);
|
||||||
|
Loading…
Reference in New Issue
Block a user