Backing out bug 615870 34bd12eb4a9c for causing bug 618916, a=stuart

This commit is contained in:
Michael Wu 2010-12-13 16:15:16 -08:00
Родитель 69fa90186a adc8f28efe
Коммит d79418c635
14 изменённых файлов: 17 добавлений и 108 удалений

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

@ -305,22 +305,10 @@ public:
* During the drawing phase, all ThebesLayers in the tree are
* drawn in tree order, exactly once each, except for those layers
* where it is known that the visible region is empty.
*
* If aCallback is null, this is a 'null' transaction.
* There must have been no updates to the layer tree in this transaction.
* A null transaction can fail, in which case EndTransaction returns false,
* and the transaction must be retried with aCallback set to something non-null.
*
* If IsNullTransactionSupported() returns false, then aCallback must be non-null.
*/
virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData) = 0;
/**
* See EndTransaction description
*/
virtual bool IsNullTransactionSupported() { return false; }
PRBool IsSnappingEffectiveTransforms() { return mSnapEffectiveTransforms; }
/**

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

@ -502,11 +502,6 @@ BasicThebesLayer::Paint(gfxContext* aContext,
nsIntRegion toDraw = IntersectWithClip(mVisibleRegion, target);
if (!toDraw.IsEmpty()) {
if (!aCallback) {
BasicManager()->SetTransactionIncomplete();
return;
}
target->Save();
gfxUtils::ClipToRegionSnapped(target, toDraw);
if (opacity != 1.0) {
@ -1020,7 +1015,6 @@ BasicLayerManager::BasicLayerManager(nsIWidget* aWidget) :
, mYResolution(1.0)
, mWidget(aWidget)
, mDoubleBuffering(BUFFER_NONE), mUsingDefaultTarget(PR_FALSE)
, mTransactionIncomplete(false)
{
MOZ_COUNT_CTOR(BasicLayerManager);
NS_ASSERTION(aWidget, "Must provide a widget");
@ -1191,7 +1185,7 @@ MarkLeafLayersCoveredByOpaque(Layer* aLayer, const nsIntRect& aClipRect,
}
}
bool
void
BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
@ -1200,8 +1194,6 @@ BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
Log();
#endif
mTransactionIncomplete = false;
NS_ASSERTION(InConstruction(), "Should be in construction phase");
#ifdef DEBUG
mPhase = PHASE_DRAWING;
@ -1234,12 +1226,6 @@ BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
mRoot->GetEffectiveVisibleRegion().GetBounds(),
region);
PaintLayer(mRoot, aCallback, aCallbackData);
if (mTransactionIncomplete) {
#ifdef DEBUG
mPhase = PHASE_NONE;
#endif
return false;
}
if (useDoubleBuffering) {
finalTarget->SetOperator(gfxContext::OPERATOR_SOURCE);
@ -1258,7 +1244,6 @@ BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
mPhase = PHASE_NONE;
#endif
mUsingDefaultTarget = PR_FALSE;
return true;
}
void
@ -1324,16 +1309,10 @@ BasicLayerManager::PaintLayer(Layer* aLayer,
#endif
if (!data->IsCoveredByOpaque()) {
data->Paint(mTarget, aCallback, aCallbackData);
if (mTransactionIncomplete) {
return;
}
}
} else {
for (; child; child = child->GetNextSibling()) {
PaintLayer(child, aCallback, aCallbackData);
if (mTransactionIncomplete) {
return;
}
}
}
@ -1658,11 +1637,6 @@ BasicShadowableThebesLayer::PaintBuffer(gfxContext* aContext,
LayerManager::DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
if (!aCallback) {
BasicManager()->SetTransactionIncomplete();
mIsNewBuffer = false;
return;
}
Base::PaintBuffer(aContext, aRegionToDraw, aRegionToInvalidate,
aCallback, aCallbackData);
if (!HasShadow()) {
@ -2557,21 +2531,11 @@ BasicShadowLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
BasicLayerManager::BeginTransactionWithTarget(aTarget);
}
bool
void
BasicShadowLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
if (!BasicLayerManager::EndTransaction(aCallback, aCallbackData)) {
NS_WARNING("Failed to finish transaction, clear mKeepAlive");
if (HasShadowManager())
ShadowLayerForwarder::EndTransaction(nsnull);
mKeepAlive.Clear();
#ifdef DEBUG
mPhase = PHASE_NONE;
#endif
return false;
}
BasicLayerManager::EndTransaction(aCallback, aCallbackData);
#ifdef DEBUG
mPhase = PHASE_FORWARD;
#endif
@ -2628,7 +2592,6 @@ BasicShadowLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
// this may result in Layers being deleted, which results in
// PLayer::Send__delete__() and DeallocShmem()
mKeepAlive.Clear();
return true;
}
ShadowableLayer*

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

@ -140,7 +140,7 @@ public:
virtual void BeginTransaction();
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData);
virtual void SetRoot(Layer* aLayer);
@ -181,10 +181,6 @@ public:
// Clear the cached contents of this layer.
void ClearCachedResources();
bool IsNullTransactionSupported() { return mRoot ? true : false; }
void SetTransactionIncomplete() { mTransactionIncomplete = true; }
protected:
#ifdef DEBUG
enum TransactionPhase {
@ -225,7 +221,6 @@ private:
BufferMode mDoubleBuffering;
PRPackedBool mUsingDefaultTarget;
bool mTransactionIncomplete;
};
@ -240,7 +235,7 @@ public:
virtual ~BasicShadowLayerManager();
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData);
virtual void SetRoot(Layer* aLayer);

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

@ -230,7 +230,7 @@ LayerManagerD3D10::BeginTransactionWithTarget(gfxContext* aTarget)
mTarget = aTarget;
}
bool
void
LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
@ -245,7 +245,6 @@ LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
mCurrentCallbackInfo.Callback = nsnull;
mCurrentCallbackInfo.CallbackData = nsnull;
mTarget = nsnull;
return true;
}
already_AddRefed<ThebesLayer>

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

@ -104,7 +104,7 @@ public:
void *CallbackData;
};
bool EndTransaction(DrawThebesLayerCallback aCallback,
void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData);
const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }

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

@ -149,7 +149,7 @@ LayerManagerD3D9::EndConstruction()
{
}
bool
void
LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
@ -166,7 +166,6 @@ LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
mCurrentCallbackInfo.CallbackData = NULL;
// Clear mTarget, next transaction could have no target
mTarget = NULL;
return true;
}
void

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

@ -132,7 +132,7 @@ public:
void *CallbackData;
};
bool EndTransaction(DrawThebesLayerCallback aCallback,
void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData);
const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }

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

@ -392,7 +392,7 @@ LayerManagerOGL::BeginTransactionWithTarget(gfxContext *aTarget)
mTarget = aTarget;
}
bool
void
LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData)
{
@ -403,7 +403,7 @@ LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
if (mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
return false;
return;
}
// The results of our drawing always go directly into a pixel buffer,
@ -427,7 +427,6 @@ LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
Log();
MOZ_LAYERS_LOG(("]----- EndTransaction"));
#endif
return true;
}
already_AddRefed<ThebesLayer>

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

@ -133,7 +133,7 @@ public:
void EndConstruction();
virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData);
virtual void SetRoot(Layer* aLayer) { mRoot = aLayer; }

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

@ -2389,8 +2389,7 @@ nsRootPresContext::nsRootPresContext(nsIDocument* aDocument,
: nsPresContext(aDocument, aType),
mUpdatePluginGeometryForFrame(nsnull),
mDOMGeneration(0),
mNeedsToUpdatePluginGeometry(PR_FALSE),
mUpdateLayerTree(false)
mNeedsToUpdatePluginGeometry(PR_FALSE)
{
mRegisteredPlugins.Init();
}

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

@ -1275,9 +1275,6 @@ public:
*/
PRUint32 GetDOMGeneration() { return mDOMGeneration; }
void SetNeedToUpdateLayerTree(bool aUpdate) { mUpdateLayerTree = aUpdate; }
bool NeedToUpdateLayerTree() { return mUpdateLayerTree; }
private:
nsTHashtable<nsPtrHashKey<nsObjectFrame> > mRegisteredPlugins;
// if mNeedsToUpdatePluginGeometry is set, then this is the frame to
@ -1286,7 +1283,6 @@ private:
nsIFrame* mUpdatePluginGeometryForFrame;
PRUint32 mDOMGeneration;
PRPackedBool mNeedsToUpdatePluginGeometry;
bool mUpdateLayerTree;
};
inline void

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

