| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|    57  |    57  | 
|    58     this->init(contextOptions, ctxInfo, glInterface); |    58     this->init(contextOptions, ctxInfo, glInterface); | 
|    59 } |    59 } | 
|    60  |    60  | 
|    61 void GrGLCaps::init(const GrContextOptions& contextOptions, |    61 void GrGLCaps::init(const GrContextOptions& contextOptions, | 
|    62                     const GrGLContextInfo& ctxInfo, |    62                     const GrGLContextInfo& ctxInfo, | 
|    63                     const GrGLInterface* gli) { |    63                     const GrGLInterface* gli) { | 
|    64     GrGLStandard standard = ctxInfo.standard(); |    64     GrGLStandard standard = ctxInfo.standard(); | 
|    65     GrGLVersion version = ctxInfo.version(); |    65     GrGLVersion version = ctxInfo.version(); | 
|    66  |    66  | 
|    67     this->initGLSL(ctxInfo); |  | 
|    68     GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |  | 
|    69  |  | 
|    70     /************************************************************************** |    67     /************************************************************************** | 
|    71      * Caps specific to GrGLCaps |    68      * Caps specific to GrGLCaps | 
|    72      **************************************************************************/ |    69      **************************************************************************/ | 
|    73  |    70  | 
|    74     if (kGLES_GrGLStandard == standard) { |    71     if (kGLES_GrGLStandard == standard) { | 
|    75         GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, |    72         GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, | 
|    76                           &fMaxFragmentUniformVectors); |    73                           &fMaxFragmentUniformVectors); | 
|    77     } else { |    74     } else { | 
|    78         SkASSERT(kGL_GrGLStandard == standard); |    75         SkASSERT(kGL_GrGLStandard == standard); | 
|    79         GrGLint max; |    76         GrGLint max; | 
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   282     fRGBA8888PixelsOpsAreSlow = isANGLE; |   279     fRGBA8888PixelsOpsAreSlow = isANGLE; | 
|   283     // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s
      till true and |   280     // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s
      till true and | 
|   284     // check DX11 ANGLE. |   281     // check DX11 ANGLE. | 
|   285     fPartialFBOReadIsSlow = isANGLE; |   282     fPartialFBOReadIsSlow = isANGLE; | 
|   286 #endif |   283 #endif | 
|   287  |   284  | 
|   288     /************************************************************************** |   285     /************************************************************************** | 
|   289     * GrShaderCaps fields |   286     * GrShaderCaps fields | 
|   290     **************************************************************************/ |   287     **************************************************************************/ | 
|   291  |   288  | 
 |   289     // This must be called after fCoreProfile is set on the GrGLCaps | 
 |   290     this->initGLSL(ctxInfo); | 
 |   291     GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 
 |   292  | 
|   292     glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
      ); |   293     glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
      ); | 
|   293  |   294  | 
|   294     // For now these two are equivalent but we could have dst read in shader via
       some other method. |   295     // For now these two are equivalent but we could have dst read in shader via
       some other method. | 
|   295     // Before setting this, initGLSL() must have been called. |   296     // Before setting this, initGLSL() must have been called. | 
|   296     glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; |   297     glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; | 
|   297  |   298  | 
|   298     // Enable supported shader-related caps |   299     // Enable supported shader-related caps | 
|   299     if (kGL_GrGLStandard == standard) { |   300     if (kGL_GrGLStandard == standard) { | 
|   300         glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
      , 3) || |   301         glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
      , 3) || | 
|   301             ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && |   302             ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && | 
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1272         for (int p = 0; p < kGrSLPrecisionCount; ++p) { |  1273         for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 
|  1273             glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] =  |  1274             glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] =  | 
|  1274                                                glslCaps->fFloatPrecisions[kVerte
      x_GrShaderType][p]; |  1275                                                glslCaps->fFloatPrecisions[kVerte
      x_GrShaderType][p]; | 
|  1275         } |  1276         } | 
|  1276     } |  1277     } | 
|  1277 } |  1278 } | 
|  1278  |  1279  | 
|  1279  |  1280  | 
|  1280  |  1281  | 
|  1281  |  1282  | 
| OLD | NEW |