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

Unified Diff: tools/debugger/SkDebugCanvas.cpp

Issue 1787843002: Fix up no gpu build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | tools/skiaserve/Request.h » ('j') | tools/skiaserve/Request.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDebugCanvas.cpp
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index cf2652cce4c625f2d03c4351d20262bff1106255..4c58b966080b56aaf047fc987da068bdb1dc9554 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -225,11 +225,13 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
this->markActiveCommands(index);
}
+#if SK_SUPPORT_GPU
// If we have a GPU backend we can also visualize the batching information
GrAuditTrail* at = nullptr;
if (fDrawGpuBatchBounds || m != -1) {
at = this->getAuditTrail(canvas);
}
+#endif
for (int i = 0; i <= index; i++) {
if (i == index && fFilter) {
@@ -424,9 +426,9 @@ GrAuditTrail* SkDebugCanvas::getAuditTrail(SkCanvas* canvas) {
}
void SkDebugCanvas::drawAndCollectBatches(int n, SkCanvas* canvas) {
+#if SK_SUPPORT_GPU
GrAuditTrail* at = this->getAuditTrail(canvas);
if (at) {
-#if SK_SUPPORT_GPU
// loop over all of the commands and draw them, this is to collect reordering
// information
for (int i = 0; i < this->getSize() && i <= n; i++) {
@@ -439,8 +441,8 @@ void SkDebugCanvas::drawAndCollectBatches(int n, SkCanvas* canvas) {
GrAuditTrail::AutoEnable ae(at);
canvas->flush();
}
-#endif
}
+#endif
}
void SkDebugCanvas::cleanupAuditTrail(SkCanvas* canvas) {
@@ -457,7 +459,9 @@ Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanva
this->drawAndCollectBatches(n, canvas);
// now collect json
+#if SK_SUPPORT_GPU
GrAuditTrail* at = this->getAuditTrail(canvas);
+#endif
Json::Value result = Json::Value(Json::objectValue);
result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION);
Json::Value commands = Json::Value(Json::arrayValue);
@@ -484,8 +488,8 @@ Json::Value SkDebugCanvas::toJSONBatchList(int n, SkCanvas* canvas) {
this->drawAndCollectBatches(n, canvas);
Json::Value parsedFromString;
- GrAuditTrail* at = this->getAuditTrail(canvas);
#if SK_SUPPORT_GPU
+ GrAuditTrail* at = this->getAuditTrail(canvas);
if (at) {
GrAuditTrail::AutoManageBatchList enable(at);
Json::Reader reader;
« no previous file with comments | « no previous file | tools/skiaserve/Request.h » ('j') | tools/skiaserve/Request.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698