GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
-#define GR_CREATE_TRACE_MARKER_CONTEXT(name, context) \
+#define GR_CREATE_TRACE_MARKER_CONTEXT(classname, op, context) \
/* Chromium tracing */ \
static int SK_MACRO_APPEND_LINE(name_counter) = 0; \
bool SK_MACRO_APPEND_LINE(gpuTracingEnabled); \
TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), \
&SK_MACRO_APPEND_LINE(gpuTracingEnabled)); \
if (SK_MACRO_APPEND_LINE(gpuTracingEnabled)) { \
- INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, SK_MACRO_APPEND_LINE(name_counter), context)\
+ INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(classname "::" op, \
+ SK_MACRO_APPEND_LINE(name_counter), context) \
} \
- INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), name, \
+ GR_AUDIT_TRAIL_ADDOP(context->getAuditTrail(), SkString(op)); \
+ INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), classname "::" op, \
"id", SK_MACRO_APPEND_LINE(name_counter));
#define INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, name_counter, context) \
void SkGpuDevice::clearAll() {
GrColor color = 0;
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::clearAll", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "clearAll", fContext);
SkIRect rect = SkIRect::MakeWH(this->width(), this->height());
fDrawContext->clear(&rect, color, true);
fNeedClear = false;
void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPaint", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPaint", fContext);
GrPaint grPaint;
if (!SkPaintToGrPaint(this->context(), paint, *draw.fMatrix, &grPaint)) {
///////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRect", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawRRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRRect", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
const SkRRect& inner, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawDRRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDRRect", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
/////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawOval", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawOval", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPath", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPath", fContext);
GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
fClip, origSrcPath, paint,
void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
int x, int y, const SkPaint& paint) {
// clear of the source device must occur before CHECK_SHOULD_DRAW
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawDevice", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDevice", fContext);
SkGpuDevice* dev = static_cast<SkGpuDevice*>(device);
// TODO: If the source device covers the whole of this device, we could
void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* producer,
const SkIRect& center, const SkRect& dst, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawProducerNine", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerNine", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawVertices", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawVertices", fContext);
// If both textures and vertex-colors are nullptr, strokes hairlines with the paint's color.
if ((nullptr == texs || nullptr == paint.getShader()) && nullptr == colors) {
}
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext);
SkPaint p(paint);
p.setShader(atlas->newShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode))->unref();
size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext);
GrPaint grPaint;
if (!SkPaintToGrPaint(this->context(), paint, *draw.fMatrix, &grPaint)) {
void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, size_t byteLength,
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPosText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPosText", fContext);
CHECK_SHOULD_DRAW(draw);
GrPaint grPaint;
void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint, SkDrawFilter* drawFilter) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawTextBlob", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawTextBlob", fContext);
CHECK_SHOULD_DRAW(draw);
SkDEBUGCODE(this->validate();)
void SkGpuDevice::flush() {
DO_DEFERRED_CLEAR();
fRenderTarget->prepareForExternalIO();
+
+ // Clear batch debugging output
+ if (GR_BATCH_DEBUGGING_OUTPUT) {
+ SkDebugf("%s\n", fContext->getAuditTrail()->toJson().c_str());
+ GR_AUDIT_TRAIL_RESET(fContext->getAuditTrail());
+ }
}
///////////////////////////////////////////////////////////////////////////////