Remove ifdefs from RenderTrace and enable it on composite

--HG--
extra : rebase_source : 6d6af824d02b90ac0e43855ce179aa0233b40c5b
This commit is contained in:
Jeff Muizelaar 2012-02-21 20:20:14 -05:00
Родитель 8d197f4d70
Коммит ceaa4127a7
4 изменённых файлов: 19 добавлений и 29 удалений

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

@ -43,14 +43,13 @@
// Uncomment this line to enable RENDERTRACE
//#define MOZ_RENDERTRACE
#ifdef MOZ_RENDERTRACE
#include "gfx3DMatrix.h"
#include "nsRect.h"
#ifndef GFX_RENDERTRACE_H
#define GFX_RENDERTRACE_H
#include "gfx3DMatrix.h"
#include "nsRect.h"
namespace mozilla {
namespace layers {
@ -61,9 +60,19 @@ void RenderTraceLayers(Layer *aLayer, const char *aColor, gfx3DMatrix aRootTrans
void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, nsIntRect aRect);
void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor);
#ifndef MOZ_RENDERTRACE
inline void RenderTraceLayers(Layer *aLayer, const char *aColor, gfx3DMatrix aRootTransform, bool aReset)
{}
inline void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, nsIntRect aRect)
{}
inline void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor)
{}
#endif // MOZ_RENDERTRACE
}
}
#endif //GFX_RENDERTRACE_H
#endif // MOZ_RENDERTRACE

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

@ -690,9 +690,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
nsIntRegion toDraw = IntersectWithClip(GetEffectiveVisibleRegion(), aContext);
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateStart(this, "FF00", toDraw.GetBounds());
#endif
if (!toDraw.IsEmpty() && !IsHidden()) {
if (!aCallback) {
@ -730,9 +728,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
aContext->Restore();
}
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateEnd(this, "FF00");
#endif
return;
}
@ -759,9 +755,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
nsIntRegion extendedDrawRegion = state.mRegionToDraw;
SetAntialiasingFlags(this, state.mContext);
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateStart(this, "FF00", state.mRegionToDraw.GetBounds());
#endif
PaintBuffer(state.mContext,
state.mRegionToDraw, extendedDrawRegion, state.mRegionToInvalidate,
@ -769,9 +763,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
aCallback, aCallbackData);
Mutated();
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateEnd(this, "FF00");
#endif
} else {
// It's possible that state.mRegionToInvalidate is nonempty here,
// if we are shrinking the valid region to nothing.
@ -1617,10 +1609,8 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
mPhase = PHASE_DRAWING;
#endif
#ifdef MOZ_RENDERTRACE
Layer* aLayer = GetRoot();
RenderTraceLayers(aLayer, "FF00");
#endif
mTransactionIncomplete = false;

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

@ -43,6 +43,7 @@
#include "LayerManagerOGL.h"
#include "nsIWidget.h"
#include "nsGkAtoms.h"
#include "RenderTrace.h"
#if defined(MOZ_WIDGET_ANDROID)
#include "AndroidBridge.h"
@ -177,17 +178,15 @@ CompositorParent::Composite()
return;
}
#ifdef MOZ_RENDERTRACE
Layer* aLayer = mLayerManager->GetRoot();
mozilla::layers::RenderTraceLayers(aLayer, "0000");
#endif
#ifdef MOZ_WIDGET_ANDROID
RequestViewTransform();
printf_stderr("Correcting for position fixed %i, %i\n", -mScrollOffset.x, -mScrollOffset.y);
TransformShadowTree();
#endif
Layer* aLayer = mLayerManager->GetRoot();
mozilla::layers::RenderTraceLayers(aLayer, "0000");
mLayerManager->EndEmptyTransaction();
#ifdef COMPOSITOR_PERFORMANCE_WARNING

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

@ -323,9 +323,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
static_cast<ShadowThebesLayer*>(shadow->AsLayer());
const ThebesBuffer& newFront = op.newFrontBuffer();
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateStart(thebes, "00FF", op.updatedRegion().GetBounds());
#endif
OptionalThebesBuffer newBack;
nsIntRegion newValidRegion;
@ -340,9 +338,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
newBack, newValidRegion,
readonlyFront, frontUpdatedRegion));
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateEnd(thebes, "00FF");
#endif
break;
}
case Edit::TOpPaintCanvas: {
@ -353,9 +349,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
ShadowCanvasLayer* canvas =
static_cast<ShadowCanvasLayer*>(shadow->AsLayer());
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateStart(canvas, "00FF", canvas->GetVisibleRegion().GetBounds());
#endif
canvas->SetAllocator(this);
CanvasSurface newBack;
@ -364,9 +358,7 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
replyv.push_back(OpBufferSwap(shadow, NULL,
newBack));
#ifdef MOZ_RENDERTRACE
RenderTraceInvalidateEnd(canvas, "00FF");
#endif
break;
}
case Edit::TOpPaintImage: {