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

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

Issue 1885863004: 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
Index: src/gpu/glsl/GrGLSLSampler.h
diff --git a/src/gpu/glsl/GrGLSLSampler.h b/src/gpu/glsl/GrGLSLSampler.h
index 0fc67a9c937cd605ae45659f22b031e118ca76b0..694c03a40f5f14d31613439768faeba325da3ea2 100644
--- a/src/gpu/glsl/GrGLSLSampler.h
+++ b/src/gpu/glsl/GrGLSLSampler.h
@@ -9,27 +9,28 @@
#define GrGLSLSampler_DEFINED
#include "GrTypes.h"
-#include "SkTArray.h"
-#include "glsl/GrGLSLProgramDataManager.h"
+#include "GrTypesPriv.h"
+#include "SkString.h"
class GrGLSLSampler {
public:
- typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
- typedef SkTArray<GrGLSLSampler> SamplerArray;
-
- GrGLSLSampler(UniformHandle uniform, GrPixelConfig config)
- : fSamplerUniform(uniform)
+ explicit GrGLSLSampler(uint32_t visibility, GrPixelConfig config)
+ : fVisibility(visibility)
, 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 sample functions (texture, texture2D,
+ // etc.)
+ virtual const char* getSamplerFunctionName() const = 0;
Chris Dalton 2016/04/13 21:56:40 This function is a bit problematic because there i
egdaniel 2016/04/13 23:44:45 Okay so this function may just have been poorly na
egdaniel 2016/04/13 23:51:43 Also I just noticed I didn't upload the change tha
private:
- UniformHandle fSamplerUniform;
+ uint32_t fVisibility;
GrPixelConfig fConfig;
-
- friend class GrGLSLShaderBuilder;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698