Temporary revert of r2510. The test that it introduced fails on the Mac build bots. I suspect there is something wrong with the Mac bot machine's GL that is preventing context creation from succeeding. The OpenGL Driver monitor on the machine only shows a software rasterizer. aglChoosePixelFormat seems to fail regardless of input. It may just need a reboot. I'll investigate it more on Monday.
git-svn-id: http://skia.googlecode.com/svn/trunk@2511 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
d47fafe057
commit
d92780b558
@ -30,7 +30,6 @@
|
||||
'../tests/FillPathTest.cpp',
|
||||
'../tests/FlateTest.cpp',
|
||||
'../tests/GeometryTest.cpp',
|
||||
'../tests/GLInterfaceValidation.cpp',
|
||||
'../tests/GLProgramsTest.cpp',
|
||||
'../tests/InfRectTest.cpp',
|
||||
'../tests/MathTest.cpp',
|
||||
|
@ -69,17 +69,8 @@ struct GrGLInterface;
|
||||
|
||||
const GrGLInterface* GrGLDefaultInterface();
|
||||
|
||||
/**
|
||||
* Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows,
|
||||
* GLX on linux, AGL on Mac). On platforms that have context-specific function
|
||||
* pointers for GL extensions (e.g. windows) the returned interface is only
|
||||
* valid for the context that was current at creation.
|
||||
*/
|
||||
const GrGLInterface* GrGLCreateNativeInterface();
|
||||
|
||||
/**
|
||||
* Creates a GrGLInterface for an OSMesa context.
|
||||
*/
|
||||
const GrGLInterface* GrGLCreateMesaInterface();
|
||||
|
||||
typedef unsigned int GrGLenum;
|
||||
|
@ -20,9 +20,6 @@ public:
|
||||
SkGLContext();
|
||||
virtual ~SkGLContext();
|
||||
|
||||
/**
|
||||
* Initializes the context and makes it current.
|
||||
*/
|
||||
bool init(const int width, const int height);
|
||||
|
||||
int getFBOID() const { return fFBO; }
|
||||
|
@ -13,9 +13,6 @@
|
||||
#if SK_MESA
|
||||
|
||||
class SkMesaGLContext : public SkGLContext {
|
||||
private:
|
||||
typedef intptr_t Context;
|
||||
|
||||
public:
|
||||
SkMesaGLContext();
|
||||
|
||||
@ -23,28 +20,16 @@ public:
|
||||
|
||||
virtual void makeCurrent() const SK_OVERRIDE;
|
||||
|
||||
class AutoContextRestore {
|
||||
public:
|
||||
AutoContextRestore();
|
||||
~AutoContextRestore();
|
||||
|
||||
private:
|
||||
Context fOldContext;
|
||||
GLint fOldWidth;
|
||||
GLint fOldHeight;
|
||||
GLint fOldFormat;
|
||||
void* fOldImage;
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
|
||||
void destroyGLContext() SK_OVERRIDE;
|
||||
|
||||
private:
|
||||
typedef intptr_t Context;
|
||||
Context fContext;
|
||||
GrGLubyte *fImage;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
@ -28,24 +28,6 @@ public:
|
||||
|
||||
virtual void makeCurrent() const SK_OVERRIDE;
|
||||
|
||||
class AutoContextRestore {
|
||||
public:
|
||||
AutoContextRestore();
|
||||
~AutoContextRestore();
|
||||
|
||||
private:
|
||||
#if defined(SK_BUILD_FOR_MAC)
|
||||
AGLContext fOldAGLContext;
|
||||
#elif defined(SK_BUILD_FOR_UNIX)
|
||||
GLXContext fOldGLXContext;
|
||||
Display* fOldDisplay;
|
||||
GLXDrawable fOldDrawable;
|
||||
#elif defined(SK_BUILD_FOR_WIN32)
|
||||
HDC fOldHDC;
|
||||
HGLRC fOldHGLRC;
|
||||
#endif
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
|
||||
void destroyGLContext() SK_OVERRIDE;
|
||||
|
@ -7,16 +7,6 @@
|
||||
*/
|
||||
#include "SkNativeGLContext.h"
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
|
||||
fOldAGLContext = aglGetCurrentContext();
|
||||
}
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
|
||||
aglSetCurrentContext(fOldAGLContext);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SkNativeGLContext::SkNativeGLContext()
|
||||
: fContext(NULL) {
|
||||
}
|
||||
|
@ -10,23 +10,6 @@
|
||||
|
||||
#include "SkMesaGLContext.h"
|
||||
|
||||
SkMesaGLContext::AutoContextRestore::AutoContextRestore() {
|
||||
fOldContext = (Context)OSMesaGetCurrentContext();
|
||||
if (NULL != (OSMesaContext)fOldContext) {
|
||||
OSMesaGetColorBuffer((OSMesaContext)fOldContext,
|
||||
&fOldWidth, &fOldHeight,
|
||||
&fOldFormat, &fOldImage);
|
||||
}
|
||||
}
|
||||
|
||||
SkMesaGLContext::AutoContextRestore::~AutoContextRestore() {
|
||||
if (NULL != fOldContext) {
|
||||
OSMesaMakeCurrent((OSMesaContext)fOldContext, fOldImage,
|
||||
fOldFormat, fOldWidth, fOldHeight);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SkMesaGLContext::SkMesaGLContext()
|
||||
: fContext(NULL)
|
||||
|
@ -9,19 +9,6 @@
|
||||
|
||||
#include <GL/glu.h>
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
|
||||
fOldGLXContext = glXGetCurrentContext();
|
||||
fOldDisplay = glXGetCurrentDisplay();
|
||||
fOldDrawable = glXGetCurrentDrawable();
|
||||
}
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
|
||||
if (NULL != fOldDisplay) {
|
||||
glXMakeCurrent(fOldDisplay, fOldDrawable, fOldGLXContext);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static bool ctxErrorOccurred = false;
|
||||
static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) {
|
||||
|
@ -11,23 +11,12 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
|
||||
fOldHGLRC = wglGetCurrentContext();
|
||||
fOldHDC = wglGetCurrentDC();
|
||||
}
|
||||
|
||||
SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
|
||||
wglMakeCurrent(fOldHDC, fOldHGLRC);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ATOM SkNativeGLContext::gWC = 0;
|
||||
|
||||
SkNativeGLContext::SkNativeGLContext()
|
||||
: fWindow(NULL)
|
||||
, fDeviceContext(NULL)
|
||||
, fGlRenderContext(0) {
|
||||
: fWindow(NULL)
|
||||
, fDeviceContext(NULL)
|
||||
, fGlRenderContext(0) {
|
||||
}
|
||||
|
||||
SkNativeGLContext::~SkNativeGLContext() {
|
||||
|
@ -1,55 +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 "Test.h"
|
||||
#include "SkNativeGLContext.h"
|
||||
#include "SkMesaGLContext.h"
|
||||
|
||||
static void GLInterfaceValidationTest(skiatest::Reporter* reporter) {
|
||||
typedef const GrGLInterface* (*interfaceFactory)();
|
||||
struct {
|
||||
interfaceFactory fFactory;
|
||||
const char* fName;
|
||||
} interfaceFactories[] = {
|
||||
{GrGLCreateNativeInterface, "Native"},
|
||||
#if SK_MESA
|
||||
{GrGLCreateMesaInterface, "Mesa"},
|
||||
#endif
|
||||
};
|
||||
|
||||
// On some platforms GrGLCreateNativeInterface will fail unless an OpenGL
|
||||
// context has been created. Also, preserve the current context that may
|
||||
// be in use by outer test harness.
|
||||
SkNativeGLContext::AutoContextRestore nglacr;
|
||||
SkNativeGLContext nglctx;
|
||||
static const int gBOGUS_SIZE = 16;
|
||||
REPORTER_ASSERT(reporter, nglctx.init(gBOGUS_SIZE, gBOGUS_SIZE));
|
||||
#if SK_MESA
|
||||
// We must have a current OSMesa context to initialize an OSMesa
|
||||
// GrGLInterface
|
||||
SkMesaGLContext::AutoContextRestore mglacr;
|
||||
SkMesaGLContext mglctx;
|
||||
REPORTER_ASSERT(reporter, mglctx.init(gBOGUS_SIZE, gBOGUS_SIZE));
|
||||
#endif
|
||||
|
||||
SkAutoTUnref<const GrGLInterface> iface;
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(interfaceFactories); ++i) {
|
||||
iface.reset(interfaceFactories[i].fFactory());
|
||||
REPORTER_ASSERT(reporter, NULL != iface.get());
|
||||
if (iface.get()) {
|
||||
REPORTER_ASSERT(reporter, iface.get()->validate(kOpenGL_Shaders_GrEngine));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "TestClassDef.h"
|
||||
DEFINE_TESTCLASS("GLInterfaceValidation",
|
||||
GLInterfaceValidationTestClass,
|
||||
GLInterfaceValidationTest)
|
||||
|
@ -89,9 +89,6 @@ GrContext* GpuTest::GetContext() {
|
||||
gGrContext.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, ctx));
|
||||
}
|
||||
}
|
||||
if (gGLContext.get()) {
|
||||
gGLContext.get()->makeCurrent();
|
||||
}
|
||||
return gGrContext.get();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user