Enable WebKit/Chromium style logging for Skia.
New macros called in Ganesh functions; by default are compiled away,
in example code resolve to printout, and are compatible with WebKit/Chromium
event logging and GPU profiler.
git-svn-id: http://skia.googlecode.com/svn/trunk@1770 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrPathRenderer.cpp b/gpu/src/GrPathRenderer.cpp
index 1795bd4..b565838 100644
--- a/gpu/src/GrPathRenderer.cpp
+++ b/gpu/src/GrPathRenderer.cpp
@@ -6,6 +6,9 @@
#include "GrMemory.h"
#include "GrTexture.h"
+#include "SkString.h"
+#include SK_USER_TRACE_INCLUDE_FILE
+
GrPathRenderer::GrPathRenderer()
: fCurveTolerance (GR_Scalar1) {
@@ -191,6 +194,8 @@
GrPathFill fill,
const GrPoint* translate,
bool stencilOnly) {
+ SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath",
+ "points", SkStringPrintf("%i", path.countPoints()).c_str());
GrDrawTarget::AutoStateRestore asr(target);
bool colorWritesWereDisabled = target->isColorWriteDisabled();
@@ -334,7 +339,10 @@
SkPath::Iter iter(path, false);
+ {
+ SK_TRACE_EVENT0("GrDefaultPathRenderer::onDrawPath::assembleVerts");
for (;;) {
+
GrPathCmd cmd = (GrPathCmd)iter.next(pts);
switch (cmd) {
case kMove_PathCmd:
@@ -371,6 +379,7 @@
}
first = false;
}
+ }
FINISHED:
GrAssert(subpath == subpathCnt);
GrAssert((vert - base) <= maxPts);
@@ -406,6 +415,9 @@
bounds.fBottom);
}
+ {
+ SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath::renderPasses",
+ "verts", SkStringPrintf("%i", vert - base).c_str());
for (int p = 0; p < passCount; ++p) {
target->setDrawFace(drawFace[p]);
if (NULL != passes[p]) {
@@ -432,6 +444,7 @@
}
}
}
+ }
}
void GrDefaultPathRenderer::drawPath(GrDrawTarget* target,