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

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

Issue 437473002: Wrap NV_path_rendering API with GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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
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 #include "GrGLContext.h" 10 #include "GrGLContext.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 fHWAALineSupport = (kGL_GrGLStandard == standard); 306 fHWAALineSupport = (kGL_GrGLStandard == standard);
307 307
308 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize); 308 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize);
309 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize); 309 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize);
310 // Our render targets are always created with textures as the color 310 // Our render targets are always created with textures as the color
311 // attachment, hence this min: 311 // attachment, hence this min:
312 fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize); 312 fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
313 313
314 fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering"); 314 fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
315 fPathRenderingV13Support = false;
315 316
316 if (fPathRenderingSupport) { 317 if (fPathRenderingSupport) {
317 if (kGL_GrGLStandard == standard) { 318 if (kGL_GrGLStandard == standard) {
319 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess");
320
321 // NVPR v1.3 introduces additional methods to the desktop API. We kn ow the particular
322 // context we are on has v1.3 support as long as all the new methods are non-null
323 // their supporting GL functionality is present.
324 fPathRenderingV13Support = fPathRenderingSupport &&
325 NULL != gli->fFunctions.fStencilThenCover FillPath &&
326 NULL != gli->fFunctions.fStencilThenCover StrokePath &&
327 NULL != gli->fFunctions.fStencilThenCover FillPathInstanced &&
328 NULL != gli->fFunctions.fStencilThenCover StrokePathInstanced &&
329 (NULL != gli->fFunctions.fProgramPathFrag mentInputGen &&
330 (ctxInfo.version() >= GR_GL_VER(4,3) ||
331 ctxInfo.hasExtension("GL_ARB_program_i nterface_query")));
332
318 // We need one of the two possible texturing methods: using fixed fu nction pipeline 333 // We need one of the two possible texturing methods: using fixed fu nction pipeline
319 // (PathTexGen, texcoords, ...) or using the newer NVPR API additio ns that support 334 // (PathTexGen, texcoords, ...) or using the newer NVPR v1.3 API ad ditions that support
320 // setting individual fragment inputs with ProgramPathFragmentInputG en. The API 335 // setting individual fragment inputs with ProgramPathFragmentInputG en. Eventually we
321 // additions are detected by checking the existence of the function. Eventually we may 336 // may choose to remove the fixed function codepath.
322 // choose to remove the fixed function codepath.
323 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force 337 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force
324 // ProgramPathFragmentInputGen usage on desktop. 338 // ProgramPathFragmentInputGen usage on desktop.
325 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess") && 339 if (0 == fMaxFixedFunctionTextureCoords && !fPathRenderingV13Support ) {
326 (fMaxFixedFunctionTextureCoords > 0 || 340 fPathRenderingSupport = false;
327 ((ctxInfo.version() >= GR_GL_VER(4,3) || 341 }
328 ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
329 NULL != gli->fFunctions.fProgramPathFragmentInputGen));
330 } else { 342 } else {
331 // Note: path rendering is not yet implemented for GLES. 343 // Note: path rendering is not yet implemented for GLES.
332 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1) && false ; 344 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1) && false ;
345
346 // NVpr v1.3 support is always present on GLES.
347 fPathRenderingV13Support = fPathRenderingSupport;
333 } 348 }
334 } 349 }
335 350
336 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); 351 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
337 352
338 fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType; 353 fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType;
339 354
340 // Disable scratch texture reuse on Mali and Adreno devices 355 // Disable scratch texture reuse on Mali and Adreno devices
341 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() && 356 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() &&
342 kQualcomm_GrGLVendor != ctxInfo.vendor(); 357 kQualcomm_GrGLVendor != ctxInfo.vendor();
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 851 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
837 r.appendf("Fragment coord conventions support: %s\n", 852 r.appendf("Fragment coord conventions support: %s\n",
838 (fFragCoordsConventionSupport ? "YES": "NO")); 853 (fFragCoordsConventionSupport ? "YES": "NO"));
839 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 854 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
840 r.appendf("Use non-VBO for dynamic data: %s\n", 855 r.appendf("Use non-VBO for dynamic data: %s\n",
841 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 856 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
842 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 857 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
843 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 858 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
844 return r; 859 return r;
845 } 860 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698