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

Unified Diff: cc/output/program_binding.cc

Issue 2697253002: color: Add support for shader generation (Closed)
Patch Set: More bits of precision Created 3 years, 10 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/program_binding.h ('k') | cc/output/shader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/program_binding.cc
diff --git a/cc/output/program_binding.cc b/cc/output/program_binding.cc
index dc8fe8464e4d36ee40afe70fb58ca6cc898c43a9..a8f4b6a9f6c29df4964dca45e7f07516020cff13 100644
--- a/cc/output/program_binding.cc
+++ b/cc/output/program_binding.cc
@@ -8,6 +8,7 @@
#include "cc/output/geometry_binding.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "ui/gfx/color_transform.h"
using gpu::gles2::GLES2Interface;
@@ -29,7 +30,8 @@ bool ProgramKey::operator==(const ProgramKey& other) const {
has_color_matrix_ == other.has_color_matrix_ &&
yuv_alpha_texture_mode_ == other.yuv_alpha_texture_mode_ &&
uv_texture_mode_ == other.uv_texture_mode_ &&
- color_conversion_mode_ == other.color_conversion_mode_;
+ color_conversion_mode_ == other.color_conversion_mode_ &&
+ color_transform_ == other.color_transform_;
}
bool ProgramKey::operator!=(const ProgramKey& other) const {
@@ -128,6 +130,18 @@ ProgramKey ProgramKey::YUVVideo(TexCoordPrecision precision,
return result;
}
+void ProgramKey::SetColorTransform(const gfx::ColorTransform* transform) {
+ color_transform_ = nullptr;
+ if (transform->IsIdentity()) {
+ color_conversion_mode_ = COLOR_CONVERSION_MODE_NONE;
+ } else if (transform->CanGetShaderSource()) {
+ color_conversion_mode_ = COLOR_CONVERSION_MODE_SHADER;
+ color_transform_ = transform;
+ } else {
+ color_conversion_mode_ = COLOR_CONVERSION_MODE_LUT;
+ }
+}
+
ProgramBindingBase::ProgramBindingBase()
: program_(0),
vertex_shader_id_(0),
« no previous file with comments | « cc/output/program_binding.h ('k') | cc/output/shader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698