Rename batch->op in skiaserve
Change-Id: Ib831b9a6bcf4f37c0f077b26f68b1cefef81bb73
Reviewed-on: https://skia-review.googlesource.com/6351
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 2064a46..0e55d92 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -259,7 +259,7 @@
SkCanvas* canvas = this->getCanvas();
Json::Value root = fDebugCanvas->toJSON(fUrlDataManager, n, canvas);
root["mode"] = Json::Value(fGPUEnabled ? "gpu" : "cpu");
- root["drawGpuBatchBounds"] = Json::Value(fDebugCanvas->getDrawGpuBatchBounds());
+ root["drawGpuBatchBounds"] = Json::Value(fDebugCanvas->getDrawGpuOpBounds());
root["colorMode"] = Json::Value(fColorMode);
SkDynamicMemoryWStream stream;
stream.writeText(Json::FastWriter().write(root).c_str());
@@ -267,11 +267,11 @@
return stream.detachAsData();
}
-sk_sp<SkData> Request::getJsonBatchList(int n) {
+sk_sp<SkData> Request::getJsonOpList(int n) {
SkCanvas* canvas = this->getCanvas();
SkASSERT(fGPUEnabled);
- Json::Value result = fDebugCanvas->toJSONBatchList(n, canvas);
+ Json::Value result = fDebugCanvas->toJSONOpList(n, canvas);
SkDynamicMemoryWStream stream;
stream.writeText(Json::FastWriter().write(result).c_str());
diff --git a/tools/skiaserve/Request.h b/tools/skiaserve/Request.h
index 4058d7c..7f41748 100644
--- a/tools/skiaserve/Request.h
+++ b/tools/skiaserve/Request.h
@@ -37,7 +37,7 @@
Request(SkString rootUrl);
~Request();
- // draws to skia draw op N, highlighting the Mth batch(-1 means no highlight)
+ // draws to canvas operation N, highlighting the Mth GrOp. m = -1 means no highlight.
sk_sp<SkData> drawToPng(int n, int m = -1);
sk_sp<SkData> writeOutSkp();
SkCanvas* getCanvas();
@@ -53,8 +53,8 @@
// Returns the json list of ops as an SkData
sk_sp<SkData> getJsonOps(int n);
- // Returns a json list of batches as an SkData
- sk_sp<SkData> getJsonBatchList(int n);
+ // Returns a json list of ops as an SkData
+ sk_sp<SkData> getJsonOpList(int n);
// Returns json with the viewMatrix and clipRect
sk_sp<SkData> getJsonInfo(int n);
diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp
index 3e547a8..29dd1b4 100644
--- a/tools/skiaserve/skiaserve.cpp
+++ b/tools/skiaserve/skiaserve.cpp
@@ -42,8 +42,8 @@
fHandlers.push_back(new DownloadHandler);
fHandlers.push_back(new DataHandler);
fHandlers.push_back(new BreakHandler);
- fHandlers.push_back(new BatchesHandler);
- fHandlers.push_back(new BatchBoundsHandler);
+ fHandlers.push_back(new OpsHandler);
+ fHandlers.push_back(new OpBoundsHandler);
fHandlers.push_back(new ColorModeHandler);
fHandlers.push_back(new QuitHandler);
}
diff --git a/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp b/tools/skiaserve/urlhandlers/OpBoundsHandler.cpp
similarity index 65%
rename from tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp
rename to tools/skiaserve/urlhandlers/OpBoundsHandler.cpp
index 3eb51d2..f0e9758 100644
--- a/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp
+++ b/tools/skiaserve/urlhandlers/OpBoundsHandler.cpp
@@ -7,21 +7,20 @@
#include "UrlHandler.h"
-#include "microhttpd.h"
#include "../Request.h"
#include "../Response.h"
+#include "microhttpd.h"
using namespace Response;
-bool BatchBoundsHandler::canHandle(const char* method, const char* url) {
+bool OpBoundsHandler::canHandle(const char* method, const char* url) {
static const char* kBasePath = "/batchBounds/";
return 0 == strcmp(method, MHD_HTTP_METHOD_POST) &&
0 == strncmp(url, kBasePath, strlen(kBasePath));
}
-int BatchBoundsHandler::handle(Request* request, MHD_Connection* connection,
- const char* url, const char* method,
- const char* upload_data, size_t* upload_data_size) {
+int OpBoundsHandler::handle(Request* request, MHD_Connection* connection, const char* url,
+ const char* method, const char* upload_data, size_t* upload_data_size) {
SkTArray<SkString> commands;
SkStrSplit(url, "/", &commands);
@@ -32,6 +31,6 @@
int enabled;
sscanf(commands[1].c_str(), "%d", &enabled);
- request->fDebugCanvas->setDrawGpuBatchBounds(SkToBool(enabled));
+ request->fDebugCanvas->setDrawGpuOpBounds(SkToBool(enabled));
return SendOK(connection);
}
diff --git a/tools/skiaserve/urlhandlers/BatchesHandler.cpp b/tools/skiaserve/urlhandlers/OpsHandler.cpp
similarity index 68%
rename from tools/skiaserve/urlhandlers/BatchesHandler.cpp
rename to tools/skiaserve/urlhandlers/OpsHandler.cpp
index 81457ac..a44e594 100644
--- a/tools/skiaserve/urlhandlers/BatchesHandler.cpp
+++ b/tools/skiaserve/urlhandlers/OpsHandler.cpp
@@ -7,20 +7,19 @@
#include "UrlHandler.h"
-#include "microhttpd.h"
#include "../Request.h"
#include "../Response.h"
+#include "microhttpd.h"
using namespace Response;
-bool BatchesHandler::canHandle(const char* method, const char* url) {
+bool OpsHandler::canHandle(const char* method, const char* url) {
const char* kBasePath = "/batches";
return 0 == strncmp(url, kBasePath, strlen(kBasePath));
}
-int BatchesHandler::handle(Request* request, MHD_Connection* connection,
- const char* url, const char* method,
- const char* upload_data, size_t* upload_data_size) {
+int OpsHandler::handle(Request* request, MHD_Connection* connection, const char* url,
+ const char* method, const char* upload_data, size_t* upload_data_size) {
SkTArray<SkString> commands;
SkStrSplit(url, "/", &commands);
@@ -32,7 +31,7 @@
if (0 == strcmp(method, MHD_HTTP_METHOD_GET)) {
int n = request->getLastOp();
- sk_sp<SkData> data(request->getJsonBatchList(n));
+ sk_sp<SkData> data(request->getJsonOpList(n));
return SendData(connection, data.get(), "application/json");
}
diff --git a/tools/skiaserve/urlhandlers/UrlHandler.h b/tools/skiaserve/urlhandlers/UrlHandler.h
index 1536ef3..e86e7fc 100644
--- a/tools/skiaserve/urlhandlers/UrlHandler.h
+++ b/tools/skiaserve/urlhandlers/UrlHandler.h
@@ -112,9 +112,9 @@
};
/*
- * Returns a json descripton of all the batches in the image
+ * Returns a json descripton of all the GPU ops in the image
*/
-class BatchesHandler : public UrlHandler {
+class OpsHandler : public UrlHandler {
public:
bool canHandle(const char* method, const char* url) override;
int handle(Request* request, MHD_Connection* connection,
@@ -123,9 +123,9 @@
};
/*
- * Enables drawing of batch bounds
+ * Enables drawing of gpu op bounds
*/
-class BatchBoundsHandler : public UrlHandler {
+class OpBoundsHandler : public UrlHandler {
public:
bool canHandle(const char* method, const char* url) override;
int handle(Request* request, MHD_Connection* connection,