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

Side by Side Diff: ui/gfx/color_space.h

Issue 2364633003: color: Set GpuMemoryBuffer color spaces for Canvas (Closed)
Patch Set: Fix constexpr 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_COLOR_SPACE_H_ 5 #ifndef UI_GFX_COLOR_SPACE_H_
6 #define UI_GFX_COLOR_SPACE_H_ 6 #define UI_GFX_COLOR_SPACE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 static ColorSpace CreateJpeg(); 154 static ColorSpace CreateJpeg();
155 static ColorSpace CreateREC601(); 155 static ColorSpace CreateREC601();
156 static ColorSpace CreateREC709(); 156 static ColorSpace CreateREC709();
157 157
158 bool operator==(const ColorSpace& other) const; 158 bool operator==(const ColorSpace& other) const;
159 bool operator!=(const ColorSpace& other) const; 159 bool operator!=(const ColorSpace& other) const;
160 bool operator<(const ColorSpace& other) const; 160 bool operator<(const ColorSpace& other) const;
161 161
162 // Note that this may return nullptr. 162 // Note that this may return nullptr.
163 sk_sp<SkColorSpace> ToSkColorSpace() const; 163 sk_sp<SkColorSpace> ToSkColorSpace() const;
164 static ColorSpace FromSkColorSpace(const sk_sp<SkColorSpace>& sk_color_space);
164 165
165 private: 166 private:
166 PrimaryID primaries_ = PrimaryID::UNSPECIFIED; 167 PrimaryID primaries_ = PrimaryID::UNSPECIFIED;
167 TransferID transfer_ = TransferID::UNSPECIFIED; 168 TransferID transfer_ = TransferID::UNSPECIFIED;
168 MatrixID matrix_ = MatrixID::UNSPECIFIED; 169 MatrixID matrix_ = MatrixID::UNSPECIFIED;
169 RangeID range_ = RangeID::LIMITED; 170 RangeID range_ = RangeID::LIMITED;
170 171
171 // Only used if primaries_ == PrimaryID::CUSTOM 172 // Only used if primaries_ == PrimaryID::CUSTOM
172 float custom_primary_matrix_[12]; 173 float custom_primary_matrix_[12];
173 174
174 // This is used to look up the ICCProfile from which this ColorSpace was 175 // This is used to look up the ICCProfile from which this ColorSpace was
175 // created, if possible. 176 // created, if possible.
176 uint64_t icc_profile_id_ = 0; 177 uint64_t icc_profile_id_ = 0;
177 178
178 friend class ICCProfile; 179 friend class ICCProfile;
179 friend class ColorSpaceToColorSpaceTransform; 180 friend class ColorSpaceToColorSpaceTransform;
180 friend struct IPC::ParamTraits<gfx::ColorSpace>; 181 friend struct IPC::ParamTraits<gfx::ColorSpace>;
181 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); 182 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace);
182 }; 183 };
183 184
184 } // namespace gfx 185 } // namespace gfx
185 186
186 #endif // UI_GFX_COLOR_SPACE_H_ 187 #endif // UI_GFX_COLOR_SPACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698