Index: cc/output/shader.h |
diff --git a/cc/output/shader.h b/cc/output/shader.h |
index ea61c9192ccfe1c06a3ce268c511d3491f5dd685..21b4a70de5aaac404dc18061f6483967841dddf7 100644 |
--- a/cc/output/shader.h |
+++ b/cc/output/shader.h |
@@ -424,132 +424,103 @@ |
int color_offset_location_; |
}; |
-class FragmentTexQuadBase : public FragmentTexBlendMode { |
- public: |
- FragmentTexQuadBase() = default; |
- virtual ~FragmentTexQuadBase() = default; |
- |
- int sampler_location() const { return sampler_location_; } |
- virtual int background_color_location() const; |
- virtual int tex_clamp_rect_location() const; |
- |
- protected: |
- int sampler_location_ = -1; |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(FragmentTexQuadBase); |
-}; |
- |
-class FragmentTexClampBinding : public FragmentTexQuadBase { |
- public: |
- FragmentTexClampBinding() = default; |
- |
- void Init(gpu::gles2::GLES2Interface* context, |
- unsigned program, |
- int* base_uniform_index); |
- int tex_clamp_rect_location() const final; |
- |
- private: |
- int tex_clamp_rect_location_ = -1; |
- |
- DISALLOW_COPY_AND_ASSIGN(FragmentTexClampBinding); |
-}; |
- |
-class FragmentTexBackgroundBinding : public FragmentTexQuadBase { |
+class FragmentTexOpaqueBinding : public FragmentTexBlendMode { |
+ public: |
+ FragmentTexOpaqueBinding(); |
+ |
+ void Init(gpu::gles2::GLES2Interface* context, |
+ unsigned program, |
+ int* base_uniform_index); |
+ int alpha_location() const { return -1; } |
+ int fragment_tex_transform_location() const { return -1; } |
+ int background_color_location() const { return -1; } |
+ int sampler_location() const { return sampler_location_; } |
+ |
+ private: |
+ int sampler_location_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
+}; |
+ |
+class FragmentTexBackgroundBinding : public FragmentTexBlendMode { |
public: |
FragmentTexBackgroundBinding(); |
void Init(gpu::gles2::GLES2Interface* context, |
unsigned program, |
int* base_uniform_index); |
- int background_color_location() const final; |
+ int background_color_location() const { return background_color_location_; } |
+ int sampler_location() const { return sampler_location_; } |
private: |
int background_color_location_; |
+ int sampler_location_; |
DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding); |
}; |
-class FragmentShaderRGBATexClampVaryingAlpha : public FragmentTexClampBinding { |
- public: |
- std::string GetShaderString( |
- TexCoordPrecision precision, SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
-}; |
- |
-class FragmentShaderRGBATexClampPremultiplyAlpha |
- : public FragmentTexClampBinding { |
+class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+}; |
+ |
+class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+}; |
+ |
+class FragmentShaderTexBackgroundVaryingAlpha |
+ : public FragmentTexBackgroundBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+}; |
+ |
+class FragmentShaderTexBackgroundPremultiplyAlpha |
+ : public FragmentTexBackgroundBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+}; |
+ |
+class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+ void FillLocations(ShaderLocations* locations) const; |
+}; |
+ |
+class FragmentShaderRGBATexColorMatrixAlpha |
+ : public FragmentTexColorMatrixAlphaBinding { |
public: |
std::string GetShaderString(TexCoordPrecision precision, |
SamplerType sampler) const; |
static std::string GetShaderHead(); |
static std::string GetShaderBody(); |
-}; |
- |
-class FragmentShaderRGBATexClamp : public FragmentTexClampBinding { |
- public: |
- std::string GetShaderString( |
- TexCoordPrecision precision, SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
-}; |
- |
-class FragmentShaderTexBackgroundVaryingAlpha |
- : public FragmentTexBackgroundBinding { |
- public: |
- std::string GetShaderString( |
- TexCoordPrecision precision, SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
-}; |
- |
-class FragmentShaderTexBackgroundPremultiplyAlpha |
- : public FragmentTexBackgroundBinding { |
- public: |
- std::string GetShaderString( |
- TexCoordPrecision precision, SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
-}; |
- |
-class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { |
- public: |
- std::string GetShaderString( |
- TexCoordPrecision precision, SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
- void FillLocations(ShaderLocations* locations) const; |
-}; |
- |
-class FragmentShaderRGBATexColorMatrixAlpha |
- : public FragmentTexColorMatrixAlphaBinding { |
- public: |
- std::string GetShaderString(TexCoordPrecision precision, |
- SamplerType sampler) const; |
- static std::string GetShaderHead(); |
- static std::string GetShaderBody(); |
- void FillLocations(ShaderLocations* locations) const; |
-}; |
- |
-class FragmentTexOpaqueBinding : public FragmentTexBlendMode { |
- public: |
- FragmentTexOpaqueBinding(); |
- |
- void Init(gpu::gles2::GLES2Interface* context, |
- unsigned program, |
- int* base_uniform_index); |
- int alpha_location() const { return -1; } |
- int fragment_tex_transform_location() const { return -1; } |
- int sampler_location() const { return sampler_location_; } |
- |
- private: |
- int sampler_location_; |
- |
- DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
+ void FillLocations(ShaderLocations* locations) const; |
}; |
class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { |
+ public: |
+ std::string GetShaderString( |
+ TexCoordPrecision precision, SamplerType sampler) const; |
+ static std::string GetShaderHead(); |
+ static std::string GetShaderBody(); |
+}; |
+ |
+class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { |
public: |
std::string GetShaderString( |
TexCoordPrecision precision, SamplerType sampler) const; |