Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: src/gpu/GrContext.cpp

Issue 184443003: Add Gpu Tracing to Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added files Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c480a1f718dac47a5704979c47f8efd4bae8d050..62d7bb602dd2642e25fd2872c76089104f06418c 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -25,6 +25,7 @@
#include "GrSoftwarePathRenderer.h"
#include "GrStencilBuffer.h"
#include "GrTextStrike.h"
+#include "GrTracing.h"
#include "SkRTConf.h"
#include "SkRRect.h"
#include "SkStrokeRec.h"
@@ -101,6 +102,7 @@ GrContext::GrContext() {
fOvalRenderer = NULL;
fViewMatrix.reset();
fMaxTextureSizeOverride = 1 << 20;
+ fGpuTracingEnabled = false;
}
bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
@@ -774,6 +776,8 @@ void GrContext::drawRect(const GrPaint& paint,
AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ GR_CREATE_TRACE_MARKER("GrContext::drawRect", target);
+
SkScalar width = stroke == NULL ? -1 : stroke->getWidth();
SkMatrix combinedMatrix = target->drawState()->getViewMatrix();
if (NULL != matrix) {
@@ -895,6 +899,8 @@ void GrContext::drawRectToRect(const GrPaint& paint,
AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ GR_CREATE_TRACE_MARKER("GrContext::drawRectToRect", target);
+
target->drawRect(dstRect, dstMatrix, &localRect, localMatrix);
}
@@ -952,6 +958,8 @@ void GrContext::drawVertices(const GrPaint& paint,
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target);
bsalomon 2014/03/20 16:32:53 Make sure you've groked the discussion on the othe
+
GrDrawState* drawState = target->drawState();
int colorOffset = -1, texOffset = -1;
@@ -1005,6 +1013,8 @@ void GrContext::drawRRect(const GrPaint& paint,
AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ GR_CREATE_TRACE_MARKER("GrContext::drawRRect", target);
+
if (!fOvalRenderer->drawSimpleRRect(target, this, paint.isAntiAlias(), rect, stroke)) {
SkPath path;
path.addRRect(rect);
@@ -1025,6 +1035,8 @@ void GrContext::drawOval(const GrPaint& paint,
AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ GR_CREATE_TRACE_MARKER("GrContext::drawOval", target);
+
if (!fOvalRenderer->drawOval(target, this, paint.isAntiAlias(), oval, stroke)) {
SkPath path;
path.addOval(oval);
@@ -1106,6 +1118,8 @@ void GrContext::drawPath(const GrPaint& paint, const SkPath& path, const SkStrok
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
GrDrawState* drawState = target->drawState();
+ GR_CREATE_TRACE_MARKER("GrContext::drawPath", target);
+
bool useCoverageAA = paint.isAntiAlias() && !drawState->getRenderTarget()->isMultisampled();
if (useCoverageAA && stroke.getWidth() < 0 && !path.isConvex()) {
@@ -1141,6 +1155,9 @@ void GrContext::internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath&
const SkStrokeRec& origStroke) {
SkASSERT(!path.isEmpty());
+ GR_CREATE_TRACE_MARKER("GrContext::internalDrawPath", 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

Powered by Google App Engine
This is Rietveld 408576698