aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skiaserve
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-05-31 14:27:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-31 18:59:44 +0000
commitc7ad40f76f6f23b3acd73b53e989220fd71f2da2 (patch)
tree3a2372730179f1bd0dd2486b6e576ec308f1327b /tools/skiaserve
parent8103bb960933359f6536cbfd40d760e54b079e94 (diff)
Remove SK_SUPPORT_GPU checks in tool-only code
Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/skiaserve')
-rw-r--r--tools/skiaserve/Request.cpp14
-rw-r--r--tools/skiaserve/Request.h2
2 files changed, 0 insertions, 16 deletions
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 7808638c3b..61f79f1389 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -27,20 +27,14 @@ Request::Request(SkString rootUrl)
, fOverdraw(false)
, fColorMode(0) {
// create surface
-#if SK_SUPPORT_GPU
GrContextOptions grContextOpts;
fContextFactory = new GrContextFactory(grContextOpts);
-#else
- fContextFactory = nullptr;
-#endif
}
Request::~Request() {
-#if SK_SUPPORT_GPU
if (fContextFactory) {
delete fContextFactory;
}
-#endif
}
SkBitmap* Request::getBitmapFromCanvas(SkCanvas* canvas) {
@@ -70,7 +64,6 @@ sk_sp<SkData> Request::writeCanvasToPng(SkCanvas* canvas) {
}
SkCanvas* Request::getCanvas() {
-#if SK_SUPPORT_GPU
GrContextFactory* factory = fContextFactory;
GLTestContext* gl = factory->getContextInfo(GrContextFactory::kGL_ContextType,
GrContextFactory::ContextOverrides::kNone).glContext();
@@ -81,7 +74,6 @@ SkCanvas* Request::getCanvas() {
if (gl) {
gl->makeCurrent();
}
-#endif
SkASSERT(fDebugCanvas);
// create the appropriate surface if necessary
@@ -117,7 +109,6 @@ sk_sp<SkData> Request::writeOutSkp() {
}
GrContext* Request::getContext() {
-#if SK_SUPPORT_GPU
GrContext* result = fContextFactory->get(GrContextFactory::kGL_ContextType,
GrContextFactory::ContextOverrides::kNone);
if (!result) {
@@ -125,9 +116,6 @@ GrContext* Request::getContext() {
GrContextFactory::ContextOverrides::kNone);
}
return result;
-#else
- return nullptr;
-#endif
}
SkIRect Request::getBounds() {
@@ -135,11 +123,9 @@ SkIRect Request::getBounds() {
if (fPicture) {
bounds = fPicture->cullRect().roundOut();
if (fGPUEnabled) {
-#if SK_SUPPORT_GPU
int maxRTSize = this->getContext()->maxRenderTargetSize();
bounds = SkIRect::MakeWH(SkTMin(bounds.width(), maxRTSize),
SkTMin(bounds.height(), maxRTSize));
-#endif
}
} else {
bounds = SkIRect::MakeWH(kDefaultWidth, kDefaultHeight);
diff --git a/tools/skiaserve/Request.h b/tools/skiaserve/Request.h
index 7f41748c02..44df83d466 100644
--- a/tools/skiaserve/Request.h
+++ b/tools/skiaserve/Request.h
@@ -10,9 +10,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
-#endif
#include "SkDebugCanvas.h"
#include "SkPicture.h"