diff options
author | Brian Salomon <bsalomon@google.com> | 2016-12-20 16:48:59 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-20 22:35:23 +0000 |
commit | 144a5c518ae921f210bdd9647c061e57d18f440c (patch) | |
tree | 9635e06add734e1b0eb0635e40a05d169f61e509 /tools/skiaserve | |
parent | f4e27f68b07c063f00d5ef618f5d4a64e785f9c3 (diff) |
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>
Diffstat (limited to 'tools/skiaserve')
-rw-r--r-- | tools/skiaserve/Request.cpp | 6 | ||||
-rw-r--r-- | tools/skiaserve/Request.h | 6 | ||||
-rw-r--r-- | tools/skiaserve/skiaserve.cpp | 4 | ||||
-rw-r--r-- | tools/skiaserve/urlhandlers/OpBoundsHandler.cpp (renamed from tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp) | 11 | ||||
-rw-r--r-- | tools/skiaserve/urlhandlers/OpsHandler.cpp (renamed from tools/skiaserve/urlhandlers/BatchesHandler.cpp) | 11 | ||||
-rw-r--r-- | tools/skiaserve/urlhandlers/UrlHandler.h | 8 |
6 files changed, 22 insertions, 24 deletions
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp index 2064a464f0..0e55d926aa 100644 --- a/tools/skiaserve/Request.cpp +++ b/tools/skiaserve/Request.cpp @@ -259,7 +259,7 @@ sk_sp<SkData> Request::getJsonOps(int n) { 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 @@ sk_sp<SkData> Request::getJsonOps(int n) { 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 4058d7ce7e..7f41748c02 100644 --- a/tools/skiaserve/Request.h +++ b/tools/skiaserve/Request.h @@ -37,7 +37,7 @@ struct Request { 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 @@ struct Request { // 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 3e547a8d70..29dd1b4996 100644 --- a/tools/skiaserve/skiaserve.cpp +++ b/tools/skiaserve/skiaserve.cpp @@ -42,8 +42,8 @@ public: 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 index 3eb51d2f68..f0e9758b63 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 BatchBoundsHandler::handle(Request* request, MHD_Connection* connection, 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 index 81457acca4..a44e594c6b 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 @@ int BatchesHandler::handle(Request* request, MHD_Connection* connection, 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 1536ef33c7..e86e7fca90 100644 --- a/tools/skiaserve/urlhandlers/UrlHandler.h +++ b/tools/skiaserve/urlhandlers/UrlHandler.h @@ -112,9 +112,9 @@ public: }; /* - * 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 @@ public: }; /* - * 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, |