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

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

Issue 2143143002: Add Texture2D and Sampler GrSLTypes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 5 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 | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/gl/GrGLTexture.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 2016 Google Inc. 2 * Copyright 2016 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 #ifndef GrGLSampler_DEFINED 8 #ifndef GrGLSampler_DEFINED
9 #define GrGLSampler_DEFINED 9 #define GrGLSampler_DEFINED
10 10
11 #include "glsl/GrGLSLSampler.h" 11 #include "glsl/GrGLSLSampler.h"
12 12
13 #include "gl/GrGLTypes.h" 13 #include "gl/GrGLTypes.h"
14 #include "glsl/GrGLSLShaderVar.h" 14 #include "glsl/GrGLSLShaderVar.h"
15 15
16 class GrGLSampler : public GrGLSLSampler { 16 class GrGLSampler : public GrGLSLSampler {
17 public: 17 public:
18 GrGLSampler(uint32_t visibility, 18 GrGLSampler(uint32_t visibility,
19 GrPixelConfig config, 19 GrPixelConfig config,
20 GrSLType type, 20 GrSLType type,
21 GrSLPrecision precision, 21 GrSLPrecision precision,
22 const char* name) : INHERITED(visibility, config) { 22 const char* name) : INHERITED(visibility, config) {
23 SkASSERT(GrSLTypeIsSamplerType(type)); 23 SkASSERT(GrSLTypeIsCombinedSamplerType(type));
24 fShaderVar.setType(type); 24 fShaderVar.setType(type);
25 fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier); 25 fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
26 fShaderVar.setPrecision(precision); 26 fShaderVar.setPrecision(precision);
27 fShaderVar.accessName()->set(name); 27 fShaderVar.accessName()->set(name);
28 } 28 }
29 29
30 GrGLint location() const { return fLocation; } 30 GrGLint location() const { return fLocation; }
31 GrSLType type() const override { return fShaderVar.getType(); } 31 GrSLType type() const override { return fShaderVar.getType(); }
32 32
33 const char* onGetSamplerNameForTexture2D() const override { return fShaderVa r.c_str(); } 33 const char* onGetSamplerNameForTexture2D() const override { return fShaderVa r.c_str(); }
34 const char* getSamplerNameForTexelFetch() const override { return fShaderVar .c_str(); } 34 const char* getSamplerNameForTexelFetch() const override { return fShaderVar .c_str(); }
35 35
36 private: 36 private:
37 GrGLSLShaderVar fShaderVar; 37 GrGLSLShaderVar fShaderVar;
38 GrGLint fLocation; 38 GrGLint fLocation;
39 39
40 friend class GrGLUniformHandler; 40 friend class GrGLUniformHandler;
41 41
42 typedef GrGLSLSampler INHERITED; 42 typedef GrGLSLSampler INHERITED;
43 }; 43 };
44 44
45 #endif 45 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/gl/GrGLTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698