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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLSampler.h
diff --git a/src/gpu/gl/GrGLSampler.h b/src/gpu/gl/GrGLSampler.h
new file mode 100644
index 0000000000000000000000000000000000000000..dff2080fa8da9a8e06afb4a2c0f0cbae27e37d9d
--- /dev/null
+++ b/src/gpu/gl/GrGLSampler.h
@@ -0,0 +1,45 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#ifndef GrGLSampler_DEFINED
+#define GrGLSampler_DEFINED
+
+#include "glsl/GrGLSLSampler.h"
+
+#include "gl/GrGLTypes.h"
+#include "glsl/GrGLSLShaderVar.h"
+
+class GrGLSampler : public GrGLSLSampler {
+public:
+ GrGLSampler(uint32_t visibility,
+ GrPixelConfig config,
+ GrSLType type,
+ GrSLPrecision precision,
+ const char* name) : INHERITED(visibility, config) {
+ SkASSERT(GrSLTypeIsSamplerType(type));
+ fShaderVar.setType(type);
+ fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
+ fShaderVar.setPrecision(precision);
+ fShaderVar.accessName()->set(name);
+ }
+
+ GrGLint location() const { return fLocation; }
+ GrSLType type() const override { return fShaderVar.getType(); }
+
+ const char* onGetSamplerNameForTexture2D() const override { return fShaderVar.c_str(); }
+ const char* getSamplerNameForTexelFetch() const override { return fShaderVar.c_str(); }
+
+private:
+ GrGLSLShaderVar fShaderVar;
+ GrGLint fLocation;
+
+ friend class GrGLUniformHandler;
+
+ typedef GrGLSLSampler INHERITED;
+};
+
+#endif
« 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