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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 174123003: Add hooks for GL_EXT_debug_marker in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 0909e08dc85cd0784c0a7fe0b7474d9c6588d086..424c39115f36e26b33fdd9158f76e7d4f0a2df80 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -88,7 +88,8 @@ void GrDrawTarget::DrawInfo::adjustStartIndex(int indexOffset) {
GrDrawTarget::GrDrawTarget(GrContext* context)
: fClip(NULL)
- , fContext(context) {
+ , fContext(context)
+ , fDebugPushCount(0) {
SkASSERT(NULL != context);
fDrawState = &fDefaultDrawState;
@@ -547,6 +548,28 @@ void GrDrawTarget::drawPath(const GrPath* path, SkPath::FillType fill) {
this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL);
}
+void GrDrawTarget::insertEventMarker(const char* marker) {
+ if (this->caps()->debugMarkerSupport()) {
+ this->onInsertEventMarker(marker);
+ }
+}
+
+void GrDrawTarget::pushGroupMarker(const char* marker) {
+ SkASSERT(0 <= fDebugPushCount);
+ if (this->caps()->debugMarkerSupport()) {
+ this->onPushGroupMarker(marker);
+ ++fDebugPushCount;
+ }
+}
+
+void GrDrawTarget::popGroupMarker() {
+ SkASSERT(1 <= fDebugPushCount);
bsalomon 2014/02/21 15:33:03 We only require yodaspeak when using == (to void a
+ if (this->caps()->debugMarkerSupport()) {
+ this->onPopGroupMarker();
+ --fDebugPushCount;
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
bool GrDrawTarget::willUseHWAALines() const {
@@ -971,6 +994,7 @@ void GrDrawTargetCaps::reset() {
fPathRenderingSupport = false;
fDstReadInShaderSupport = false;
fReuseScratchTextures = true;
+ fDebugMarkerSupport = false;
fMaxRenderTargetSize = 0;
fMaxTextureSize = 0;
@@ -993,6 +1017,7 @@ GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
fPathRenderingSupport = other.fPathRenderingSupport;
fDstReadInShaderSupport = other.fDstReadInShaderSupport;
fReuseScratchTextures = other.fReuseScratchTextures;
+ fDebugMarkerSupport = other.fDebugMarkerSupport;
fMaxRenderTargetSize = other.fMaxRenderTargetSize;
fMaxTextureSize = other.fMaxTextureSize;
@@ -1019,6 +1044,7 @@ SkString GrDrawTargetCaps::dump() const {
r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]);
r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]);
r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]);
+ r.appendf("Debug Marker Support : %s\n", gNY[fDebugMarkerSupport]);
r.appendf("Max Texture Size : %d\n", fMaxTextureSize);
r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
r.appendf("Max Sample Count : %d\n", fMaxSampleCount);

Powered by Google App Engine
This is Rietveld 408576698