Bug 922942 - Clean up some no longer used ShadowLayers code from BasicLayers. r=roc

This commit is contained in:
Matt Woodrow 2013-10-15 16:23:21 +13:00
parent 809492790e
commit 8cf666badb
3 changed files with 4 additions and 32 deletions

View File

@ -598,14 +598,8 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
if (mTarget && mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
nsIntRect clipRect;
if (HasShadowManager()) {
// If this has a shadow manager, the clip extents of mTarget are meaningless.
// So instead just use the root layer's visible region bounds.
const nsIntRect& bounds = mRoot->GetVisibleRegion().GetBounds();
gfxRect deviceRect =
mTarget->UserToDevice(gfxRect(bounds.x, bounds.y, bounds.width, bounds.height));
clipRect = ToOutsideIntRect(deviceRect);
} else {
{
gfxContextMatrixAutoSaveRestore save(mTarget);
mTarget->SetMatrix(gfxMatrix());
clipRect = ToOutsideIntRect(mTarget->GetClipExtents());
@ -854,14 +848,6 @@ BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext,
{
BasicImplData* data = ToData(aPaintContext.mLayer);
if (aPaintContext.mLayer->GetFirstChild() &&
aPaintContext.mLayer->GetMaskLayer() &&
HasShadowManager()) {
// 'paint' the mask so that it gets sent to the shadow layer tree
static_cast<BasicImplData*>(aPaintContext.mLayer->GetMaskLayer()->ImplData())
->Paint(nullptr, nullptr);
}
/* Only paint ourself, or our children - This optimization relies on this! */
Layer* child = aPaintContext.mLayer->GetFirstChild();
if (!child) {
@ -910,7 +896,7 @@ BasicLayerManager::FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipT
BasicContainerLayer* container = static_cast<BasicContainerLayer*>(aPaintContext.mLayer);
AutoSetOperator setOperator(aPaintContext.mTarget, container->GetOperator());
PaintWithMask(aPaintContext.mTarget, aPaintContext.mLayer->GetEffectiveOpacity(),
HasShadowManager() ? nullptr : aPaintContext.mLayer->GetMaskLayer());
aPaintContext.mLayer->GetMaskLayer());
}
}

View File

@ -97,7 +97,7 @@ public:
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags = END_DEFAULT);
virtual bool AreComponentAlphaLayersEnabled() { return HasShadowManager() || !IsWidgetLayerManager(); }
virtual bool AreComponentAlphaLayersEnabled() { return !IsWidgetLayerManager(); }
void AbortTransaction();
@ -145,7 +145,6 @@ public:
virtual bool IsCompositingCheap() { return false; }
virtual int32_t GetMaxTextureSize() const { return INT32_MAX; }
bool CompositorMightResample() { return mCompositorMightResample; }
bool HasShadowTarget() { return !!mShadowTarget; }
protected:
enum TransactionPhase {
@ -187,15 +186,6 @@ protected:
nsRefPtr<gfxContext> mDefaultTarget;
// The context to draw into.
nsRefPtr<gfxContext> mTarget;
// When we're doing a transaction in order to draw to a non-default
// target, the layers transaction is only performed in order to send
// a PLayerTransaction:Update. We save the original non-default target to
// mShadowTarget, and then perform the transaction using
// mDummyTarget as the render target. After the transaction ends,
// we send a message to our remote side to capture the actual pixels
// being drawn to the default target, and then copy those pixels
// back to mShadowTarget.
nsRefPtr<gfxContext> mShadowTarget;
nsRefPtr<gfxContext> mDummyTarget;
// Image factory we use.
nsRefPtr<ImageFactory> mFactory;

View File

@ -100,10 +100,6 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
if (aReadback && UsedForReadback()) {
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
}
//TODO: This is going to copy back pixels that we might end up
// drawing over anyway. It would be nice if we could avoid
// this duplication.
mContentClient->SyncFrontBufferToBackBuffer();
bool canUseOpaqueSurface = CanUseOpaqueSurface();
ContentType contentType =