Improve gpu tracing when applying markers directly to gpu target
- Change the debug marker strings sent by the GrGpuGL target to only grab the last object
added to the set of active markers. This improves the readability when we end up with a
large stack of trace markers. Any trace markers the come from the IODB will continue to
be squashed into a single debug marker
- Added some more useful, high level markers
BUG=skia:
R=bsalomon@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/378933002
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a0e4076..0dbc2fb 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -344,6 +344,7 @@
///////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::clear(SkColor color) {
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::clear", fContext);
SkIRect rect = SkIRect::MakeWH(this->width(), this->height());
fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget);
fNeedClear = false;
@@ -351,6 +352,7 @@
void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw, false);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPaint", fContext);
GrPaint grPaint;
SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
@@ -471,6 +473,7 @@
void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
const SkPaint& paint) {
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawRRect", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw, false);
@@ -559,6 +562,7 @@
void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
const SkPaint& paint) {
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawOval", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw, false);
@@ -724,6 +728,7 @@
bool pathIsMutable) {
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw, false);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPath", fContext);
GrPaint grPaint;
SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
@@ -1500,6 +1505,7 @@
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);
SkGpuDevice* dev = static_cast<SkGpuDevice*>(device);
if (dev->fNeedClear) {
// TODO: could check here whether we really need to draw at all
@@ -1605,6 +1611,7 @@
const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw, false);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawVertices", fContext);
// If both textures and vertex-colors are NULL, strokes hairlines with the paint's color.
if ((NULL == texs || NULL == paint.getShader()) && NULL == colors) {
texs = NULL;
@@ -1678,6 +1685,7 @@
size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw, false);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawText", fContext);
if (fMainTextContext->canDraw(paint)) {
GrPaint grPaint;