| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrGLContext.h" | 8 #include "GrGLContext.h" |
| 9 | 9 |
| 10 //////////////////////////////////////////////////////////////////////////////// | 10 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 if (GR_GL_INVALID_VER == args.fGLVersion) { | 33 if (GR_GL_INVALID_VER == args.fGLVersion) { |
| 34 return NULL; | 34 return NULL; |
| 35 } | 35 } |
| 36 | 36 |
| 37 if (!GrGetGLSLGeneration(interface, &args.fGLSLGeneration)) { | 37 if (!GrGetGLSLGeneration(interface, &args.fGLSLGeneration)) { |
| 38 return NULL; | 38 return NULL; |
| 39 } | 39 } |
| 40 | 40 |
| 41 args.fVendor = GrGLGetVendor(interface); | 41 args.fVendor = GrGLGetVendor(interface); |
| 42 | 42 |
| 43 args.fRenderer = GrGLGetRendererFromString(renderer); |
| 44 |
| 43 /* | 45 /* |
| 44 * Qualcomm drivers have a horrendous bug with some drivers. Though they cla
im to | 46 * Qualcomm drivers for the 3xx series have a horrendous bug with some drive
rs. Though they |
| 45 * support GLES 3.00, some perfectly valid GLSL300 shaders will only compile
with | 47 * claim to support GLES 3.00, some perfectly valid GLSL300 shaders will onl
y compile with |
| 46 * #version 100, and will fail to compile with #version 300 es. In the long
term, we | 48 * #version 100, and will fail to compile with #version 300 es. In the long
term, we |
| 47 * need to lock this down to a specific driver version. | 49 * need to lock this down to a specific driver version. |
| 50 * ?????/2015 - This bug is still present in Lollipop pre-mr1 |
| 51 * 06/18/2015 - This bug does not affect the nexus 6 (which has an Adreno 4x
x). |
| 48 */ | 52 */ |
| 49 if (kQualcomm_GrGLVendor == args.fVendor) { | 53 if (kAdreno3xx_GrGLRenderer == args.fRenderer) { |
| 50 args.fGLSLGeneration = k110_GrGLSLGeneration; | 54 args.fGLSLGeneration = k110_GrGLSLGeneration; |
| 51 } | 55 } |
| 52 | 56 |
| 53 args.fRenderer = GrGLGetRendererFromString(renderer); | |
| 54 | |
| 55 GrGLGetDriverInfo(interface->fStandard, args.fVendor, renderer, ver, | 57 GrGLGetDriverInfo(interface->fStandard, args.fVendor, renderer, ver, |
| 56 &args.fDriver, &args.fDriverVersion); | 58 &args.fDriver, &args.fDriverVersion); |
| 57 | 59 |
| 58 args.fContextOptions = &options; | 60 args.fContextOptions = &options; |
| 59 | 61 |
| 60 return SkNEW_ARGS(GrGLContext, (args)); | 62 return SkNEW_ARGS(GrGLContext, (args)); |
| 61 } | 63 } |
| 62 | 64 |
| 63 GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) { | 65 GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) { |
| 64 fInterface.reset(SkRef(args.fInterface)); | 66 fInterface.reset(SkRef(args.fInterface)); |
| 65 fGLVersion = args.fGLVersion; | 67 fGLVersion = args.fGLVersion; |
| 66 fGLSLGeneration = args.fGLSLGeneration; | 68 fGLSLGeneration = args.fGLSLGeneration; |
| 67 fVendor = args.fVendor; | 69 fVendor = args.fVendor; |
| 68 fRenderer = args.fRenderer; | 70 fRenderer = args.fRenderer; |
| 69 fDriver = args.fDriver; | 71 fDriver = args.fDriver; |
| 70 fDriverVersion = args.fDriverVersion; | 72 fDriverVersion = args.fDriverVersion; |
| 71 | 73 |
| 72 fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*args.fContextOptions, *this, fInterface
))); | 74 fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*args.fContextOptions, *this, fInterface
))); |
| 73 } | 75 } |
| OLD | NEW |