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

Unified Diff: src/gpu/glsl/GrGLSLShaderBuilder.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/glsl/GrGLSLSampler.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLShaderBuilder.h
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index ef7963f83a5f9eb766d3eb3daf37487b38b51f02..ea36a56a7ad55e624288987e43efc5703e6d0358 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -9,14 +9,12 @@
#define GrGLSLShaderBuilder_DEFINED
#include "GrAllocator.h"
+#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLShaderVar.h"
#include "SkTDArray.h"
#include <stdarg.h>
-class GrGLSLProgramBuilder;
-class GrGLSLSampler;
-
/**
base class for all shaders builders
*/
@@ -25,17 +23,19 @@ public:
GrGLSLShaderBuilder(GrGLSLProgramBuilder* program);
virtual ~GrGLSLShaderBuilder() {}
+ typedef GrGLSLUniformHandler::SamplerHandle SamplerHandle;
+
/** Appends a 2D texture sample with projection if necessary. coordType must either be Vec2f or
Vec3f. The latter is interpreted as projective texture coords. The vec length and swizzle
order of the result depends on the GrTextureAccess associated with the GrGLSLSampler.
*/
void appendTextureLookup(SkString* out,
- const GrGLSLSampler&,
+ SamplerHandle,
const char* coordName,
GrSLType coordType = kVec2f_GrSLType) const;
/** Version of above that appends the result to the shader code instead.*/
- void appendTextureLookup(const GrGLSLSampler&,
+ void appendTextureLookup(SamplerHandle,
const char* coordName,
GrSLType coordType = kVec2f_GrSLType);
@@ -45,17 +45,17 @@ public:
vec4 or float. If modulation is "" or nullptr it this function acts as though
appendTextureLookup were called. */
void appendTextureLookupAndModulate(const char* modulation,
- const GrGLSLSampler&,
+ SamplerHandle,
const char* coordName,
GrSLType coordType = kVec2f_GrSLType);
/** Fetches an unfiltered texel from a sampler at integer coordinates. coordExpr must match the
dimensionality of the sampler and must be within the sampler's range. coordExpr is emitted
exactly once, so expressions like "idx++" are acceptable. */
- void appendTexelFetch(SkString* out, const GrGLSLSampler&, const char* coordExpr) const;
+ void appendTexelFetch(SkString* out, SamplerHandle, const char* coordExpr) const;
/** Version of above that appends the result to the shader code instead.*/
- void appendTexelFetch(const GrGLSLSampler&, const char* coordExpr);
+ void appendTexelFetch(SamplerHandle, const char* coordExpr);
/**
* Adds a #define directive to the top of the shader.
« no previous file with comments | « src/gpu/glsl/GrGLSLSampler.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698