Get skiaserve working on Windows.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903203003

Review URL: https://codereview.chromium.org/1903203003
This commit is contained in:
brianosman 2016-04-20 10:52:54 -07:00 committed by Commit bot
parent c3d706f7ce
commit 82996b8200
8 changed files with 74 additions and 5 deletions

View File

@ -180,6 +180,67 @@
'_MHD_EXTERN=__attribute__((visibility("default"))) extern',
],
}],
['skia_os == "win"', {
'sources': [
'../third_party/externals/microhttpd/src/platform/w32functions.c',
],
'msvs_disabled_warnings': [4244, 4996],
'all_dependent_settings': {
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [ 'ws2_32.lib' ],
},
},
},
'defines=': [ # equals sign throws away most Skia defines (just noise)
"_GNU_SOURCE=1",
"BAUTH_SUPPORT=1",
"DAUTH_SUPPORT=1",
"EPOLL_SUPPORT=0",
"HAVE_DECL_SOCK_NONBLOCK=0",
"HAVE_DECL_TCP_CORK=0",
"HAVE_DECL_TCP_NOPUSH=0",
"HAVE_ERRNO_H=1",
"HAVE_FCNTL_H=1",
"HAVE_INET6=1",
"HAVE_INTTYPES_H=1",
"HAVE_LIMITS_H=1",
"HAVE_LOCALE_H=1",
"HAVE_MATH_H=1",
"HAVE_MEMORY_H=1",
"HAVE_MESSAGES=1",
# "HAVE_POLL=0",
"HAVE_POSTPROCESSOR=1",
"HAVE_PTHREAD_H=0",
"HAVE_STDINT_H=1",
"HAVE_STDIO_H=1",
"HAVE_STDLIB_H=1",
"HAVE_STRINGS_H=1",
"HAVE_STRING_H=1",
"HAVE_SYS_STAT_H=1",
"HAVE_SYS_TYPES_H=1",
"HAVE_TIME_H=1",
"HAVE_WINSOCK2_H=1",
"HAVE_WS2TCPIP_H=1",
"HTTPS_SUPPORT=0",
"MSVC=1",
"WINDOWS=1",
'LT_OBJDIR=".libs/"',
"MHD_DONT_USE_PIPES=1",
"MHD_USE_W32_THREADS=1",
'PACKAGE="libmicrohttpd"',
'PACKAGE_BUGREPORT="libmicrohttpd@gnu.org"',
'PACKAGE_NAME="libmicrohttp"',
'PACKAGE_STRING="libmicrohttpd 0.9.42"',
'PACKAGE_TARNAME="libmicrohttpd"',
'PACKAGE_URL=""',
'PACKAGE_VERSION="0.9.42"',
"SPDY_SUPPORT=0",
"STDC_HEADERS=1",
'VERSION="0.9.42"',
'_MHD_EXTERN=extern',
],
}],
]
}]
}

View File

@ -72,6 +72,10 @@
['skia_os == "mac" or skia_os == "linux"', {
'dependencies': [
'nanomsg.gyp:*' ,
],
}],
['skia_os in ["linux", "mac", "win"]', {
'dependencies': [
'skiaserve.gyp:skiaserve',
],
}],

View File

@ -98,7 +98,8 @@ SkData* Request::writeOutSkp() {
// Playback into picture recorder
SkIRect bounds = this->getBounds();
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(bounds.width(), bounds.height());
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(bounds.width()),
SkIntToScalar(bounds.height()));
fDebugCanvas->draw(canvas);

View File

@ -16,8 +16,11 @@
#include "urlhandlers/UrlHandler.h"
#include <errno.h>
#if !defined _WIN32
#include <sys/socket.h>
#include <arpa/inet.h>
#endif
using namespace Response;

View File

@ -32,6 +32,6 @@ int BatchBoundsHandler::handle(Request* request, MHD_Connection* connection,
int enabled;
sscanf(commands[1].c_str(), "%d", &enabled);
request->fDebugCanvas->setDrawGpuBatchBounds(enabled);
request->fDebugCanvas->setDrawGpuBatchBounds(SkToBool(enabled));
return SendOK(connection);
}

View File

@ -54,7 +54,7 @@ int CmdHandler::handle(Request* request, MHD_Connection* connection,
int n, toggle;
sscanf(commands[1].c_str(), "%d", &n);
sscanf(commands[2].c_str(), "%d", &toggle);
request->fDebugCanvas->toggleCommand(n, toggle);
request->fDebugCanvas->toggleCommand(n, SkToBool(toggle));
return SendOK(connection);
}

View File

@ -32,7 +32,7 @@ int EnableGPUHandler::handle(Request* request, MHD_Connection* connection,
int enable;
sscanf(commands[1].c_str(), "%d", &enable);
bool success = request->enableGPU(enable);
bool success = request->enableGPU(SkToBool(enable));
if (!success) {
return SendError(connection, "Unable to create GPU surface");
}

View File

@ -34,7 +34,7 @@ int SRGBModeHandler::handle(Request* request, MHD_Connection* connection,
return MHD_NO;
}
bool success = request->setSRGBMode(enable);
bool success = request->setSRGBMode(SkToBool(enable));
if (!success) {
return SendError(connection, "Unable to set requested mode");
}