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

Side by Side Diff: src/gpu/glsl/GrGLSLSampler.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/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.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 GrGLSLSampler_DEFINED 8 #ifndef GrGLSLSampler_DEFINED
9 #define GrGLSLSampler_DEFINED 9 #define GrGLSLSampler_DEFINED
10 10
(...skipping 11 matching lines...) Expand all
22 SkASSERT(kUnknown_GrPixelConfig != fConfig); 22 SkASSERT(kUnknown_GrPixelConfig != fConfig);
23 } 23 }
24 24
25 uint32_t visibility() const { return fVisibility; } 25 uint32_t visibility() const { return fVisibility; }
26 GrPixelConfig config() const { return fConfig; } 26 GrPixelConfig config() const { return fConfig; }
27 virtual GrSLType type() const = 0; 27 virtual GrSLType type() const = 0;
28 28
29 // Returns the string to be used for the sampler in glsl 2D texture function s (texture, 29 // Returns the string to be used for the sampler in glsl 2D texture function s (texture,
30 // texture2D, etc.) 30 // texture2D, etc.)
31 const char* getSamplerNameForTexture2D() const { 31 const char* getSamplerNameForTexture2D() const {
32 SkASSERT(GrSLTypeIs2DTextureType(this->type())); 32 SkASSERT(GrSLTypeIs2DCombinedSamplerType(this->type()));
33 return this->onGetSamplerNameForTexture2D(); 33 return this->onGetSamplerNameForTexture2D();
34 } 34 }
35 35
36 // Returns the string to be used for the sampler in glsl texelFetch. 36 // Returns the string to be used for the sampler in glsl texelFetch.
37 virtual const char* getSamplerNameForTexelFetch() const = 0; 37 virtual const char* getSamplerNameForTexelFetch() const = 0;
38 38
39 private: 39 private:
40 virtual const char* onGetSamplerNameForTexture2D() const = 0; 40 virtual const char* onGetSamplerNameForTexture2D() const = 0;
41 uint32_t fVisibility; 41 uint32_t fVisibility;
42 GrPixelConfig fConfig; 42 GrPixelConfig fConfig;
43 }; 43 };
44 44
45 #endif 45 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698