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

Unified Diff: cc/shader.h

Issue 12086036: cc: Clamp texture coordinates in all tile shaders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snowscale
Patch Set: Complete. Use _SAT+MAD clamping again. Created 7 years, 11 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 | « cc/gl_renderer.cc ('k') | cc/shader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/shader.h
diff --git a/cc/shader.h b/cc/shader.h
index 0d929f90f19af9a1fa20f191abee6468a66f8880..2555313d7825f355cecf207696888d82de62588a 100644
--- a/cc/shader.h
+++ b/cc/shader.h
@@ -142,6 +142,22 @@ private:
int m_alphaLocation;
};
+class FragmentTexClampAlphaBinding {
+public:
+ FragmentTexClampAlphaBinding();
+
+ void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUniform, int* baseUniformIndex);
+ int alphaLocation() const { return m_alphaLocation; }
+ int edgeLocation() const { return -1; }
+ int fragmentTexTransformLocation() const { return m_fragmentTexTransformLocation; }
+ int samplerLocation() const { return m_samplerLocation; }
+
+private:
+ int m_samplerLocation;
+ int m_alphaLocation;
+ int m_fragmentTexTransformLocation;
+};
+
class FragmentTexOpaqueBinding {
public:
FragmentTexOpaqueBinding();
@@ -156,6 +172,21 @@ private:
int m_samplerLocation;
};
+class FragmentTexClampOpaqueBinding {
+public:
+ FragmentTexClampOpaqueBinding();
+
+ void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUniform, int* baseUniformIndex);
+ int alphaLocation() const { return -1; }
+ int edgeLocation() const { return -1; }
+ int fragmentTexTransformLocation() const { return m_fragmentTexTransformLocation; }
+ int samplerLocation() const { return m_samplerLocation; }
+
+private:
+ int m_samplerLocation;
+ int m_fragmentTexTransformLocation;
+};
+
class FragmentShaderRGBATexFlipVaryingAlpha : public FragmentTexOpaqueBinding {
public:
std::string getShaderString() const;
@@ -171,6 +202,11 @@ public:
std::string getShaderString() const;
};
+class FragmentShaderRGBATexClampAlpha : public FragmentTexClampAlphaBinding {
+public:
+ std::string getShaderString() const;
+};
+
class FragmentShaderRGBATexRectFlipVaryingAlpha : public FragmentTexAlphaBinding {
public:
std::string getShaderString() const;
@@ -181,7 +217,7 @@ public:
std::string getShaderString() const;
};
-class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding {
+class FragmentShaderRGBATexClampOpaque : public FragmentTexClampOpaqueBinding {
public:
std::string getShaderString() const;
};
@@ -192,13 +228,13 @@ public:
};
// Swizzles the red and blue component of sampled texel with alpha.
-class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding {
+class FragmentShaderRGBATexClampSwizzleAlpha : public FragmentTexClampAlphaBinding {
public:
std::string getShaderString() const;
};
// Swizzles the red and blue component of sampled texel without alpha.
-class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding {
+class FragmentShaderRGBATexClampSwizzleOpaque : public FragmentTexClampOpaqueBinding {
public:
std::string getShaderString() const;
};
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/shader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698