@ -6073,19 +6073,6 @@ PresShell::Paint(nsIView* aDisplayRoot,
NS_ASSERTION(aViewToPaint, "null view");
NS_ASSERTION(aWidgetToPaint, "Can't paint without a widget");
nsRootPresContext* rootPC = presContext->GetRootPresContext();
if (!rootPC->NeedToUpdateLayerTree() && aWidgetToPaint) {
LayerManager* layerManager = aWidgetToPaint->GetLayerManager();
NS_ASSERTION(layerManager, "Must be in paint event");
if (layerManager->IsNullTransactionSupported()) {
layerManager->BeginTransaction();
if (layerManager->EndTransaction(nsnull, nsnull)) {
return NS_OK;
}
}
}
rootPC->SetNeedToUpdateLayerTree(false);
nscolor bgcolor = ComputeBackstopColor(aDisplayRoot);
nsIFrame* frame = aPaintDefaultBackground

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

@ -3950,14 +3950,7 @@ nsIFrame::InvalidateLayer(const nsRect& aDamageRect, PRUint32 aDisplayItemKey)
return;
}
nsRootPresContext* rootPC = PresContext()->GetRootPresContext();
PRUint32 flags = INVALIDATE_NO_THEBES_LAYERS;
if (aDisplayItemKey == nsDisplayItem::TYPE_VIDEO ||
aDisplayItemKey == nsDisplayItem::TYPE_PLUGIN) {
flags = INVALIDATE_NO_UPDATE_LAYER_TREE;
}
InvalidateWithFlags(aDamageRect, flags);
InvalidateWithFlags(aDamageRect, INVALIDATE_NO_THEBES_LAYERS);
}
class LayerActivity {
@ -4051,18 +4044,12 @@ nsIFrame::InvalidateWithFlags(const nsRect& aDamageRect, PRUint32 aFlags)
// Don't allow invalidates to do anything when
// painting is suppressed.
nsPresContext* context = PresContext();
nsIPresShell *shell = context->GetPresShell();
nsIPresShell *shell = PresContext()->GetPresShell();
if (shell) {
if (shell->IsPaintingSuppressed())
return;
}
if (!(aFlags & INVALIDATE_NO_UPDATE_LAYER_TREE)) {
nsRootPresContext* rootPC = context->GetRootPresContext();
rootPC->SetNeedToUpdateLayerTree(true);
}
InvalidateInternal(aDamageRect, 0, 0, nsnull, aFlags);
}

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

@ -2038,8 +2038,6 @@ public:
* This flag is useful when, during painting, FrameLayerBuilder discovers that
* a region of the window needs to be drawn differently, and that region
* may or may not be contained in the currently painted region.
* @param aFlags INVALIDATE_NO_UPDATE_LAYER_TREE: invalidate only in the Non-Thebes Layers
* Video, Plugin.
*/
enum {
INVALIDATE_IMMEDIATE = 0x01,
@ -2050,8 +2048,7 @@ public:
INVALIDATE_REASON_SCROLL_REPAINT,
INVALIDATE_NO_THEBES_LAYERS = 0x10,
INVALIDATE_ONLY_THEBES_LAYERS = 0x20,
INVALIDATE_EXCLUDE_CURRENT_PAINT = 0x40,
INVALIDATE_NO_UPDATE_LAYER_TREE = 0x80
INVALIDATE_EXCLUDE_CURRENT_PAINT = 0x40
};
virtual void InvalidateInternal(const nsRect& aDamageRect,
nscoord aOffsetX, nscoord aOffsetY,