LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/gpu/gl - GrGLContext.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 40 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright 2013 Google Inc.
       3             :  *
       4             :  * Use of this source code is governed by a BSD-style license that can be
       5             :  * found in the LICENSE file.
       6             :  */
       7             : 
       8             : #include "GrGLContext.h"
       9             : #include "GrGLGLSL.h"
      10             : #include "SkSLCompiler.h"
      11             : 
      12             : ////////////////////////////////////////////////////////////////////////////////
      13             : 
      14           0 : GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContextOptions& options) {
      15             :     // We haven't validated the GrGLInterface yet, so check for GetString function pointer
      16           0 :     if (!interface->fFunctions.fGetString) {
      17           0 :         return nullptr;
      18             :     }
      19             :     ConstructorArgs args;
      20           0 :     args.fInterface = interface;
      21             : 
      22             :     const GrGLubyte* verUByte;
      23           0 :     GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION));
      24           0 :     const char* ver = reinterpret_cast<const char*>(verUByte);
      25             : 
      26             :     const GrGLubyte* rendererUByte;
      27           0 :     GR_GL_CALL_RET(interface, rendererUByte, GetString(GR_GL_RENDERER));
      28           0 :     const char* renderer = reinterpret_cast<const char*>(rendererUByte);
      29             : 
      30           0 :     if (!interface->validate()) {
      31           0 :         return nullptr;
      32             :     }
      33             : 
      34           0 :     args.fGLVersion = GrGLGetVersionFromString(ver);
      35           0 :     if (GR_GL_INVALID_VER == args.fGLVersion) {
      36           0 :         return nullptr;
      37             :     }
      38             : 
      39           0 :     if (!GrGLGetGLSLGeneration(interface, &args.fGLSLGeneration)) {
      40           0 :         return nullptr;
      41             :     }
      42             : 
      43           0 :     args.fVendor = GrGLGetVendor(interface);
      44             : 
      45           0 :     args.fRenderer = GrGLGetRendererFromString(renderer);
      46             : 
      47             :     /*
      48             :      * Qualcomm drivers for the 3xx series have a horrendous bug with some drivers. Though they
      49             :      * claim to support GLES 3.00, some perfectly valid GLSL300 shaders will only compile with
      50             :      * #version 100, and will fail to compile with #version 300 es.  In the long term, we
      51             :      * need to lock this down to a specific driver version.
      52             :      * ?????/2015 - This bug is still present in Lollipop pre-mr1
      53             :      * 06/18/2015 - This bug does not affect the nexus 6 (which has an Adreno 4xx).
      54             :      */
      55           0 :     if (kAdreno3xx_GrGLRenderer == args.fRenderer) {
      56           0 :         args.fGLSLGeneration = k110_GrGLSLGeneration;
      57             :     }
      58             : 
      59           0 :     GrGLGetDriverInfo(interface->fStandard, args.fVendor, renderer, ver,
      60           0 :                       &args.fDriver, &args.fDriverVersion);
      61             : 
      62           0 :     args.fContextOptions = &options;
      63             : 
      64           0 :     return new GrGLContext(args);
      65             : }
      66             : 
      67           0 : GrGLContext::~GrGLContext() {
      68           0 :     delete fCompiler;
      69           0 : }
      70             : 
      71           0 : SkSL::Compiler* GrGLContext::compiler() const {
      72           0 :     if (!fCompiler) {
      73           0 :         fCompiler = new SkSL::Compiler();
      74             :     }
      75           0 :     return fCompiler;
      76             : }
      77             : 
      78           0 : GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) {
      79           0 :     fInterface.reset(SkRef(args.fInterface));
      80           0 :     fGLVersion = args.fGLVersion;
      81           0 :     fGLSLGeneration = args.fGLSLGeneration;
      82           0 :     fVendor = args.fVendor;
      83           0 :     fRenderer = args.fRenderer;
      84           0 :     fDriver = args.fDriver;
      85           0 :     fDriverVersion = args.fDriverVersion;
      86             : 
      87           0 :     fGLCaps = sk_make_sp<GrGLCaps>(*args.fContextOptions, *this, fInterface.get());
      88           0 : }

Generated by: LCOV version 1.13