Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1161543003: Set GeometryBufferMapThreshold defaults (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrContextOptions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 fMapBufferType = kChromium_MapBufferType; 264 fMapBufferType = kChromium_MapBufferType;
265 } else if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_ma p_buffer_range")) { 265 } else if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_ma p_buffer_range")) {
266 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; 266 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
267 fMapBufferType = kMapBufferRange_MapBufferType; 267 fMapBufferType = kMapBufferRange_MapBufferType;
268 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { 268 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) {
269 fMapBufferFlags = kCanMap_MapFlag; 269 fMapBufferFlags = kCanMap_MapFlag;
270 fMapBufferType = kMapBuffer_MapBufferType; 270 fMapBufferType = kMapBuffer_MapBufferType;
271 } 271 }
272 } 272 }
273 273
274 // On many GPUs, map memory is very expensive, so we effectively disable it here by setting the
275 // threshold to the maximum unless the client gives us a hint that map memor y is cheap.
276 if (fGeometryBufferMapThreshold < 0) {
277 fGeometryBufferMapThreshold = ctxInfo.isChromium() ? 0 : SK_MaxS32;
278 }
279
274 if (kGL_GrGLStandard == standard) { 280 if (kGL_GrGLStandard == standard) {
275 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || 281 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) ||
276 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); 282 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two"));
277 fNPOTTextureTileSupport = true; 283 fNPOTTextureTileSupport = true;
278 fMipMapSupport = true; 284 fMipMapSupport = true;
279 } else { 285 } else {
280 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip filters only 286 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip filters only
281 // ES3 has no limitations. 287 // ES3 has no limitations.
282 fNPOTTextureTileSupport = ctxInfo.version() >= GR_GL_VER(3,0) || 288 fNPOTTextureTileSupport = ctxInfo.version() >= GR_GL_VER(3,0) ||
283 ctxInfo.hasExtension("GL_OES_texture_npot"); 289 ctxInfo.hasExtension("GL_OES_texture_npot");
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 if (fGeometryShaderSupport) { 1115 if (fGeometryShaderSupport) {
1110 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1116 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1111 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; 1117 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p];
1112 } 1118 }
1113 } 1119 }
1114 } 1120 }
1115 1121
1116 1122
1117 1123
1118 1124
OLDNEW
« no previous file with comments | « include/gpu/GrContextOptions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698