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

@@ -9,6 +9,8 @@
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsISupportsImpl.h" // for Layer::AddRef, etc
#include "gfx2DGlue.h"
class gfxContext;
using namespace mozilla::gfx;
@@ -18,17 +20,39 @@ namespace mozilla {
namespace layers {
void
BasicCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
BasicCanvasLayer::Paint(DrawTarget* aTarget, SourceSurface* aMaskSurface)
{
if (IsHidden())
return;
FirePreTransactionCallback();
UpdateSurface();
UpdateTarget();
FireDidTransactionCallback();
gfxContext::GraphicsOperator mixBlendMode = GetEffectiveMixBlendMode();
PaintWithOpacity(aContext, GetEffectiveOpacity(), aMaskLayer, mixBlendMode != gfxContext::OPERATOR_OVER ? mixBlendMode : GetOperator());
CompositionOp mixBlendMode = GetEffectiveMixBlendMode();
PaintWithOpacity(aTarget,
GetEffectiveOpacity(),
aMaskSurface,
mixBlendMode != CompositionOp::OP_OVER ? mixBlendMode : GetOperator());
}
void
BasicCanvasLayer::DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer)
{
if (IsHidden())
return;
FirePreTransactionCallback();
DeprecatedUpdateSurface();
FireDidTransactionCallback();
gfxContext::GraphicsOperator mixBlendMode = DeprecatedGetEffectiveMixBlendMode();
DeprecatedPaintWithOpacity(aContext,
GetEffectiveOpacity(),
aMaskLayer,
mixBlendMode != gfxContext::OPERATOR_OVER ?
mixBlendMode :
DeprecatedGetOperator());
}
already_AddRefed<CanvasLayer>