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

Side by Side Diff: src/gpu/gl/GrGLContext.h

Issue 2288033003: Turned on SkSL->GLSL compiler (Closed)
Patch Set: changed <iostream> to <ostream> Created 4 years, 2 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
« no previous file with comments | « gyp/sksl.gyp ('k') | src/gpu/gl/GrGLContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 #ifndef GrGLContext_DEFINED 9 #ifndef GrGLContext_DEFINED
10 #define GrGLContext_DEFINED 10 #define GrGLContext_DEFINED
11 11
12 #include "gl/GrGLExtensions.h" 12 #include "gl/GrGLExtensions.h"
13 #include "gl/GrGLInterface.h" 13 #include "gl/GrGLInterface.h"
14 #include "GrGLCaps.h" 14 #include "GrGLCaps.h"
15 #include "GrGLUtil.h" 15 #include "GrGLUtil.h"
16 16
17 struct GrContextOptions; 17 struct GrContextOptions;
18 namespace SkSL {
19 class Compiler;
20 }
18 21
19 /** 22 /**
20 * Encapsulates information about an OpenGL context including the OpenGL 23 * Encapsulates information about an OpenGL context including the OpenGL
21 * version, the GrGLStandard type of the context, and GLSL version. 24 * version, the GrGLStandard type of the context, and GLSL version.
22 */ 25 */
23 class GrGLContextInfo : public SkRefCnt { 26 class GrGLContextInfo : public SkRefCnt {
24 public: 27 public:
25 GrGLStandard standard() const { return fInterface->fStandard; } 28 GrGLStandard standard() const { return fInterface->fStandard; }
26 GrGLVersion version() const { return fGLVersion; } 29 GrGLVersion version() const { return fGLVersion; }
27 GrGLSLGeneration glslGeneration() const { return fGLSLGeneration; } 30 GrGLSLGeneration glslGeneration() const { return fGLSLGeneration; }
28 GrGLVendor vendor() const { return fVendor; } 31 GrGLVendor vendor() const { return fVendor; }
29 GrGLRenderer renderer() const { return fRenderer; } 32 GrGLRenderer renderer() const { return fRenderer; }
30 /** What driver is running our GL implementation? This is not necessarily re lated to the vendor. 33 /** What driver is running our GL implementation? This is not necessarily re lated to the vendor.
31 (e.g. Intel GPU being driven by Mesa) */ 34 (e.g. Intel GPU being driven by Mesa) */
32 GrGLDriver driver() const { return fDriver; } 35 GrGLDriver driver() const { return fDriver; }
33 GrGLDriverVersion driverVersion() const { return fDriverVersion; } 36 GrGLDriverVersion driverVersion() const { return fDriverVersion; }
34 const GrGLCaps* caps() const { return fGLCaps.get(); } 37 const GrGLCaps* caps() const { return fGLCaps.get(); }
35 GrGLCaps* caps() { return fGLCaps; } 38 GrGLCaps* caps() { return fGLCaps; }
36 bool hasExtension(const char* ext) const { 39 bool hasExtension(const char* ext) const {
37 return fInterface->hasExtension(ext); 40 return fInterface->hasExtension(ext);
38 } 41 }
39 42
40 const GrGLExtensions& extensions() const { return fInterface->fExtensions; } 43 const GrGLExtensions& extensions() const { return fInterface->fExtensions; }
41 44
45 virtual ~GrGLContextInfo() {}
46
42 protected: 47 protected:
43 struct ConstructorArgs { 48 struct ConstructorArgs {
44 const GrGLInterface* fInterface; 49 const GrGLInterface* fInterface;
45 GrGLVersion fGLVersion; 50 GrGLVersion fGLVersion;
46 GrGLSLGeneration fGLSLGeneration; 51 GrGLSLGeneration fGLSLGeneration;
47 GrGLVendor fVendor; 52 GrGLVendor fVendor;
48 GrGLRenderer fRenderer; 53 GrGLRenderer fRenderer;
49 GrGLDriver fDriver; 54 GrGLDriver fDriver;
50 GrGLDriverVersion fDriverVersion; 55 GrGLDriverVersion fDriverVersion;
51 const GrContextOptions* fContextOptions; 56 const GrContextOptions* fContextOptions;
52 }; 57 };
53 58
54 GrGLContextInfo(const ConstructorArgs& args); 59 GrGLContextInfo(const ConstructorArgs& args);
55 60
56 SkAutoTUnref<const GrGLInterface> fInterface; 61 SkAutoTUnref<const GrGLInterface> fInterface;
57 GrGLVersion fGLVersion; 62 GrGLVersion fGLVersion;
58 GrGLSLGeneration fGLSLGeneration; 63 GrGLSLGeneration fGLSLGeneration;
59 GrGLVendor fVendor; 64 GrGLVendor fVendor;
60 GrGLRenderer fRenderer; 65 GrGLRenderer fRenderer;
61 GrGLDriver fDriver; 66 GrGLDriver fDriver;
62 GrGLDriverVersion fDriverVersion; 67 GrGLDriverVersion fDriverVersion;
63 SkAutoTUnref<GrGLCaps> fGLCaps; 68 SkAutoTUnref<GrGLCaps> fGLCaps;
64 }; 69 };
65 70
66 /** 71 /**
67 * Extension of GrGLContextInfo that also provides access to GrGLInterface. 72 * Extension of GrGLContextInfo that also provides access to GrGLInterface and S kSL::Compiler.
68 */ 73 */
69 class GrGLContext : public GrGLContextInfo { 74 class GrGLContext : public GrGLContextInfo {
70 public: 75 public:
71 /** 76 /**
72 * Creates a GrGLContext from a GrGLInterface and the currently 77 * Creates a GrGLContext from a GrGLInterface and the currently
73 * bound OpenGL context accessible by the GrGLInterface. 78 * bound OpenGL context accessible by the GrGLInterface.
74 */ 79 */
75 static GrGLContext* Create(const GrGLInterface* interface, const GrContextOp tions& options); 80 static GrGLContext* Create(const GrGLInterface* interface, const GrContextOp tions& options);
76 81
77 const GrGLInterface* interface() const { return fInterface; } 82 const GrGLInterface* interface() const { return fInterface; }
78 83
84 SkSL::Compiler* compiler() const;
85
86 ~GrGLContext() override;
87
79 private: 88 private:
80 GrGLContext(const ConstructorArgs& args) : INHERITED(args) {} 89 GrGLContext(const ConstructorArgs& args)
90 : INHERITED(args)
91 , fCompiler(nullptr) {}
92
93 mutable SkSL::Compiler* fCompiler;
81 94
82 typedef GrGLContextInfo INHERITED; 95 typedef GrGLContextInfo INHERITED;
83 }; 96 };
84 97
85 #endif 98 #endif
OLDNEW
« no previous file with comments | « gyp/sksl.gyp ('k') | src/gpu/gl/GrGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698