Make debugging whole-layer invalidation slightly easier. (bug 1128752, r=mattwoodrow)

This commit is contained in:
David Anderson 2015-02-03 14:18:44 -08:00
parent e5ff441e0a
commit f3d2d75a87
6 changed files with 19 additions and 7 deletions

View File

@ -786,7 +786,7 @@ ContentClientIncremental::BeginPaintBuffer(PaintedLayer* aLayer,
if ((mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) != mHasBufferOnWhite) {
printf_stderr("Layer's component alpha status has changed\n");
}
printf_stderr("Invalidating entire layer %p\n", aLayer);
printf_stderr("Invalidating entire layer %p: no buffer, or content type or component alpha changed\n", aLayer);
}
#endif
// We're effectively clearing the valid region, so we need to draw

View File

@ -972,8 +972,7 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
RenderTraceLayers(mLayerManager->GetRoot(), "0000");
#ifdef MOZ_DUMP_PAINTING
static bool gDumpCompositorTree = false;
if (gDumpCompositorTree) {
if (gfxPrefs::DumpHostLayers()) {
printf_stderr("Painting --- compositing layer tree:\n");
mLayerManager->Dump();
}

View File

@ -276,6 +276,8 @@ private:
DECL_GFX_PREF(Live, "layers.dump-texture", LayersDumpTexture, bool, false);
#ifdef MOZ_DUMP_PAINTING
DECL_GFX_PREF(Live, "layers.dump-decision", LayersDumpDecision, bool, false);
DECL_GFX_PREF(Live, "layers.dump-client-layers", DumpClientLayers, bool, false);
DECL_GFX_PREF(Live, "layers.dump-host-layers", DumpHostLayers, bool, false);
#endif
// 0 is "no change" for contrast, positive values increase it, negative values

View File

@ -32,6 +32,7 @@
#include "mozilla/gfx/Tools.h"
#include "mozilla/gfx/2D.h"
#include "gfxPrefs.h"
#include "LayersLogging.h"
#include <algorithm>
@ -1649,11 +1650,11 @@ ResetScrollPositionForLayerPixelAlignment(const nsIFrame* aAnimatedGeometryRoot)
}
static void
InvalidateEntirePaintedLayer(PaintedLayer* aLayer, const nsIFrame* aAnimatedGeometryRoot)
InvalidateEntirePaintedLayer(PaintedLayer* aLayer, const nsIFrame* aAnimatedGeometryRoot, const char *aReason)
{
#ifdef MOZ_DUMP_PAINTING
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
printf_stderr("Invalidating entire layer %p\n", aLayer);
printf_stderr("Invalidating entire layer %p: %s\n", aLayer, aReason);
}
#endif
nsIntRect invalidate = aLayer->GetValidRegion().GetBounds();
@ -1722,7 +1723,7 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
printf_stderr("Recycled layer %p changed scale\n", layer.get());
}
#endif
InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot);
InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot, "recycled layer changed state");
#ifndef MOZ_WIDGET_ANDROID
didResetScrollPositionForLayerPixelAlignment = true;
#endif
@ -1798,7 +1799,7 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
// from what we need.
if (!animatedGeometryRootTopLeft.WithinEpsilonOf(data->mAnimatedGeometryRootPosition, SUBPIXEL_OFFSET_EPSILON)) {
data->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft;
InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot);
InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot, "subpixel offset");
} else if (didResetScrollPositionForLayerPixelAlignment) {
data->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft;
}

View File

@ -3227,6 +3227,14 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
#endif
}
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::DumpClientLayers()) {
std::stringstream ss;
FrameLayerBuilder::DumpRetainedLayerTree(layerManager, ss, false);
printf_stderr("%s", ss.str().c_str());
}
#endif
// Update the widget's opaque region information. This sets
// glass boundaries on Windows. Also set up the window dragging region
// and plugin clip regions and bounds.

View File

@ -3923,6 +3923,8 @@ pref("layers.dump", false);
// If we're dumping layers, also dump the texture data
pref("layers.dump-texture", false);
pref("layers.dump-decision", false);
pref("layers.dump-client-layers", false);
pref("layers.dump-host-layers", false);
#endif
pref("layers.draw-borders", false);
pref("layers.draw-tile-borders", false);