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 //////////////////////////////////////////////////////////////////////////////// |
11 | 11 |
12 GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContext
Options& options) { | 12 GrGLContext* GrGLContext::Create(const GrGLInterface* interface) { |
13 // We haven't validated the GrGLInterface yet, so check for GetString functi
on pointer | 13 // We haven't validated the GrGLInterface yet, so check for GetString functi
on pointer |
14 if (!interface->fFunctions.fGetString) { | 14 if (!interface->fFunctions.fGetString) { |
15 return NULL; | 15 return NULL; |
16 } | 16 } |
17 ConstructorArgs args; | 17 ConstructorArgs args; |
18 args.fInterface = interface; | 18 args.fInterface = interface; |
19 | 19 |
20 const GrGLubyte* verUByte; | 20 const GrGLubyte* verUByte; |
21 GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION)); | 21 GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION)); |
22 const char* ver = reinterpret_cast<const char*>(verUByte); | 22 const char* ver = reinterpret_cast<const char*>(verUByte); |
(...skipping 25 matching lines...) Expand all Loading... |
48 */ | 48 */ |
49 if (kQualcomm_GrGLVendor == args.fVendor) { | 49 if (kQualcomm_GrGLVendor == args.fVendor) { |
50 args.fGLSLGeneration = k110_GrGLSLGeneration; | 50 args.fGLSLGeneration = k110_GrGLSLGeneration; |
51 } | 51 } |
52 | 52 |
53 args.fRenderer = GrGLGetRendererFromString(renderer); | 53 args.fRenderer = GrGLGetRendererFromString(renderer); |
54 | 54 |
55 args.fIsMesa = GrGLIsMesaFromVersionString(ver); | 55 args.fIsMesa = GrGLIsMesaFromVersionString(ver); |
56 | 56 |
57 args.fIsChromium = GrGLIsChromiumFromRendererString(renderer); | 57 args.fIsChromium = GrGLIsChromiumFromRendererString(renderer); |
58 | |
59 args.fContextOptions = &options; | |
60 | |
61 return SkNEW_ARGS(GrGLContext, (args)); | 58 return SkNEW_ARGS(GrGLContext, (args)); |
62 } | 59 } |
63 | 60 |
64 GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) { | 61 GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) { |
65 fInterface.reset(SkRef(args.fInterface)); | 62 fInterface.reset(SkRef(args.fInterface)); |
66 fGLVersion = args.fGLVersion; | 63 fGLVersion = args.fGLVersion; |
67 fGLSLGeneration = args.fGLSLGeneration; | 64 fGLSLGeneration = args.fGLSLGeneration; |
68 fVendor = args.fVendor; | 65 fVendor = args.fVendor; |
69 fRenderer = args.fRenderer; | 66 fRenderer = args.fRenderer; |
70 fIsMesa = args.fIsMesa; | 67 fIsMesa = args.fIsMesa; |
71 fIsChromium = args.fIsChromium; | 68 fIsChromium = args.fIsChromium; |
72 | 69 |
73 fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*args.fContextOptions, *this, fInterface
))); | 70 fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*this, fInterface))); |
74 } | 71 } |
OLD | NEW |