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

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

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unneeded assert Created 4 years, 8 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/GrGLProgramDataManager.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 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 #ifndef GrGLSampler_DEFINED
9 #define GrGLSampler_DEFINED
10
11 #include "glsl/GrGLSLSampler.h"
12
13 #include "gl/GrGLTypes.h"
14 #include "glsl/GrGLSLShaderVar.h"
15
16 class GrGLSampler : public GrGLSLSampler {
17 public:
18 GrGLSampler(uint32_t visibility,
19 GrPixelConfig config,
20 GrSLType type,
21 GrSLPrecision precision,
22 const char* name) : INHERITED(visibility, config) {
23 SkASSERT(GrSLTypeIsSamplerType(type));
24 fShaderVar.setType(type);
25 fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
26 fShaderVar.setPrecision(precision);
27 fShaderVar.accessName()->set(name);
28 }
29
30 GrGLint location() const { return fLocation; }
31 GrSLType type() const override { return fShaderVar.getType(); }
32
33 const char* onGetSamplerNameForTexture2D() const override { return fShaderVa r.c_str(); }
34 const char* getSamplerNameForTexelFetch() const override { return fShaderVar .c_str(); }
35
36 private:
37 GrGLSLShaderVar fShaderVar;
38 GrGLint fLocation;
39
40 friend class GrGLUniformHandler;
41
42 typedef GrGLSLSampler INHERITED;
43 };
44
45 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698