Bug 1477471 - Implement PushLayerWithBlend for DrawTargetTiled. r=jrmuizel

This commit is contained in:
Kartikaya Gupta 2018-07-24 14:06:23 -04:00
Родитель 886f9bb742
Коммит 3dfe60b882
2 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -347,6 +347,29 @@ DrawTargetTiled::PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask,
SetPermitSubpixelAA(aOpaque);
}
void
DrawTargetTiled::PushLayerWithBlend(bool aOpaque, Float aOpacity,
SourceSurface* aMask,
const Matrix& aMaskTransform,
const IntRect& aBounds,
bool aCopyBackground,
CompositionOp aOp)
{
// XXX - not sure this is what we want or whether we want to continue drawing to a larger
// intermediate surface, that would require tweaking the code in here a little though.
for (size_t i = 0; i < mTiles.size(); i++) {
if (!mTiles[i].mClippedOut) {
IntRect bounds = aBounds;
bounds.MoveBy(-mTiles[i].mTileOrigin);
mTiles[i].mDrawTarget->PushLayerWithBlend(aOpaque, aOpacity, aMask, aMaskTransform, bounds, aCopyBackground, aOp);
}
}
PushedLayer layer(GetPermitSubpixelAA());
mPushedLayers.push_back(layer);
SetPermitSubpixelAA(aOpaque);
}
void
DrawTargetTiled::PopLayer()
{

Просмотреть файл

@ -116,6 +116,12 @@ public:
const Matrix& aMaskTransform,
const IntRect& aBounds = IntRect(),
bool aCopyBackground = false) override;
virtual void PushLayerWithBlend(bool aOpaque, Float aOpacity,
SourceSurface* aMask,
const Matrix& aMaskTransform,
const IntRect& aBounds = IntRect(),
bool aCopyBackground = false,
CompositionOp = CompositionOp::OP_OVER) override;
virtual void PopLayer() override;