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

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

Issue 2691213007: color: Don't use QCMS for transforms unless necessary (Closed)
Patch Set: Fix cache hit computation of parse result 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 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 bool operator==(const ColorSpace& other) const; 171 bool operator==(const ColorSpace& other) const;
172 bool operator!=(const ColorSpace& other) const; 172 bool operator!=(const ColorSpace& other) const;
173 bool operator<(const ColorSpace& other) const; 173 bool operator<(const ColorSpace& other) const;
174 174
175 bool IsHDR() const; 175 bool IsHDR() const;
176 176
177 // This will return nullptr for non-RGB spaces, spaces with non-FULL 177 // This will return nullptr for non-RGB spaces, spaces with non-FULL
178 // range, and unspecified spaces. 178 // range, and unspecified spaces.
179 sk_sp<SkColorSpace> ToSkColorSpace() const; 179 sk_sp<SkColorSpace> ToSkColorSpace() const;
180 180
181 // Populate |icc_profile| with an ICC profile that represents this color
182 // space. Returns false if this space is not representable. This ICC profile
183 // will be constructed ignoring the range adjust and transfer matrices.
hubbe 2017/02/16 01:28:29 Ouch, if we can't represent those, shouldn't we ju
ccameron 2017/02/16 01:58:47 This is written with the IOSurface API in mind --
hubbe 2017/02/16 08:33:02 Can we add that to comment in the code, it doesn't
ccameron 2017/02/16 22:33:10 Good point -- done.
184 bool GetICCProfile(ICCProfile* icc_profile) const;
185
181 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; 186 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const;
182 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; 187 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const;
183 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; 188 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const;
184 189
185 // For most formats, this is the RGB to YUV matrix. 190 // For most formats, this is the RGB to YUV matrix.
186 void GetTransferMatrix(SkMatrix44* matrix) const; 191 void GetTransferMatrix(SkMatrix44* matrix) const;
187 void GetRangeAdjustMatrix(SkMatrix44* matrix) const; 192 void GetRangeAdjustMatrix(SkMatrix44* matrix) const;
188 193
189 private: 194 private:
190 PrimaryID primaries_ = PrimaryID::UNSPECIFIED; 195 PrimaryID primaries_ = PrimaryID::UNSPECIFIED;
(...skipping 18 matching lines...) Expand all
209 friend class ColorTransform; 214 friend class ColorTransform;
210 friend class ColorTransformInternal; 215 friend class ColorTransformInternal;
211 friend class ColorSpaceWin; 216 friend class ColorSpaceWin;
212 friend struct IPC::ParamTraits<gfx::ColorSpace>; 217 friend struct IPC::ParamTraits<gfx::ColorSpace>;
213 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); 218 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace);
214 }; 219 };
215 220
216 } // namespace gfx 221 } // namespace gfx
217 222
218 #endif // UI_GFX_COLOR_SPACE_H_ 223 #endif // UI_GFX_COLOR_SPACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698