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

Unified Diff: src/gpu/glsl/GrGLSLSampler.h

Issue 1896013003: Revert of Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLSampler.h
diff --git a/src/gpu/glsl/GrGLSLSampler.h b/src/gpu/glsl/GrGLSLSampler.h
index b8bfa8031054fff834af7911ae37a038cfb2efd8..0fc67a9c937cd605ae45659f22b031e118ca76b0 100644
--- a/src/gpu/glsl/GrGLSLSampler.h
+++ b/src/gpu/glsl/GrGLSLSampler.h
@@ -9,37 +9,27 @@
#define GrGLSLSampler_DEFINED
#include "GrTypes.h"
-#include "GrTypesPriv.h"
-#include "SkString.h"
+#include "SkTArray.h"
+#include "glsl/GrGLSLProgramDataManager.h"
class GrGLSLSampler {
public:
- virtual ~GrGLSLSampler() {}
+ typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
+ typedef SkTArray<GrGLSLSampler> SamplerArray;
- explicit GrGLSLSampler(uint32_t visibility, GrPixelConfig config)
- : fVisibility(visibility)
+ GrGLSLSampler(UniformHandle uniform, GrPixelConfig config)
+ : fSamplerUniform(uniform)
, fConfig(config) {
SkASSERT(kUnknown_GrPixelConfig != fConfig);
}
- uint32_t visibility() const { return fVisibility; }
GrPixelConfig config() const { return fConfig; }
- virtual GrSLType type() const = 0;
-
- // Returns the string to be used for the sampler in glsl 2D texture functions (texture,
- // texture2D, etc.)
- const char* getSamplerNameForTexture2D() const {
- SkASSERT(GrSLTypeIs2DTextureType(this->type()));
- return this->onGetSamplerNameForTexture2D();
- }
-
- // Returns the string to be used for the sampler in glsl texelFetch.
- virtual const char* getSamplerNameForTexelFetch() const = 0;
private:
- virtual const char* onGetSamplerNameForTexture2D() const = 0;
- uint32_t fVisibility;
+ UniformHandle fSamplerUniform;
GrPixelConfig fConfig;
+
+ friend class GrGLSLShaderBuilder;
};
#endif
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698