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

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

Issue 1425013003: Remove GrGLProcessor and create GrGLSLTextureSampler class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove grglprocessor from gyp Created 5 years, 2 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/GrGLSLProgramDataManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLTextureSampler.h
diff --git a/src/gpu/glsl/GrGLSLTextureSampler.h b/src/gpu/glsl/GrGLSLTextureSampler.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f14cd1013ff3fa0ef1b249bfd9bfc80203d81ce
--- /dev/null
+++ b/src/gpu/glsl/GrGLSLTextureSampler.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLSLTextureSampler_DEFINED
+#define GrGLSLTextureSampler_DEFINED
+
+#include "GrShaderVar.h"
+#include "GrTextureAccess.h"
+#include "glsl/GrGLSLProgramDataManager.h"
+
+class GrGLSLTextureSampler {
+public:
+ typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
+ typedef SkTArray<GrGLSLTextureSampler> TextureSamplerArray;
+
+ GrGLSLTextureSampler(UniformHandle uniform, const GrTextureAccess& access)
+ : fSamplerUniform(uniform)
+ , fConfigComponentMask(GrPixelConfigComponentMask(access.getTexture()->config())) {
+ SkASSERT(0 != fConfigComponentMask);
+ memcpy(fSwizzle, access.getSwizzle(), 5);
+ }
+
+ // bitfield of GrColorComponentFlags present in the texture's config.
+ uint32_t configComponentMask() const { return fConfigComponentMask; }
+ // this is .abcd
+ const char* swizzle() const { return fSwizzle; }
+
+private:
+ UniformHandle fSamplerUniform;
+ uint32_t fConfigComponentMask;
+ char fSwizzle[5];
+
+ friend class GrGLShaderBuilder;
+};
+
+#endif
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramDataManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698