Commit 693732b2 authored by ccameron's avatar ccameron Committed by Commit bot

color: Initialize all members of gfx::ColorSpace

TBR=hubbe
BUG=646708

Review-Url: https://codereview.chromium.org/2337423002
Cr-Commit-Position: refs/heads/master@{#418503}
parent 1fdcca3d
......@@ -12,11 +12,9 @@
namespace gfx {
ColorSpace::ColorSpace()
: primaries_(PrimaryID::UNSPECIFIED),
transfer_(TransferID::UNSPECIFIED),
matrix_(MatrixID::UNSPECIFIED),
range_(RangeID::LIMITED) {}
ColorSpace::ColorSpace() {
memset(custom_primary_matrix_, 0, sizeof(custom_primary_matrix_));
}
ColorSpace::ColorSpace(PrimaryID primaries,
TransferID transfer,
......@@ -26,6 +24,7 @@ ColorSpace::ColorSpace(PrimaryID primaries,
transfer_(transfer),
matrix_(matrix),
range_(range) {
memset(custom_primary_matrix_, 0, sizeof(custom_primary_matrix_));
// TODO: Set profile_id_
}
......
......@@ -133,10 +133,10 @@ class GFX_EXPORT ColorSpace {
bool operator<(const ColorSpace& other) const;
private:
PrimaryID primaries_;
TransferID transfer_;
MatrixID matrix_;
RangeID range_;
PrimaryID primaries_ = PrimaryID::UNSPECIFIED;
TransferID transfer_ = TransferID::UNSPECIFIED;
MatrixID matrix_ = MatrixID::UNSPECIFIED;
RangeID range_ = RangeID::LIMITED;
// Only used if primaries_ == PrimaryID::CUSTOM
float custom_primary_matrix_[12];
......
......@@ -105,6 +105,9 @@ const std::vector<char>& ICCProfile::GetData() const {
}
ColorSpace ICCProfile::GetColorSpace() const {
if (!valid_)
return gfx::ColorSpace();
ColorSpace color_space(ColorSpace::PrimaryID::CUSTOM,
ColorSpace::TransferID::CUSTOM,
ColorSpace::MatrixID::RGB, ColorSpace::RangeID::FULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment