| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrCaps.h" | 8 #include "GrCaps.h" |
| 9 #include "GrContextFactory.h" | 9 #include "GrContextFactory.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 /** | 294 /** |
| 295 Updates the clip visualization alpha. On all subsequent /img requests, the cl
ip will be drawn in | 295 Updates the clip visualization alpha. On all subsequent /img requests, the cl
ip will be drawn in |
| 296 black with the specified alpha. 0 = no visible clip, 255 = fully opaque clip. | 296 black with the specified alpha. 0 = no visible clip, 255 = fully opaque clip. |
| 297 */ | 297 */ |
| 298 class ClipAlphaHandler : public UrlHandler { | 298 class ClipAlphaHandler : public UrlHandler { |
| 299 public: | 299 public: |
| 300 bool canHandle(const char* method, const char* url) override { | 300 bool canHandle(const char* method, const char* url) override { |
| 301 static const char* kBasePath = "/clipAlpha/"; | 301 static const char* kBasePath = "/clipAlpha/"; |
| 302 return 0 == strcmp(method, MHD_HTTP_METHOD_GET) && | 302 return 0 == strcmp(method, MHD_HTTP_METHOD_POST) && |
| 303 0 == strncmp(url, kBasePath, strlen(kBasePath)); | 303 0 == strncmp(url, kBasePath, strlen(kBasePath)); |
| 304 } | 304 } |
| 305 | 305 |
| 306 int handle(Request* request, MHD_Connection* connection, | 306 int handle(Request* request, MHD_Connection* connection, |
| 307 const char* url, const char* method, | 307 const char* url, const char* method, |
| 308 const char* upload_data, size_t* upload_data_size) override { | 308 const char* upload_data, size_t* upload_data_size) override { |
| 309 SkTArray<SkString> commands; | 309 SkTArray<SkString> commands; |
| 310 SkStrSplit(url, "/", &commands); | 310 SkStrSplit(url, "/", &commands); |
| 311 | 311 |
| 312 if (!request->fPicture.get() || commands.count() != 2) { | 312 if (!request->fPicture.get() || commands.count() != 2) { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 MHD_stop_daemon(daemon); | 598 MHD_stop_daemon(daemon); |
| 599 return 0; | 599 return 0; |
| 600 } | 600 } |
| 601 | 601 |
| 602 #if !defined SK_BUILD_FOR_IOS | 602 #if !defined SK_BUILD_FOR_IOS |
| 603 int main(int argc, char** argv) { | 603 int main(int argc, char** argv) { |
| 604 SkCommandLineFlags::Parse(argc, argv); | 604 SkCommandLineFlags::Parse(argc, argv); |
| 605 return skiaserve_main(); | 605 return skiaserve_main(); |
| 606 } | 606 } |
| 607 #endif | 607 #endif |
| OLD | NEW |