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), |