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

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

Issue 822423004: Move most of the transform logic into the primitive processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 years, 11 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 10
11 #include "GrGLContext.h" 11 #include "GrGLContext.h"
12 #include "SkTSearch.h" 12 #include "SkTSearch.h"
13 #include "SkTSort.h" 13 #include "SkTSort.h"
14 14
15 GrGLCaps::GrGLCaps() { 15 GrGLCaps::GrGLCaps() {
16 this->reset(); 16 this->reset();
17 } 17 }
18 18
19 void GrGLCaps::reset() { 19 void GrGLCaps::reset() {
20 INHERITED::reset(); 20 INHERITED::reset();
21 21
22 fVerifiedColorConfigs.reset(); 22 fVerifiedColorConfigs.reset();
23 fStencilFormats.reset(); 23 fStencilFormats.reset();
24 fStencilVerifiedColorConfigs.reset(); 24 fStencilVerifiedColorConfigs.reset();
25 fMSFBOType = kNone_MSFBOType; 25 fMSFBOType = kNone_MSFBOType;
26 fInvalidateFBType = kNone_InvalidateFBType; 26 fInvalidateFBType = kNone_InvalidateFBType;
27 fLATCAlias = kLATC_LATCAlias; 27 fLATCAlias = kLATC_LATCAlias;
28 fNvprSupport = kNone_NvprSupport;
28 fMapBufferType = kNone_MapBufferType; 29 fMapBufferType = kNone_MapBufferType;
29 fMaxFragmentUniformVectors = 0; 30 fMaxFragmentUniformVectors = 0;
30 fMaxVertexAttributes = 0; 31 fMaxVertexAttributes = 0;
31 fMaxFragmentTextureUnits = 0; 32 fMaxFragmentTextureUnits = 0;
32 fMaxFixedFunctionTextureCoords = 0; 33 fMaxFixedFunctionTextureCoords = 0;
33 fRGBA8RenderbufferSupport = false; 34 fRGBA8RenderbufferSupport = false;
34 fBGRAIsInternalFormat = false; 35 fBGRAIsInternalFormat = false;
35 fTextureSwizzleSupport = false; 36 fTextureSwizzleSupport = false;
36 fUnpackRowLengthSupport = false; 37 fUnpackRowLengthSupport = false;
37 fUnpackFlipYSupport = false; 38 fUnpackFlipYSupport = false;
(...skipping 21 matching lines...) Expand all
59 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { 60 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() {
60 *this = caps; 61 *this = caps;
61 } 62 }
62 63
63 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { 64 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) {
64 INHERITED::operator=(caps); 65 INHERITED::operator=(caps);
65 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; 66 fVerifiedColorConfigs = caps.fVerifiedColorConfigs;
66 fStencilFormats = caps.fStencilFormats; 67 fStencilFormats = caps.fStencilFormats;
67 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; 68 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs;
68 fLATCAlias = caps.fLATCAlias; 69 fLATCAlias = caps.fLATCAlias;
70 fNvprSupport = caps.fNvprSupport;
69 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; 71 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors;
70 fMaxVertexAttributes = caps.fMaxVertexAttributes; 72 fMaxVertexAttributes = caps.fMaxVertexAttributes;
71 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; 73 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits;
72 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords; 74 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords;
73 fMSFBOType = caps.fMSFBOType; 75 fMSFBOType = caps.fMSFBOType;
74 fInvalidateFBType = caps.fInvalidateFBType; 76 fInvalidateFBType = caps.fInvalidateFBType;
75 fMapBufferType = caps.fMapBufferType; 77 fMapBufferType = caps.fMapBufferType;
76 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; 78 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport;
77 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; 79 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat;
78 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; 80 fTextureSwizzleSupport = caps.fTextureSwizzleSupport;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // setting individual fragment inputs with ProgramPathFragmentInputG en. The API 349 // setting individual fragment inputs with ProgramPathFragmentInputG en. The API
348 // additions are detected by checking the existence of the function. Eventually we may 350 // additions are detected by checking the existence of the function. Eventually we may
349 // choose to remove the fixed function codepath. 351 // choose to remove the fixed function codepath.
350 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force 352 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force
351 // ProgramPathFragmentInputGen usage on desktop. 353 // ProgramPathFragmentInputGen usage on desktop.
352 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess") && 354 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess") &&
353 (fMaxFixedFunctionTextureCoords > 0 || 355 (fMaxFixedFunctionTextureCoords > 0 ||
354 ((ctxInfo.version() >= GR_GL_VER(4,3) || 356 ((ctxInfo.version() >= GR_GL_VER(4,3) ||
355 ctxInfo.hasExtension("GL_ARB_program_interface_query")) && 357 ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
356 gli->fFunctions.fProgramPathFragmentInputGen)); 358 gli->fFunctions.fProgramPathFragmentInputGen));
359 if (fPathRenderingSupport) {
360 fNvprSupport = gli->fFunctions.fProgramPathFragmentInputGen ? kN ormal_NvprSupport :
361 kL egacy_NvprSupport;
362 }
357 } else { 363 } else {
358 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1); 364 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1);
365 fNvprSupport = fPathRenderingSupport ? kNormal_NvprSupport : kNone_N vprSupport;
359 } 366 }
367 } else {
368 fNvprSupport = kNone_NvprSupport;
360 } 369 }
361 370
362 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); 371 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
363 372
364 // For now these two are equivalent but we could have dst read in shader via some other method 373 // For now these two are equivalent but we could have dst read in shader via some other method
365 fDstReadInShaderSupport = fFBFetchSupport; 374 fDstReadInShaderSupport = fFBFetchSupport;
366 375
367 // Disable scratch texture reuse on Mali and Adreno devices 376 // Disable scratch texture reuse on Mali and Adreno devices
368 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() && 377 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() &&
369 kQualcomm_GrGLVendor != ctxInfo.vendor(); 378 kQualcomm_GrGLVendor != ctxInfo.vendor();
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 1036 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
1028 r.appendf("Fragment coord conventions support: %s\n", 1037 r.appendf("Fragment coord conventions support: %s\n",
1029 (fFragCoordsConventionSupport ? "YES": "NO")); 1038 (fFragCoordsConventionSupport ? "YES": "NO"));
1030 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 1039 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
1031 r.appendf("Use non-VBO for dynamic data: %s\n", 1040 r.appendf("Use non-VBO for dynamic data: %s\n",
1032 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 1041 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
1033 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 1042 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
1034 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 1043 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
1035 return r; 1044 return r;
1036 } 1045 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698