aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-11-13 09:34:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-13 16:20:10 +0000
commitf44754a42b9d5ced2e6f075b4bd058a498488d3a (patch)
tree63f22f5ec8fadc9cd7ea11f11bb84d2ca9aedc52 /tools
parent1ff420653d72b1ba9a0621f09316febe2d82f86d (diff)
Drop support for OSMesa in test tools and remove build bot
Change-Id: Ic85ee05fe292a36a053ca7a20ccce24a4da4fae2 Reviewed-on: https://skia-review.googlesource.com/70026 Reviewed-by: Joe Gregorio <jcgregorio@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/fiddle/mesa_context.cpp31
-rw-r--r--tools/flags/SkCommonFlagsConfig.cpp12
-rw-r--r--tools/gpu/GrContextFactory.cpp8
-rw-r--r--tools/gpu/GrContextFactory.h3
-rw-r--r--tools/gpu/gl/mesa/GLTestContext_mesa.cpp156
-rw-r--r--tools/gpu/gl/mesa/GLTestContext_mesa.h17
-rw-r--r--tools/gpu/gl/mesa/osmesa_wrapper.h16
-rwxr-xr-xtools/install_dependencies.sh1
-rw-r--r--tools/skiaserve/Request.cpp8
9 files changed, 0 insertions, 252 deletions
diff --git a/tools/fiddle/mesa_context.cpp b/tools/fiddle/mesa_context.cpp
deleted file mode 100644
index 89902ec711..0000000000
--- a/tools/fiddle/mesa_context.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "fiddle_main.h"
-
-#include <GL/osmesa.h>
-
-// create_grcontext implementation for Mesa.
-sk_sp<GrContext> create_grcontext(std::ostringstream &driverinfo) {
- // We just leak the OSMesaContext... the process will die soon anyway.
- if (OSMesaContext osMesaContext = OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, nullptr)) {
- static uint32_t buffer[16 * 16];
- OSMesaMakeCurrent(osMesaContext, &buffer, GL_UNSIGNED_BYTE, 16, 16);
- }
- driverinfo << "Mesa";
-
- auto osmesa_get = [](void* ctx, const char name[]) {
- SkASSERT(nullptr == ctx);
- SkASSERT(OSMesaGetCurrentContext());
- return OSMesaGetProcAddress(name);
- };
- sk_sp<const GrGLInterface> mesa(GrGLAssembleInterface(nullptr, osmesa_get));
- if (!mesa) {
- return nullptr;
- }
- return GrContext::MakeGL(mesa.get());
-}
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index 16fe914f77..fe9faaef1d 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -86,9 +86,6 @@ static const struct {
{ "angle_gl_es3", "gpu", "api=angle_gl_es3" },
{ "commandbuffer", "gpu", "api=commandbuffer" },
{ "mock", "gpu", "api=mock" }
-#if SK_MESA
- ,{ "mesa", "gpu", "api=mesa" }
-#endif
#ifdef SK_VULKAN
,{ "vk", "gpu", "api=vulkan" }
,{ "vksrgb", "gpu", "api=vulkan,color=srgb" }
@@ -141,9 +138,6 @@ static const char configExtendedHelp[] =
"\t\tangle_gl_es3\t\t\tUse OpenGL ES3 on the ANGLE OpenGL backend.\n"
"\t\tcommandbuffer\t\tUse command buffer.\n"
"\t\tmock\t\tUse mock context.\n"
-#if SK_MESA
- "\t\tmesa\t\t\tUse MESA.\n"
-#endif
#ifdef SK_VULKAN
"\t\tvulkan\t\t\tUse Vulkan.\n"
#endif
@@ -307,12 +301,6 @@ static bool parse_option_gpu_api(const SkString& value,
*outContextType = GrContextFactory::kMock_ContextType;
return true;
}
-#if SK_MESA
- if (value.equals("mesa")) {
- *outContextType = GrContextFactory::kMESA_ContextType;
- return true;
- }
-#endif
#ifdef SK_VULKAN
if (value.equals("vulkan")) {
*outContextType = GrContextFactory::kVulkan_ContextType;
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 1bc4655558..21766db2b8 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -14,9 +14,6 @@
#endif
#include "gl/command_buffer/GLTestContext_command_buffer.h"
#include "gl/debug/DebugGLTestContext.h"
-#if SK_MESA
- #include "gl/mesa/GLTestContext_mesa.h"
-#endif
#ifdef SK_VULKAN
#include "vk/VkTestContext.h"
#endif
@@ -174,11 +171,6 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
glCtx = CommandBufferGLTestContext::Create(glShareContext);
break;
#endif
-#if SK_MESA
- case kMESA_ContextType:
- glCtx = CreateMesaGLTestContext(glShareContext);
- break;
-#endif
case kNullGL_ContextType:
glCtx = CreateNullGLTestContext(
ContextOverrides::kRequireNVPRSupport & overrides, glShareContext);
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index 1073f6a594..6997ca1337 100644
--- a/tools/gpu/GrContextFactory.h
+++ b/tools/gpu/GrContextFactory.h
@@ -39,7 +39,6 @@ public:
kANGLE_GL_ES2_ContextType, //! ANGLE on OpenGL OpenGL ES 2 context.
kANGLE_GL_ES3_ContextType, //! ANGLE on OpenGL OpenGL ES 3 context.
kCommandBuffer_ContextType, //! Chromium command buffer OpenGL ES context.
- kMESA_ContextType, //! MESA OpenGL context
kNullGL_ContextType, //! Non-rendering OpenGL mock context.
kDebugGL_ContextType, //! Non-rendering, state verifying OpenGL context.
kVulkan_ContextType, //! Vulkan
@@ -107,8 +106,6 @@ public:
return "ANGLE GL ES3";
case kCommandBuffer_ContextType:
return "Command Buffer";
- case kMESA_ContextType:
- return "Mesa";
case kNullGL_ContextType:
return "Null GL";
case kDebugGL_ContextType:
diff --git a/tools/gpu/gl/mesa/GLTestContext_mesa.cpp b/tools/gpu/gl/mesa/GLTestContext_mesa.cpp
deleted file mode 100644
index 5d0014b82c..0000000000
--- a/tools/gpu/gl/mesa/GLTestContext_mesa.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include <GL/osmesa.h>
-
-#include "gl/mesa/GLTestContext_mesa.h"
-#include "gl/GrGLDefines.h"
-
-#include "gl/GrGLAssembleInterface.h"
-#include "gl/GrGLUtil.h"
-#include "osmesa_wrapper.h"
-
-namespace {
-
-static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) {
- SkASSERT(nullptr == ctx);
- SkASSERT(OSMesaGetCurrentContext());
- return OSMesaGetProcAddress(name);
-}
-
-static const GrGLInterface* create_mesa_interface() {
- if (nullptr == OSMesaGetCurrentContext()) {
- return nullptr;
- }
- return GrGLAssembleInterface(nullptr, osmesa_get);
-}
-
-static const GrGLint gBOGUS_SIZE = 16;
-
-class MesaGLContext : public sk_gpu_test::GLTestContext {
-private:
- typedef intptr_t Context;
-
-public:
- MesaGLContext(MesaGLContext* shareContext);
- ~MesaGLContext() override;
-
-private:
- void destroyGLContext();
-
- void onPlatformMakeCurrent() const override;
-
- void onPlatformSwapBuffers() const override;
-
- GrGLFuncPtr onPlatformGetProcAddress(const char *) const override;
-
- Context fContext;
- GrGLubyte *fImage;
-};
-
-MesaGLContext::MesaGLContext(MesaGLContext* shareContext)
- : fContext(static_cast<Context>(0))
- , fImage(nullptr) {
- GR_STATIC_ASSERT(sizeof(Context) == sizeof(OSMesaContext));
- OSMesaContext mesaShareContext = shareContext ? (OSMesaContext)(shareContext->fContext)
- : nullptr;
-
- /* Create an RGBA-mode context */
-#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
- /* specify Z, stencil, accum sizes */
- fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, mesaShareContext);
-#else
- fContext = (Context) OSMesaCreateContext(OSMESA_BGRA, mesaShareContext);
-#endif
- if (!fContext) {
- SkDebugf("OSMesaCreateContext failed!\n");
- this->destroyGLContext();
- return;
- }
- // Allocate the image buffer
- fImage = (GrGLubyte *) sk_malloc_throw(gBOGUS_SIZE * gBOGUS_SIZE *
- 4 * sizeof(GrGLubyte));
- if (!fImage) {
- SkDebugf("Alloc image buffer failed!\n");
- this->destroyGLContext();
- return;
- }
-
- // Bind the buffer to the context and make it current
- if (!OSMesaMakeCurrent((OSMesaContext) fContext,
- fImage,
- GR_GL_UNSIGNED_BYTE,
- gBOGUS_SIZE,
- gBOGUS_SIZE)) {
- SkDebugf("OSMesaMakeCurrent failed!\n");
- this->destroyGLContext();
- return;
- }
-
- sk_sp<const GrGLInterface> gl(create_mesa_interface());
- if (nullptr == gl.get()) {
- SkDebugf("Could not create GL interface!\n");
- this->destroyGLContext();
- return;
- }
-
- if (!gl->validate()) {
- SkDebugf("Could not validate GL interface!\n");
- this->destroyGLContext();
- return;
- }
-
- this->init(gl.release());
-}
-
-MesaGLContext::~MesaGLContext() {
- this->teardown();
- this->destroyGLContext();
-}
-
-void MesaGLContext::destroyGLContext() {
- if (fImage) {
- sk_free(fImage);
- fImage = nullptr;
- }
-
- if (fContext) {
- OSMesaDestroyContext((OSMesaContext) fContext);
- fContext = static_cast<Context>(0);
- }
-}
-
-
-void MesaGLContext::onPlatformMakeCurrent() const {
- if (fContext) {
- if (!OSMesaMakeCurrent((OSMesaContext) fContext, fImage,
- GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) {
- SkDebugf("Could not make MESA context current.");
- }
- }
-}
-
-void MesaGLContext::onPlatformSwapBuffers() const { }
-
-GrGLFuncPtr MesaGLContext::onPlatformGetProcAddress(const char *procName) const {
- return OSMesaGetProcAddress(procName);
-}
-} // anonymous namespace
-
-
-namespace sk_gpu_test {
-GLTestContext *CreateMesaGLTestContext(GLTestContext* shareContext) {
- MesaGLContext* mesaShareContext = reinterpret_cast<MesaGLContext*>(shareContext);
- MesaGLContext *ctx = new MesaGLContext(mesaShareContext);
- if (!ctx->isValid()) {
- delete ctx;
- return nullptr;
- }
- return ctx;
-}
-} // sk_gpu_test
diff --git a/tools/gpu/gl/mesa/GLTestContext_mesa.h b/tools/gpu/gl/mesa/GLTestContext_mesa.h
deleted file mode 100644
index 40184aa7ea..0000000000
--- a/tools/gpu/gl/mesa/GLTestContext_mesa.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef GLTestContext_mesa_DEFINED
-#define GLTestContext_mesa_DEFINED
-
-#include "gl/GLTestContext.h"
-
-namespace sk_gpu_test {
-GLTestContext* CreateMesaGLTestContext(GLTestContext* shareContext);
-} // namespace sk_gpu_test
-
-#endif
diff --git a/tools/gpu/gl/mesa/osmesa_wrapper.h b/tools/gpu/gl/mesa/osmesa_wrapper.h
deleted file mode 100644
index 70de99376d..0000000000
--- a/tools/gpu/gl/mesa/osmesa_wrapper.h
+++ /dev/null
@@ -1,16 +0,0 @@
-
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-// Older versions of XQuartz have a bug where a header included by osmesa.h
-// defines GL_GLEXT_PROTOTYPES. This will cause a redefinition warning if
-// the file that includes osmesa.h already defined it. XCode 3 uses a version
-// of gcc (4.2.1) that does not support the diagnostic pragma to disable a
-// warning (added in 4.2.4). So we use the system_header pragma to shut GCC
-// up about warnings in osmesa.h
-#pragma GCC system_header
-#include <GL/osmesa.h>
diff --git a/tools/install_dependencies.sh b/tools/install_dependencies.sh
index fd5c3669d0..9d1a45fa15 100755
--- a/tools/install_dependencies.sh
+++ b/tools/install_dependencies.sh
@@ -31,7 +31,6 @@ if command -v lsb_release > /dev/null ; then
libfreetype6-dev
libgif-dev
libglu1-mesa-dev
- libosmesa6-dev
libpng12-dev
libqt4-dev
EOF
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 12f3596817..6a0f4df0a9 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -79,10 +79,6 @@ SkCanvas* Request::getCanvas() {
gl = factory->getContextInfo(GrContextFactory::kGLES_ContextType,
GrContextFactory::ContextOverrides::kNone).glContext();
}
- if (!gl) {
- gl = factory->getContextInfo(GrContextFactory::kMESA_ContextType,
- GrContextFactory::ContextOverrides::kNone).glContext();
- }
if (gl) {
gl->makeCurrent();
}
@@ -136,10 +132,6 @@ GrContext* Request::getContext() {
result = fContextFactory->get(GrContextFactory::kGLES_ContextType,
GrContextFactory::ContextOverrides::kNone);
}
- if (!result) {
- result = fContextFactory->get(GrContextFactory::kMESA_ContextType,
- GrContextFactory::ContextOverrides::kNone);
- }
return result;
#else
return nullptr;