| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
| 10 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 if (kDesktop_GrGLBinding == binding) { | 280 if (kDesktop_GrGLBinding == binding) { |
| 281 fBufferLockSupport = true; // we require VBO support and the desktop VBO
extension includes | 281 fBufferLockSupport = true; // we require VBO support and the desktop VBO
extension includes |
| 282 // glMapBuffer. | 282 // glMapBuffer. |
| 283 } else { | 283 } else { |
| 284 fBufferLockSupport = ctxInfo.hasExtension("GL_OES_mapbuffer"); | 284 fBufferLockSupport = ctxInfo.hasExtension("GL_OES_mapbuffer"); |
| 285 } | 285 } |
| 286 | 286 |
| 287 if (kDesktop_GrGLBinding == binding) { | 287 if (kDesktop_GrGLBinding == binding) { |
| 288 if (ctxInfo.version() >= GR_GL_VER(2,0) || | 288 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || |
| 289 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")) { | 289 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); |
| 290 fNPOTTextureTileSupport = true; | 290 fNPOTTextureTileSupport = true; |
| 291 } else { | 291 fMipMapSupport = true; |
| 292 fNPOTTextureTileSupport = false; | |
| 293 } | |
| 294 } else { | 292 } else { |
| 295 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only | 293 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only |
| 296 // ES3 has no limitations. | 294 // ES3 has no limitations. |
| 297 fNPOTTextureTileSupport = ctxInfo.version() >= GR_GL_VER(3,0) || | 295 fNPOTTextureTileSupport = ctxInfo.version() >= GR_GL_VER(3,0) || |
| 298 ctxInfo.hasExtension("GL_OES_texture_npot"); | 296 ctxInfo.hasExtension("GL_OES_texture_npot"); |
| 297 // ES2 supports MIP mapping for POT textures but our caps don't allow fo
r limited MIP |
| 298 // support. The OES extension or ES 3.0 allow for MIPS on NPOT textures.
So, apparently, |
| 299 // does the undocumented GL_IMG_texture_npot extension. This extension d
oes not seem to |
| 300 // to alllow arbitrary wrap modes, however. |
| 301 fMipMapSupport = fNPOTTextureTileSupport || ctxInfo.hasExtension("GL_IMG
_texture_npot"); |
| 299 } | 302 } |
| 300 | 303 |
| 301 fHWAALineSupport = (kDesktop_GrGLBinding == binding); | 304 fHWAALineSupport = (kDesktop_GrGLBinding == binding); |
| 302 | 305 |
| 303 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize); | 306 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize); |
| 304 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize); | 307 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize); |
| 305 // Our render targets are always created with textures as the color | 308 // Our render targets are always created with textures as the color |
| 306 // attachment, hence this min: | 309 // attachment, hence this min: |
| 307 fMaxRenderTargetSize = GrMin(fMaxTextureSize, fMaxRenderTargetSize); | 310 fMaxRenderTargetSize = GrMin(fMaxTextureSize, fMaxRenderTargetSize); |
| 308 | 311 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 654 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 652 r.appendf("Fragment coord conventions support: %s\n", | 655 r.appendf("Fragment coord conventions support: %s\n", |
| 653 (fFragCoordsConventionSupport ? "YES": "NO")); | 656 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 654 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 657 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 655 r.appendf("Use non-VBO for dynamic data: %s\n", | 658 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 656 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 659 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 657 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" :
"NO")); | 660 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" :
"NO")); |
| 658 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 661 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 659 return r; | 662 return r; |
| 660 } | 663 } |
| OLD | NEW |