| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
| 10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // support for GL_ALPHA and ALPHA8 | 194 // support for GL_ALPHA and ALPHA8 |
| 195 | 195 |
| 196 // GL_EXT_bgra adds BGRA render targets to any version | 196 // GL_EXT_bgra adds BGRA render targets to any version |
| 197 | 197 |
| 198 // ES 2.0 | 198 // ES 2.0 |
| 199 // color renderable: RGBA4, RGB5_A1, RGB565 | 199 // color renderable: RGBA4, RGB5_A1, RGB565 |
| 200 // GL_EXT_texture_rg adds support for R8 as a color render target | 200 // GL_EXT_texture_rg adds support for R8 as a color render target |
| 201 // GL_OES_rgb8_rgba8 and/or GL_ARM_rgba8 adds support for RGBA8 | 201 // GL_OES_rgb8_rgba8 and/or GL_ARM_rgba8 adds support for RGBA8 |
| 202 // GL_EXT_texture_format_BGRA8888 and/or GL_APPLE_texture_format_BGRA8888 a
dded BGRA support | 202 // GL_EXT_texture_format_BGRA8888 and/or GL_APPLE_texture_format_BGRA8888 a
dded BGRA support |
| 203 | 203 |
| 204 // ES 3.0 |
| 205 // Same as ES 2.0 except R8 and RGBA8 are supported without extensions (the
functions called |
| 206 // below already account for this). |
| 207 |
| 204 if (kDesktop_GrGLBinding == this->glBinding()) { | 208 if (kDesktop_GrGLBinding == this->glBinding()) { |
| 205 // Post 3.0 we will get R8 | 209 // Post 3.0 we will get R8 |
| 206 // Prior to 3.0 we will get ALPHA8 (with GL_ARB_framebuffer_object) | 210 // Prior to 3.0 we will get ALPHA8 (with GL_ARB_framebuffer_object) |
| 207 if (this->glVersion() >= GR_GL_VER(3,0) || | 211 if (this->glVersion() >= GR_GL_VER(3,0) || |
| 208 this->hasExtension("GL_ARB_framebuffer_object")) { | 212 this->hasExtension("GL_ARB_framebuffer_object")) { |
| 209 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = true; | 213 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = true; |
| 210 } | 214 } |
| 211 } else { | 215 } else { |
| 212 // On ES we can only hope for R8 | 216 // On ES we can only hope for R8 |
| 213 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = | 217 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = |
| (...skipping 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 this->setVertexArrayID(gpu, 0); | 2556 this->setVertexArrayID(gpu, 0); |
| 2553 } | 2557 } |
| 2554 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2558 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2555 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2559 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2556 fDefaultVertexArrayAttribState.resize(attrCount); | 2560 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2557 } | 2561 } |
| 2558 attribState = &fDefaultVertexArrayAttribState; | 2562 attribState = &fDefaultVertexArrayAttribState; |
| 2559 } | 2563 } |
| 2560 return attribState; | 2564 return attribState; |
| 2561 } | 2565 } |
| OLD | NEW |