Commit e63db96b by Nicolas Capens

Store the native display as an opaque pointer.

Bug 18314459 Change-Id: I63e56d626bd1838803d1de71b417b7e40242c5e9 Reviewed-on: https://swiftshader-review.googlesource.com/4390Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 5524f05f
......@@ -16,10 +16,10 @@ namespace sw
~FrameBufferAndroid();
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
void *lock() override;
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
void *lock() override;
void unlock() override;
bool setSwapRectangle(int l, int t, int w, int h);
......
......@@ -69,7 +69,7 @@ sw::FrameBufferWin *createFrameBufferWin(HWND windowHandle, int width, int heigh
return 0;
}
sw::FrameBuffer *createFrameBuffer(HDC display, HWND window, int width, int height)
sw::FrameBuffer *createFrameBuffer(void *display, HWND window, int width, int height)
{
return createFrameBufferWin(window, width, height, false, false);
}
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#include "FrameBufferX11.hpp"
#include "libX11.hpp"
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <assert.h>
namespace sw
{
static int (*PreviousXErrorHandler)(Display *display, XErrorEvent *event) = 0;
static bool shmBadAccess = false;
// Catches BadAcces errors so we can fall back to not using MIT-SHM
static int XShmErrorHandler(Display *display, XErrorEvent *event)
{
if(event->error_code == BadAccess)
{
shmBadAccess = true;
return 0;
}
else
{
return PreviousXErrorHandler(display, event);
}
}
FrameBufferX11::FrameBufferX11(Display *display, Window window, int width, int height) : FrameBuffer(width, height, false, false), ownX11(!display), x_display(display), x_window(window)
{
if(!x_display)
{
x_display = libX11->XOpenDisplay(0);
}
int screen = DefaultScreen(x_display);
x_gc = libX11->XDefaultGC(x_display, screen);
int depth = libX11->XDefaultDepth(x_display, screen);
Status status = libX11->XMatchVisualInfo(x_display, screen, 32, TrueColor, &x_visual);
bool match = (status != 0 && x_visual.blue_mask == 0xFF); // Prefer X8R8G8B8
Visual *visual = match ? x_visual.visual : libX11->XDefaultVisual(x_display, screen);
mit_shm = (libX11->XShmQueryExtension && libX11->XShmQueryExtension(x_display) == True);
if(mit_shm)
{
x_image = libX11->XShmCreateImage(x_display, visual, depth, ZPixmap, 0, &shminfo, width, height);
shminfo.shmid = shmget(IPC_PRIVATE, x_image->bytes_per_line * x_image->height, IPC_CREAT | SHM_R | SHM_W);
shminfo.shmaddr = x_image->data = buffer = (char*)shmat(shminfo.shmid, 0, 0);
shminfo.readOnly = False;
PreviousXErrorHandler = libX11->XSetErrorHandler(XShmErrorHandler);
libX11->XShmAttach(x_display, &shminfo); // May produce a BadAccess error
libX11->XSync(x_display, False);
libX11->XSetErrorHandler(PreviousXErrorHandler);
if(shmBadAccess)
{
mit_shm = false;
XDestroyImage(x_image);
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
shmBadAccess = false;
}
}
if(!mit_shm)
{
buffer = new char[width * height * 4];
x_image = libX11->XCreateImage(x_display, visual, depth, ZPixmap, 0, buffer, width, height, 32, width * 4);
}
}
FrameBufferX11::~FrameBufferX11()
{
if(!mit_shm)
{
x_image->data = 0;
XDestroyImage(x_image);
delete[] buffer;
buffer = 0;
}
else
{
libX11->XShmDetach(x_display, &shminfo);
XDestroyImage(x_image);
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
}
if(ownX11)
{
libX11->XCloseDisplay(x_display);
}
}
void *FrameBufferX11::lock()
{
stride = x_image->bytes_per_line;
locked = buffer;
return locked;
}
void FrameBufferX11::unlock()
{
locked = 0;
}
void FrameBufferX11::blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride)
{
copy(source, sourceFormat, sourceStride);
if(!mit_shm)
{
libX11->XPutImage(x_display, x_window, x_gc, x_image, 0, 0, 0, 0, width, height);
}
else
{
libX11->XShmPutImage(x_display, x_window, x_gc, x_image, 0, 0, 0, 0, width, height, False);
}
libX11->XSync(x_display, False);
}
}
sw::FrameBuffer *createFrameBuffer(Display *display, Window window, int width, int height)
{
return new sw::FrameBufferX11(display, window, width, height);
}
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#include "FrameBufferX11.hpp"
#include "libX11.hpp"
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <assert.h>
namespace sw
{
static int (*PreviousXErrorHandler)(Display *display, XErrorEvent *event) = 0;
static bool shmBadAccess = false;
// Catches BadAcces errors so we can fall back to not using MIT-SHM
static int XShmErrorHandler(Display *display, XErrorEvent *event)
{
if(event->error_code == BadAccess)
{
shmBadAccess = true;
return 0;
}
else
{
return PreviousXErrorHandler(display, event);
}
}
FrameBufferX11::FrameBufferX11(Display *display, Window window, int width, int height) : FrameBuffer(width, height, false, false), ownX11(!display), x_display(display), x_window(window)
{
if(!x_display)
{
x_display = libX11->XOpenDisplay(0);
}
int screen = DefaultScreen(x_display);
x_gc = libX11->XDefaultGC(x_display, screen);
int depth = libX11->XDefaultDepth(x_display, screen);
Status status = libX11->XMatchVisualInfo(x_display, screen, 32, TrueColor, &x_visual);
bool match = (status != 0 && x_visual.blue_mask == 0xFF); // Prefer X8R8G8B8
Visual *visual = match ? x_visual.visual : libX11->XDefaultVisual(x_display, screen);
mit_shm = (libX11->XShmQueryExtension && libX11->XShmQueryExtension(x_display) == True);
if(mit_shm)
{
x_image = libX11->XShmCreateImage(x_display, visual, depth, ZPixmap, 0, &shminfo, width, height);
shminfo.shmid = shmget(IPC_PRIVATE, x_image->bytes_per_line * x_image->height, IPC_CREAT | SHM_R | SHM_W);
shminfo.shmaddr = x_image->data = buffer = (char*)shmat(shminfo.shmid, 0, 0);
shminfo.readOnly = False;
PreviousXErrorHandler = libX11->XSetErrorHandler(XShmErrorHandler);
libX11->XShmAttach(x_display, &shminfo); // May produce a BadAccess error
libX11->XSync(x_display, False);
libX11->XSetErrorHandler(PreviousXErrorHandler);
if(shmBadAccess)
{
mit_shm = false;
XDestroyImage(x_image);
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
shmBadAccess = false;
}
}
if(!mit_shm)
{
buffer = new char[width * height * 4];
x_image = libX11->XCreateImage(x_display, visual, depth, ZPixmap, 0, buffer, width, height, 32, width * 4);
}
}
FrameBufferX11::~FrameBufferX11()
{
if(!mit_shm)
{
x_image->data = 0;
XDestroyImage(x_image);
delete[] buffer;
buffer = 0;
}
else
{
libX11->XShmDetach(x_display, &shminfo);
XDestroyImage(x_image);
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
}
if(ownX11)
{
libX11->XCloseDisplay(x_display);
}
}
void *FrameBufferX11::lock()
{
stride = x_image->bytes_per_line;
locked = buffer;
return locked;
}
void FrameBufferX11::unlock()
{
locked = 0;
}
void FrameBufferX11::blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride)
{
copy(source, sourceFormat, sourceStride);
if(!mit_shm)
{
libX11->XPutImage(x_display, x_window, x_gc, x_image, 0, 0, 0, 0, width, height);
}
else
{
libX11->XShmPutImage(x_display, x_window, x_gc, x_image, 0, 0, 0, 0, width, height, False);
}
libX11->XSync(x_display, False);
}
}
sw::FrameBuffer *createFrameBuffer(void *display, Window window, int width, int height)
{
return new sw::FrameBufferX11((::Display*)display, window, width, height);
}
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#ifndef sw_FrameBufferX11_hpp
#define sw_FrameBufferX11_hpp
#include "Main/FrameBuffer.hpp"
#include "Common/Debug.hpp"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
namespace sw
{
class FrameBufferX11 : public FrameBuffer
{
public:
FrameBufferX11(Display *display, Window window, int width, int height);
~FrameBufferX11();
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
void *lock() override;
void unlock() override;
private:
bool ownX11;
Display *x_display;
Window x_window;
XImage *x_image;
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#ifndef sw_FrameBufferX11_hpp
#define sw_FrameBufferX11_hpp
#include "Main/FrameBuffer.hpp"
#include "Common/Debug.hpp"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
namespace sw
{
class FrameBufferX11 : public FrameBuffer
{
public:
FrameBufferX11(Display *display, Window window, int width, int height);
~FrameBufferX11();
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
void *lock() override;
void unlock() override;
private:
bool ownX11;
Display *x_display;
Window x_window;
XImage *x_image;
GC x_gc;
XVisualInfo x_visual;
bool mit_shm;
XShmSegmentInfo shminfo;
char *buffer;
};
}
#endif // sw_FrameBufferX11_hpp
XVisualInfo x_visual;
bool mit_shm;
XShmSegmentInfo shminfo;
char *buffer;
};
}
#endif // sw_FrameBufferX11_hpp
......@@ -38,23 +38,11 @@
namespace egl
{
typedef std::map<EGLNativeDisplayType, Display*> DisplayMap;
// Protects the global displays map.
sw::BackoffLock displays_lock;
// The order of construction of globals is undefined in C++.
// This function ensures that construction has completed before we attempt
// to access displays.
DisplayMap* getDisplays() {
static DisplayMap displays;
return &displays;
}
egl::Display *Display::getPlatformDisplay(EGLenum platform, EGLNativeDisplayType displayId)
egl::Display *Display::getPlatformDisplay(EGLenum platform, void *nativeDisplay)
{
#ifndef __ANDROID__
if(platform == EGL_UNKNOWN) // Default
if(platform == EGL_UNKNOWN) // Default platform
{
#if defined(__unix__)
if(libX11)
......@@ -68,14 +56,14 @@ egl::Display *Display::getPlatformDisplay(EGLenum platform, EGLNativeDisplayType
#endif
}
if(displayId == EGL_DEFAULT_DISPLAY)
if(!nativeDisplay) // Default display
{
if(platform == EGL_PLATFORM_X11_EXT)
{
#if defined(__unix__)
if(libX11->XOpenDisplay)
{
displayId = libX11->XOpenDisplay(NULL);
nativeDisplay = libX11->XOpenDisplay(NULL);
}
else
{
......@@ -88,26 +76,29 @@ egl::Display *Display::getPlatformDisplay(EGLenum platform, EGLNativeDisplayType
}
else
{
// FIXME: Check if displayId is a valid display device context for <platform>
// FIXME: Check if nativeDisplay is a valid display device context for <platform>
}
#endif
egl::Display *rval;
displays_lock.lock();
DisplayMap* displays = getDisplays();
if (displays->find(displayId) != displays->end())
{
rval = (*displays)[displayId];
} else {
rval = new egl::Display(platform, displayId);
static std::map<void*, Display*> displays;
static sw::BackoffLock displaysMutex;
displaysMutex.lock();
(*displays)[displayId] = rval;
egl::Display *display = displays[nativeDisplay];
if(!display)
{
display = new egl::Display(platform, nativeDisplay);
displays[nativeDisplay] = display;
}
displays_lock.unlock();
return rval;
displaysMutex.unlock();
return display;
}
Display::Display(EGLenum platform, EGLNativeDisplayType displayId) : platform(platform), displayId(displayId)
Display::Display(EGLenum platform, void *nativeDisplay) : platform(platform), nativeDisplay(nativeDisplay)
{
mMinSwapInterval = 1;
mMaxSwapInterval = 1;
......@@ -116,10 +107,6 @@ Display::Display(EGLenum platform, EGLNativeDisplayType displayId) : platform(pl
Display::~Display()
{
terminate();
displays_lock.lock();
getDisplays()->erase(displayId);
displays_lock.unlock();
}
static void cpuid(int registers[4], int info)
......@@ -561,7 +548,7 @@ bool Display::isValidWindow(EGLNativeWindowType window)
if(platform == EGL_PLATFORM_X11_EXT)
{
XWindowAttributes windowAttributes;
Status status = libX11->XGetWindowAttributes(displayId, window, &windowAttributes);
Status status = libX11->XGetWindowAttributes((::Display*)nativeDisplay, window, &windowAttributes);
return status == True;
}
......@@ -596,9 +583,9 @@ EGLint Display::getMaxSwapInterval() const
return mMaxSwapInterval;
}
EGLNativeDisplayType Display::getNativeDisplay() const
void *Display::getNativeDisplay() const
{
return displayId;
return nativeDisplay;
}
sw::Format Display::getDisplayFormat() const
......@@ -680,7 +667,7 @@ sw::Format Display::getDisplayFormat() const
#else
if(platform == EGL_PLATFORM_X11_EXT)
{
Screen *screen = libX11->XDefaultScreenOfDisplay(displayId);
Screen *screen = libX11->XDefaultScreenOfDisplay((::Display*)nativeDisplay);
unsigned int bpp = libX11->XPlanesOfScreen(screen);
switch(bpp)
......
......@@ -28,9 +28,7 @@ namespace egl
class Display
{
public:
~Display();
static egl::Display *getPlatformDisplay(EGLenum platform, EGLNativeDisplayType displayId);
static egl::Display *getPlatformDisplay(EGLenum platform, void *nativeDisplay);
bool initialize();
void terminate();
......@@ -55,20 +53,21 @@ namespace egl
EGLint getMinSwapInterval() const;
EGLint getMaxSwapInterval() const;
EGLNativeDisplayType getNativeDisplay() const;
void *getNativeDisplay() const;
const char *getExtensionString() const;
private:
Display(EGLenum platform, EGLNativeDisplayType displayId);
Display(EGLenum platform, void *nativeDisplay);
~Display();
sw::Format getDisplayFormat() const;
const EGLenum platform;
const EGLNativeDisplayType displayId;
void *const nativeDisplay;
EGLint mMaxSwapInterval;
EGLint mMinSwapInterval;
typedef std::set<Surface*> SurfaceSet;
SurfaceSet mSurfaceSet;
......
......@@ -246,7 +246,7 @@ bool WindowSurface::initialize()
return reset(width, height);
#else
XWindowAttributes windowAttributes;
libX11->XGetWindowAttributes(display->getNativeDisplay(), window, &windowAttributes);
libX11->XGetWindowAttributes((::Display*)display->getNativeDisplay(), window, &windowAttributes);
return reset(windowAttributes.width, windowAttributes.height);
#endif
......@@ -286,7 +286,7 @@ bool WindowSurface::checkForResize()
int clientHeight; window->query(window, NATIVE_WINDOW_HEIGHT, &clientHeight);
#else
XWindowAttributes windowAttributes;
libX11->XGetWindowAttributes(display->getNativeDisplay(), window, &windowAttributes);
libX11->XGetWindowAttributes((::Display*)display->getNativeDisplay(), window, &windowAttributes);
int clientWidth = windowAttributes.width;
int clientHeight = windowAttributes.height;
......
......@@ -108,7 +108,14 @@ EGLDisplay GetDisplay(EGLNativeDisplayType display_id)
{
TRACE("(EGLNativeDisplayType display_id = %p)", display_id);
return egl::Display::getPlatformDisplay(EGL_UNKNOWN, display_id);
if(display_id == EGL_DEFAULT_DISPLAY)
{
return egl::Display::getPlatformDisplay(EGL_UNKNOWN, nullptr);
}
else
{
return egl::Display::getPlatformDisplay(EGL_UNKNOWN, reinterpret_cast<void*>((uintptr_t)display_id));
}
}
EGLBoolean Initialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
......@@ -948,7 +955,7 @@ EGLDisplay GetPlatformDisplayEXT(EGLenum platform, void *native_display, const E
{
TRACE("(EGLenum platform = 0x%X, void *native_display = %p, const EGLint *attrib_list = %p)", platform, native_display, attrib_list);
return egl::Display::getPlatformDisplay(platform, (EGLNativeDisplayType)native_display);
return egl::Display::getPlatformDisplay(platform, native_display);
}
EGLSurface CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list)
......
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// main.h: Management of thread-local data.
#ifndef LIBGL_MAIN_H_
#define LIBGL_MAIN_H_
#include "Context.h"
#include "Device.hpp"
#include "common/debug.h"
#include "Display.h"
#define _GDI32_
#include <windows.h>
#include <GL/GL.h>
#include <GL/glext.h>
namespace gl
{
struct Current
{
Context *context;
Display *display;
Surface *drawSurface;
Surface *readSurface;
};
void makeCurrent(Context *context, Display *display, Surface *surface);
Context *getContext();
Display *getDisplay();
Device *getDevice();
Surface *getCurrentDrawSurface();
Surface *getCurrentReadSurface();
void setCurrentDisplay(Display *dpy);
void setCurrentContext(gl::Context *ctx);
void setCurrentDrawSurface(Surface *surface);
void setCurrentReadSurface(Surface *surface);
}
void error(GLenum errorCode);
template<class T>
T &error(GLenum errorCode, T &returnValue)
{
error(errorCode);
return returnValue;
}
template<class T>
const T &error(GLenum errorCode, const T &returnValue)
{
error(errorCode);
return returnValue;
}
extern sw::FrameBuffer *createFrameBuffer(NativeDisplayType display, NativeWindowType window, int width, int height);
#endif // LIBGL_MAIN_H_
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// main.h: Management of thread-local data.
#ifndef LIBGL_MAIN_H_
#define LIBGL_MAIN_H_
#include "Context.h"
#include "Device.hpp"
#include "common/debug.h"
#include "Display.h"
#define _GDI32_
#include <windows.h>
#include <GL/GL.h>
#include <GL/glext.h>
namespace gl
{
struct Current
{
Context *context;
Display *display;
Surface *drawSurface;
Surface *readSurface;
};
void makeCurrent(Context *context, Display *display, Surface *surface);
Context *getContext();
Display *getDisplay();
Device *getDevice();
Surface *getCurrentDrawSurface();
Surface *getCurrentReadSurface();
void setCurrentDisplay(Display *dpy);
void setCurrentContext(gl::Context *ctx);
void setCurrentDrawSurface(Surface *surface);
void setCurrentReadSurface(Surface *surface);
}
void error(GLenum errorCode);
template<class T>
T &error(GLenum errorCode, T &returnValue)
{
error(errorCode);
return returnValue;
}
template<class T>
const T &error(GLenum errorCode, const T &returnValue)
{
error(errorCode);
return returnValue;
}
extern sw::FrameBuffer *createFrameBuffer(void *display, NativeWindowType window, int width, int height);
#endif // LIBGL_MAIN_H_
......@@ -208,7 +208,7 @@ public:
__eglMustCastToProperFunctionPointerType (*es1GetProcAddress)(const char *procname);
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
sw::FrameBuffer *(*createFrameBuffer)(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
sw::FrameBuffer *(*createFrameBuffer)(void *display, EGLNativeWindowType window, int width, int height);
};
class LibGLES_CM
......
......@@ -337,7 +337,7 @@ egl::Context *es1CreateContext(const egl::Config *config, const egl::Context *sh
extern "C" __eglMustCastToProperFunctionPointerType es1GetProcAddress(const char *procname);
egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
sw::FrameBuffer *createFrameBuffer(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
sw::FrameBuffer *createFrameBuffer(void *display, EGLNativeWindowType window, int width, int height);
extern "C"
{
......
......@@ -229,7 +229,7 @@ public:
__eglMustCastToProperFunctionPointerType (*es2GetProcAddress)(const char *procname);
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
sw::FrameBuffer *(*createFrameBuffer)(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
sw::FrameBuffer *(*createFrameBuffer)(void *display, EGLNativeWindowType window, int width, int height);
};
class LibGLESv2
......
......@@ -1333,7 +1333,7 @@ egl::Context *es2CreateContext(const egl::Config *config, const egl::Context *sh
extern "C" __eglMustCastToProperFunctionPointerType es2GetProcAddress(const char *procname);
egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
sw::FrameBuffer *createFrameBuffer(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
sw::FrameBuffer *createFrameBuffer(void *display, EGLNativeWindowType window, int width, int height);
LibGLESv2exports::LibGLESv2exports()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment