Chromium Code Reviews| Index: src/gpu/GrContext.cpp |
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
| index c7e343393879798172444314c04534b29394bed1..1574c8504656fcf43e204d9a15cec55c6e320dc6 100644 |
| --- a/src/gpu/GrContext.cpp |
| +++ b/src/gpu/GrContext.cpp |
| @@ -101,6 +101,7 @@ GrContext::GrContext() { |
| fOvalRenderer = NULL; |
| fViewMatrix.reset(); |
| fMaxTextureSizeOverride = 1 << 20; |
| + fGpuTracingEnabled = true; |
|
bsalomon
2014/03/17 17:50:38
Let's start with false.
egdaniel
2014/03/17 19:49:12
That's the plan. Just set that way right now for e
|
| } |
| bool GrContext::init(GrBackend backend, GrBackendContext backendContext) { |
| @@ -770,6 +771,8 @@ void GrContext::drawRect(const GrPaint& paint, |
| AutoCheckFlush acf(this); |
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_DRAW_RECT", target); |
| + |
| SkScalar width = stroke == NULL ? -1 : stroke->getWidth(); |
| SkMatrix combinedMatrix = target->drawState()->getViewMatrix(); |
| if (NULL != matrix) { |
| @@ -948,6 +951,8 @@ void GrContext::drawVertices(const GrPaint& paint, |
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_DRAW_VERTICES", target); |
| + |
| GrDrawState* drawState = target->drawState(); |
| int colorOffset = -1, texOffset = -1; |
| @@ -1001,6 +1006,8 @@ void GrContext::drawRRect(const GrPaint& paint, |
| AutoCheckFlush acf(this); |
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_DRAW_ROUND_REC", target); |
|
bsalomon
2014/03/17 17:50:38
.._RECT (T)
|
| + |
| if (!fOvalRenderer->drawSimpleRRect(target, this, paint.isAntiAlias(), rect, stroke)) { |
| SkPath path; |
| path.addRRect(rect); |
| @@ -1021,6 +1028,8 @@ void GrContext::drawOval(const GrPaint& paint, |
| AutoCheckFlush acf(this); |
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_DRAW_OVAL", target); |
| + |
| if (!fOvalRenderer->drawOval(target, this, paint.isAntiAlias(), oval, stroke)) { |
| SkPath path; |
| path.addOval(oval); |
| @@ -1097,11 +1106,14 @@ void GrContext::drawPath(const GrPaint& paint, const SkPath& path, const SkStrok |
| // cache. This presents a potential hazard for buffered drawing. However, |
| // the writePixels that uploads to the scratch will perform a flush so we're |
| // OK. |
| + |
| AutoRestoreEffects are; |
| AutoCheckFlush acf(this); |
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); |
| GrDrawState* drawState = target->drawState(); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_DRAW_PATH", target); |
| + |
| bool useCoverageAA = paint.isAntiAlias() && !drawState->getRenderTarget()->isMultisampled(); |
| if (useCoverageAA && stroke.getWidth() < 0 && !path.isConvex()) { |
| @@ -1137,6 +1149,9 @@ void GrContext::internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& |
| const SkStrokeRec& origStroke) { |
| SkASSERT(!path.isEmpty()); |
| + GR_CREATE_GPU_TRACE_MARKER("Test_marker_INTERNAL_DRAW_PATH", target); |
| + |
| + |
| // An Assumption here is that path renderer would use some form of tweaking |
| // the src color (either the input alpha or in the frag shader) to implement |
| // aa. If we have some future driver-mojo path AA that can do the right |
| @@ -1231,6 +1246,7 @@ bool GrContext::readTexturePixels(GrTexture* texture, |
| ASSERT_OWNED_RESOURCE(texture); |
| GrRenderTarget* target = texture->asRenderTarget(); |
| + |
| if (NULL != target) { |
| return this->readRenderTargetPixels(target, |
| left, top, width, height, |