Bug 804724 - Add an abort painting marker. r=ehsan
authorBenoit Girard <b56girard@gmail.com>
Tue, 23 Oct 2012 17:18:37 -0400
changeset 111330 daf6a03884ba5acd743c00e0cfa25c6411f079ac
parent 111329 986b4cb7678efd8d7a0b1528649aa340a0dcbf60
child 111331 a882fd383dbb9654d15760bdeb5845545d40ca69
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs804724
milestone19.0a1
Bug 804724 - Add an abort painting marker. r=ehsan
gfx/layers/basic/BasicTiledThebesLayer.cpp
tools/profiler/sps_sampler.h
--- a/gfx/layers/basic/BasicTiledThebesLayer.cpp
+++ b/gfx/layers/basic/BasicTiledThebesLayer.cpp
@@ -269,16 +269,17 @@ BasicTiledThebesLayer::ComputeProgressiv
   }
 
   // Find out the current view transform to determine which tiles to draw
   // first, and see if we should just abort this paint. Aborting is usually
   // caused by there being an incoming, more relevant paint.
   gfx::Rect viewport;
   float scaleX, scaleY;
   if (BasicManager()->ProgressiveUpdateCallback(!freshRegion.IsEmpty(), viewport, scaleX, scaleY)) {
+    SAMPLE_MARKER("Abort painting");
     aRegionToPaint.SetEmpty();
     return aIsRepeated;
   }
 
   // Transform the screen coordinates into local layer coordinates.
   nsIntRect roundedTransformedViewport =
     RoundedTransformViewportBounds(viewport, aScrollOffset, aResolution,
                                    scaleX, scaleY, aTransform);
--- a/tools/profiler/sps_sampler.h
+++ b/tools/profiler/sps_sampler.h
@@ -419,15 +419,18 @@ inline void mozilla_sampler_call_exit(vo
     return;
 
   ProfileStack *stack = (ProfileStack*)aHandle;
   stack->pop();
 }
 
 inline void mozilla_sampler_add_marker(const char *aMarker)
 {
+  if (!stack_key_initialized)
+    return;
+
   ProfileStack *stack = tlsStack.get();
   if (!stack) {
     return;
   }
   stack->addMarker(aMarker);
 }