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

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

Issue 2679323005: Update callsites to new SkColorSpace API, delete legacy flag (Closed)
Patch Set: Formatting 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 #include "ui/gfx/color_space.h" 5 #include "ui/gfx/color_space.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return nullptr; 227 return nullptr;
228 } 228 }
229 if (range_ != RangeID::FULL) { 229 if (range_ != RangeID::FULL) {
230 DLOG(ERROR) << "Not creating non-full-range SkColorSpace"; 230 DLOG(ERROR) << "Not creating non-full-range SkColorSpace";
231 return nullptr; 231 return nullptr;
232 } 232 }
233 233
234 // Use the named SRGB and linear-SRGB instead of the generic constructors. 234 // Use the named SRGB and linear-SRGB instead of the generic constructors.
235 if (primaries_ == PrimaryID::BT709) { 235 if (primaries_ == PrimaryID::BT709) {
236 if (transfer_ == TransferID::IEC61966_2_1) 236 if (transfer_ == TransferID::IEC61966_2_1)
237 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); 237 return SkColorSpace::MakeSRGB();
238 if (transfer_ == TransferID::LINEAR || transfer_ == TransferID::LINEAR_HDR) 238 if (transfer_ == TransferID::LINEAR || transfer_ == TransferID::LINEAR_HDR)
239 return SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named); 239 return SkColorSpace::MakeSRGBLinear();
240 } 240 }
241 241
242 SkMatrix44 to_xyz_d50; 242 SkMatrix44 to_xyz_d50;
243 GetPrimaryMatrix(&to_xyz_d50); 243 GetPrimaryMatrix(&to_xyz_d50);
244 244
245 // Use the named sRGB and linear transfer functions. 245 // Use the named sRGB and linear transfer functions.
246 if (transfer_ == TransferID::IEC61966_2_1) { 246 if (transfer_ == TransferID::IEC61966_2_1) {
247 return SkColorSpace::MakeRGB(SkColorSpace::kLinear_RenderTargetGamma, 247 return SkColorSpace::MakeRGB(SkColorSpace::kLinear_RenderTargetGamma,
248 to_xyz_d50); 248 to_xyz_d50);
249 } 249 }
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 case MatrixID::BT2020_CL: 607 case MatrixID::BT2020_CL:
608 case MatrixID::YDZDX: 608 case MatrixID::YDZDX:
609 case MatrixID::UNKNOWN: 609 case MatrixID::UNKNOWN:
610 matrix->setScale(255.0f/219.0f, 255.0f/224.0f, 255.0f/224.0f); 610 matrix->setScale(255.0f/219.0f, 255.0f/224.0f, 255.0f/224.0f);
611 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f); 611 matrix->postTranslate(-16.0f/219.0f, -15.5f/224.0f, -15.5f/224.0f);
612 break; 612 break;
613 } 613 }
614 } 614 }
615 615
616 } // namespace gfx 616 } // namespace gfx
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp ('k') | ui/gfx/icc_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698