| Index: tools/skiaserve/urlhandlers/SRGBModeHandler.cpp
|
| diff --git a/tools/skiaserve/urlhandlers/ColorModeHandler.cpp b/tools/skiaserve/urlhandlers/SRGBModeHandler.cpp
|
| similarity index 66%
|
| copy from tools/skiaserve/urlhandlers/ColorModeHandler.cpp
|
| copy to tools/skiaserve/urlhandlers/SRGBModeHandler.cpp
|
| index 25cdf7dce9deaf4e35840a50750f228e695a7042..df06050b90c2cf56a86eef5ef97ecfcc5dc9dcea 100644
|
| --- a/tools/skiaserve/urlhandlers/ColorModeHandler.cpp
|
| +++ b/tools/skiaserve/urlhandlers/SRGBModeHandler.cpp
|
| @@ -13,13 +13,13 @@
|
|
|
| using namespace Response;
|
|
|
| -bool ColorModeHandler::canHandle(const char* method, const char* url) {
|
| - static const char* kBasePath = "/colorMode/";
|
| +bool SRGBModeHandler::canHandle(const char* method, const char* url) {
|
| + static const char* kBasePath = "/srgbMode/";
|
| return 0 == strcmp(method, MHD_HTTP_METHOD_POST) &&
|
| 0 == strncmp(url, kBasePath, strlen(kBasePath));
|
| }
|
|
|
| -int ColorModeHandler::handle(Request* request, MHD_Connection* connection,
|
| +int SRGBModeHandler::handle(Request* request, MHD_Connection* connection,
|
| const char* url, const char* method,
|
| const char* upload_data, size_t* upload_data_size) {
|
| SkTArray<SkString> commands;
|
| @@ -29,14 +29,14 @@ int ColorModeHandler::handle(Request* request, MHD_Connection* connection,
|
| return MHD_NO;
|
| }
|
|
|
| - int mode;
|
| - if (1 != sscanf(commands[1].c_str(), "%d", &mode)) {
|
| + int enable;
|
| + if (1 != sscanf(commands[1].c_str(), "%d", &enable)) {
|
| return MHD_NO;
|
| }
|
|
|
| - bool success = request->setColorMode(mode);
|
| + bool success = request->setSRGBMode(enable);
|
| if (!success) {
|
| - return SendError(connection, "Unable to create requested surface");
|
| + return SendError(connection, "Unable to set requested mode");
|
| }
|
| return SendOK(connection);
|
| }
|
|
|