From 3f3ffd6ad9fa4cbaef1f2a2efee2b03bf5891b3e Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 18 Jan 2011 17:14:52 +0000 Subject: Fix stencil format array. git-svn-id: http://skia.googlecode.com/svn/trunk@703 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/include/GrGLConfig.h | 5 +++-- gpu/src/GrGpuGL.cpp | 56 +++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/gpu/include/GrGLConfig.h b/gpu/include/GrGLConfig.h index e21adb7578..b4779bc2b7 100644 --- a/gpu/include/GrGLConfig.h +++ b/gpu/include/GrGLConfig.h @@ -251,18 +251,19 @@ struct GrGLExts { #define GR_BGRA 0x80E1 -// FBO +// FBO / stencil formats #define GR_FRAMEBUFFER 0x8D40 #define GR_FRAMEBUFFER_COMPLETE 0x8CD5 #define GR_COLOR_ATTACHMENT0 0x8CE0 #define GR_FRAMEBUFFER_BINDING 0x8CA6 #define GR_RENDERBUFFER 0x8D41 #define GR_STENCIL_ATTACHMENT 0x8D20 +#define GR_STENCIL_INDEX4 0x8D47 #define GR_STENCIL_INDEX8 0x8D48 #define GR_STENCIL_INDEX16 0x8D49 +#define GR_DEPTH24_STENCIL8 0x88F0 #define GR_MAX_RENDERBUFFER_SIZE 0x84E8 #define GR_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GR_UNSIGNED_INT_24_8 0x84FA #define GR_DEPTH_STENCIL 0x84F9 #define GR_RGBA8 0x8058 #define GR_RGB565 0x8D62 diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp index ff3519389f..23636d1a92 100644 --- a/gpu/src/GrGpuGL.cpp +++ b/gpu/src/GrGpuGL.cpp @@ -524,33 +524,6 @@ void GrGpuGL::resetContext() { resetContextHelper(); } - -// defines stencil formats from more to less preferred -#if GR_SUPPORT_GLES - GLenum GR_GL_STENCIL_FORMAT_ARRAY[] = { - GR_STENCIL_INDEX8, - }; -#else - GLenum GR_GL_STENCIL_FORMAT_ARRAY[] = { - GR_STENCIL_INDEX8, - GR_STENCIL_INDEX16, - GR_UNSIGNED_INT_24_8, - GR_DEPTH_STENCIL, - }; -#endif - -// good to set a break-point here to know when createTexture fails -static GrTexture* return_null_texture() { -// GrAssert(!"null texture"); - return NULL; -} - -#if GR_DEBUG -static size_t as_size_t(int x) { - return x; -} -#endif - GrRenderTarget* GrGpuGL::createPlatformRenderTarget( intptr_t platformRenderTarget, int width, int height) { @@ -573,6 +546,35 @@ GrRenderTarget* GrGpuGL::createPlatformRenderTarget( return rt; } +// defines stencil formats from more to less preferred +GLenum GR_GL_STENCIL_FORMAT_ARRAY[] = { + GR_STENCIL_INDEX8, + +#if GR_SUPPORT_GLDESKTOP + GR_STENCIL_INDEX16, +#endif + + GR_DEPTH24_STENCIL8, + GR_STENCIL_INDEX4, + +#if GR_SUPPORT_GLDESKTOP + GL_STENCIL_INDEX, + GR_DEPTH_STENCIL, +#endif +}; + +// good to set a break-point here to know when createTexture fails +static GrTexture* return_null_texture() { +// GrAssert(!"null texture"); + return NULL; +} + +#if GR_DEBUG +static size_t as_size_t(int x) { + return x; +} +#endif + GrTexture* GrGpuGL::createTexture(const TextureDesc& desc, const void* srcData, size_t rowBytes) { -- cgit v1.2.3