Bug 948765 - Port CopyableCanvasLayer to Moz2D. r=nical

This patch deprecates the UpdateSurface and PaintWithOpacity methods in the
CCL class. To do this, many other changes were made in the process.

BasicImplData::Paint was deprecated, and its mOperator was ported to Moz2D.
This caused changes in several *Layer subclasses.

GLScreenBuffer::Readback was deprecated.

I want to change the usages of the (now) deprecated functions, so that they
use the new Moz2D ones: CanvasClient::Update has been updated, but the big
one (BasicLayerManager::PaintSelfOrChildren) will have to be its own
project.
This commit is contained in:
Tor Arvid Lund
2014-02-12 10:07:46 -05:00
parent b0e3999465
commit 8137f30c4b
20 changed files with 366 additions and 139 deletions

View File

@@ -52,7 +52,8 @@ public:
ImageLayer::SetVisibleRegion(aRegion);
}
virtual void Paint(gfxContext* aContext, Layer* aMaskLayer);
virtual void Paint(DrawTarget* aTarget, SourceSurface* aMaskSurface);
virtual void DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer);
virtual bool GetAsSurface(gfxASurface** aSurface,
SurfaceDescriptor* aDescriptor);
@@ -73,7 +74,13 @@ protected:
};
void
BasicImageLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
BasicImageLayer::Paint(DrawTarget* aTarget, SourceSurface* aMaskSurface)
{
DeprecatedPaint(new gfxContext(aTarget), nullptr); //TODO: null->aMaskSurface
}
void
BasicImageLayer::DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer)
{
if (IsHidden())
return;
@@ -110,8 +117,10 @@ BasicImageLayer::GetAndPaintCurrentImage(gfxContext* aContext,
// The visible region can extend outside the image, so just draw
// within the image bounds.
if (aContext) {
gfxContext::GraphicsOperator mixBlendMode = GetEffectiveMixBlendMode();
AutoSetOperator setOptimizedOperator(aContext, mixBlendMode != gfxContext::OPERATOR_OVER ? mixBlendMode : GetOperator());
CompositionOp mixBlendMode = GetEffectiveMixBlendMode();
CompositionOp op =
mixBlendMode != CompositionOp::OP_OVER ? mixBlendMode : GetOperator();
AutoSetOperator setOptimizedOperator(aContext, ThebesOp(op));
PaintContext(pat,
nsIntRegion(nsIntRect(0, 0, size.width, size.height)),