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