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

Unified Diff: cc/output/shader.h

Issue 2418173002: Fix HTML5 video blurry (Closed)
Patch Set: fix nits Created 4 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 | « cc/output/renderer_pixeltest.cc ('k') | cc/output/shader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/shader.h
diff --git a/cc/output/shader.h b/cc/output/shader.h
index 21b4a70de5aaac404dc18061f6483967841dddf7..ea61c9192ccfe1c06a3ce268c511d3491f5dd685 100644
--- a/cc/output/shader.h
+++ b/cc/output/shader.h
@@ -424,42 +424,53 @@ class FragmentTexColorMatrixAlphaBinding : public FragmentTexBlendMode {
int color_offset_location_;
};
-class FragmentTexOpaqueBinding : public FragmentTexBlendMode {
+class FragmentTexQuadBase : public FragmentTexBlendMode {
public:
- FragmentTexOpaqueBinding();
+ 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 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_; }
+ int tex_clamp_rect_location() const final;
private:
- int sampler_location_;
+ int tex_clamp_rect_location_ = -1;
- DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding);
+ DISALLOW_COPY_AND_ASSIGN(FragmentTexClampBinding);
};
-class FragmentTexBackgroundBinding : public FragmentTexBlendMode {
+class FragmentTexBackgroundBinding : public FragmentTexQuadBase {
public:
FragmentTexBackgroundBinding();
void Init(gpu::gles2::GLES2Interface* context,
unsigned program,
int* base_uniform_index);
- int background_color_location() const { return background_color_location_; }
- int sampler_location() const { return sampler_location_; }
+ int background_color_location() const final;
private:
int background_color_location_;
- int sampler_location_;
DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding);
};
-class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding {
+class FragmentShaderRGBATexClampVaryingAlpha : public FragmentTexClampBinding {
public:
std::string GetShaderString(
TexCoordPrecision precision, SamplerType sampler) const;
@@ -467,7 +478,16 @@ class FragmentShaderRGBATexVaryingAlpha : public FragmentTexOpaqueBinding {
static std::string GetShaderBody();
};
-class FragmentShaderRGBATexPremultiplyAlpha : public FragmentTexOpaqueBinding {
+class FragmentShaderRGBATexClampPremultiplyAlpha
+ : public FragmentTexClampBinding {
+ 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;
@@ -512,15 +532,24 @@ class FragmentShaderRGBATexColorMatrixAlpha
void FillLocations(ShaderLocations* locations) const;
};
-class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding {
+class FragmentTexOpaqueBinding : public FragmentTexBlendMode {
public:
- std::string GetShaderString(
- TexCoordPrecision precision, SamplerType sampler) const;
- static std::string GetShaderHead();
- static std::string GetShaderBody();
+ 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);
};
-class FragmentShaderRGBATex : public FragmentTexOpaqueBinding {
+class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding {
public:
std::string GetShaderString(
TexCoordPrecision precision, SamplerType sampler) const;
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/output/shader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698