Index: tools/skiaserve/urlhandlers/EnableGPUHandler.cpp |
diff --git a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp b/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp |
index 2dc9bb60c6cbe0712700da4b74720100aa7f307e..b5d0c7a245441499e0ba62ed4124ae82e87a901a 100644 |
--- a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp |
+++ b/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp |
@@ -32,17 +32,10 @@ int EnableGPUHandler::handle(Request* request, MHD_Connection* connection, |
int enable; |
sscanf(commands[1].c_str(), "%d", &enable); |
- if (enable) { |
- SkSurface* surface = request->createGPUSurface(); |
- if (surface) { |
- request->fSurface.reset(surface); |
- request->fGPUEnabled = true; |
- return SendOK(connection); |
- } |
+ bool success = request->enableGPU(enable); |
+ if (!success) { |
return SendError(connection, "Unable to create GPU surface"); |
} |
- request->fSurface.reset(request->createCPUSurface()); |
- request->fGPUEnabled = false; |
return SendOK(connection); |
} |