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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1580023002: GrAuditTrail hooks in GrContext + GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@audittrail-3-gatherframes
Patch Set: tweaks Created 4 years, 11 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 497af7ce9b764fa0b64c21b2759db1e68e1753c7..c471dca1be6d99e7b1c5149dbb12b4c8f60b027f 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -26,6 +26,8 @@
#include "text/GrAtlasTextContext.h"
#include "text/GrStencilAndCoverTextContext.h"
+#include "../private/GrAuditTrail.h"
+
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fDrawingManager->getContext())
#define ASSERT_SINGLE_OWNER \
SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);)
@@ -51,12 +53,14 @@ private:
GrDrawContext::GrDrawContext(GrDrawingManager* drawingMgr,
GrRenderTarget* rt,
const SkSurfaceProps* surfaceProps,
+ GrAuditTrail* auditTrail,
GrSingleOwner* singleOwner)
: fDrawingManager(drawingMgr)
, fRenderTarget(rt)
, fDrawTarget(SkSafeRef(rt->getLastDrawTarget()))
, fTextContext(nullptr)
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
+ , fAuditTrail(auditTrail)
#ifdef SK_DEBUG
, fSingleOwner(singleOwner)
#endif
@@ -95,6 +99,7 @@ void GrDrawContext::copySurface(GrSurface* src, const SkIRect& srcRect, const Sk
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::copySurface");
this->getDrawTarget()->copySurface(fRenderTarget, src, srcRect, dstPoint);
}
@@ -107,6 +112,7 @@ void GrDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText");
if (!fTextContext) {
fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
@@ -125,6 +131,7 @@ void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText");
if (!fTextContext) {
fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
@@ -142,6 +149,7 @@ void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob");
if (!fTextContext) {
fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
@@ -154,6 +162,7 @@ void GrDrawContext::discard() {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::discard");
AutoCheckFlush acf(fDrawingManager);
this->getDrawTarget()->discard(fRenderTarget);
@@ -165,6 +174,7 @@ void GrDrawContext::clear(const SkIRect* rect,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::clear");
AutoCheckFlush acf(fDrawingManager);
this->getDrawTarget()->clear(rect, color, canIgnoreRect, fRenderTarget);
@@ -177,6 +187,7 @@ void GrDrawContext::drawPaint(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPaint");
// set rect to be big enough to fill the space, but not super-huge, so we
// don't overflow fixed-point implementations
@@ -243,6 +254,7 @@ void GrDrawContext::drawRect(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawRect");
// Dashing should've been devolved to a path in SkGpuDevice
SkASSERT(!strokeInfo || !strokeInfo->isDashed());
@@ -343,6 +355,7 @@ void GrDrawContext::fillRectToRect(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::fillRectToRect");
AutoCheckFlush acf(fDrawingManager);
@@ -371,6 +384,7 @@ void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::fillRectWithLocalMatrix");
AutoCheckFlush acf(fDrawingManager);
@@ -403,6 +417,7 @@ void GrDrawContext::drawVertices(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawVertices");
AutoCheckFlush acf(fDrawingManager);
@@ -447,6 +462,7 @@ void GrDrawContext::drawAtlas(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawAtlas");
AutoCheckFlush acf(fDrawingManager);
@@ -470,6 +486,7 @@ void GrDrawContext::drawRRect(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawRRect");
if (rrect.isEmpty()) {
return;
@@ -507,6 +524,7 @@ void GrDrawContext::drawDRRect(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawDRRect");
if (outer.isEmpty()) {
return;
@@ -545,6 +563,7 @@ void GrDrawContext::drawOval(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawOval");
if (oval.isEmpty()) {
return;
@@ -582,6 +601,7 @@ void GrDrawContext::drawImageNine(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawImageNine");
AutoCheckFlush acf(fDrawingManager);
@@ -649,6 +669,7 @@ void GrDrawContext::drawBatch(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
AutoCheckFlush acf(fDrawingManager);
@@ -661,6 +682,7 @@ void GrDrawContext::drawPathBatch(const GrPipelineBuilder& pipelineBuilder,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPathBatch");
AutoCheckFlush acf(fDrawingManager);
@@ -675,6 +697,7 @@ void GrDrawContext::drawPath(const GrClip& clip,
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPath");
if (path.isEmpty()) {
if (path.isInverseFillType()) {
@@ -832,6 +855,7 @@ void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
}
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698