| 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 | 10 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } else { | 394 } else { |
| 395 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_NV_pixel_buff
er_object")) { | 395 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_NV_pixel_buff
er_object")) { |
| 396 fTransferBufferType = kPBO_TransferBufferType; | 396 fTransferBufferType = kPBO_TransferBufferType; |
| 397 } else if (ctxInfo.hasExtension("GL_CHROMIUM_pixel_transfer_buffer_objec
t")) { | 397 } else if (ctxInfo.hasExtension("GL_CHROMIUM_pixel_transfer_buffer_objec
t")) { |
| 398 fTransferBufferType = kChromium_TransferBufferType; | 398 fTransferBufferType = kChromium_TransferBufferType; |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 // On many GPUs, map memory is very expensive, so we effectively disable it
here by setting the | 402 // On many GPUs, map memory is very expensive, so we effectively disable it
here by setting the |
| 403 // threshold to the maximum unless the client gives us a hint that map memor
y is cheap. | 403 // threshold to the maximum unless the client gives us a hint that map memor
y is cheap. |
| 404 if (fGeometryBufferMapThreshold < 0) { | 404 if (fBufferMapThreshold < 0) { |
| 405 // We think mapping on Chromium will be cheaper once we know ahead of ti
me how much space | 405 // We think mapping on Chromium will be cheaper once we know ahead of ti
me how much space |
| 406 // we will use for all GrBatchs. Right now we might wind up mapping a la
rge buffer and using | 406 // we will use for all GrBatchs. Right now we might wind up mapping a la
rge buffer and using |
| 407 // a small subset. | 407 // a small subset. |
| 408 #if 0 | 408 #if 0 |
| 409 fGeometryBufferMapThreshold = kChromium_GrGLDriver == ctxInfo.driver() ?
0 : SK_MaxS32; | 409 fBufferMapThreshold = kChromium_GrGLDriver == ctxInfo.driver() ? 0 : SK_
MaxS32; |
| 410 #else | 410 #else |
| 411 fGeometryBufferMapThreshold = SK_MaxS32; | 411 fBufferMapThreshold = SK_MaxS32; |
| 412 #endif | 412 #endif |
| 413 } | 413 } |
| 414 | 414 |
| 415 if (kGL_GrGLStandard == standard) { | 415 if (kGL_GrGLStandard == standard) { |
| 416 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || | 416 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || |
| 417 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); | 417 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); |
| 418 fNPOTTextureTileSupport = true; | 418 fNPOTTextureTileSupport = true; |
| 419 fMipMapSupport = true; | 419 fMipMapSupport = true; |
| 420 } else { | 420 } else { |
| 421 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only | 421 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1869 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1870 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1870 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1871 fConfigTable[i].fFormats.fExternalFormat[j]); | 1871 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1872 } | 1872 } |
| 1873 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1873 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1874 } | 1874 } |
| 1875 #endif | 1875 #endif |
| 1876 } | 1876 } |
| 1877 | 1877 |
| 1878 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1878 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |