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

Unified Diff: tools/skiaserve/urlhandlers/ColorModeHandler.cpp

Issue 1893393002: Adding support for playback to L32/S32/F16 canvas. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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: tools/skiaserve/urlhandlers/ColorModeHandler.cpp
diff --git a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp b/tools/skiaserve/urlhandlers/ColorModeHandler.cpp
similarity index 67%
copy from tools/skiaserve/urlhandlers/EnableGPUHandler.cpp
copy to tools/skiaserve/urlhandlers/ColorModeHandler.cpp
index 68eb86f6b4fdc384e1ec13d83164bb363b2709ec..8741087a07a882b105282fcbeea5a105f26ce34f 100644
--- a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp
+++ b/tools/skiaserve/urlhandlers/ColorModeHandler.cpp
@@ -13,13 +13,13 @@
using namespace Response;
-bool EnableGPUHandler::canHandle(const char* method, const char* url) {
- static const char* kBasePath = "/enableGPU/";
+bool ColorModeHandler::canHandle(const char* method, const char* url) {
Brian Osman 2016/04/18 16:17:03 This is a new file, but (obviously) copied from En
+ static const char* kBasePath = "/colorMode/";
return 0 == strcmp(method, MHD_HTTP_METHOD_POST) &&
0 == strncmp(url, kBasePath, strlen(kBasePath));
}
-int EnableGPUHandler::handle(Request* request, MHD_Connection* connection,
+int ColorModeHandler::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,12 +29,12 @@ int EnableGPUHandler::handle(Request* request, MHD_Connection* connection,
return MHD_NO;
}
- int enable;
- sscanf(commands[1].c_str(), "%d", &enable);
+ int mode;
+ sscanf(commands[1].c_str(), "%d", &mode);
jcgregorio 2016/04/18 16:39:30 Maybe check the return from sscanf? if (sscanf(co
- bool success = request->enableGPU(enable);
+ bool success = request->setColorMode(mode);
if (!success) {
- return SendError(connection, "Unable to create GPU surface");
+ return SendError(connection, "Unable to create requested surface");
}
return SendOK(connection);
}

Powered by Google App Engine
This is Rietveld 408576698