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

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

Issue 2472543002: remove legacy Skia flags (Closed)
Patch Set: address nit Created 4 years, 1 month 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 sk_sp<SkColorSpace> ColorSpace::ToSkColorSpace() const { 142 sk_sp<SkColorSpace> ColorSpace::ToSkColorSpace() const {
143 // Unspecified color spaces are represented as nullptr SkColorSpaces. 143 // Unspecified color spaces are represented as nullptr SkColorSpaces.
144 if (*this == gfx::ColorSpace()) 144 if (*this == gfx::ColorSpace())
145 return nullptr; 145 return nullptr;
146 146
147 // TODO(crbug.com/634102): Support more than just ICC profile based color 147 // TODO(crbug.com/634102): Support more than just ICC profile based color
148 // spaces. The DCHECK here is to ensure that callers that expect a valid 148 // spaces. The DCHECK here is to ensure that callers that expect a valid
149 // result are notified of this incomplete functionality. 149 // result are notified of this incomplete functionality.
150 std::vector<char> icc_data = gfx::ICCProfile::FromColorSpace(*this).GetData(); 150 std::vector<char> icc_data = gfx::ICCProfile::FromColorSpace(*this).GetData();
151 sk_sp<SkColorSpace> result = 151 sk_sp<SkColorSpace> result =
152 SkColorSpace::NewICC(icc_data.data(), icc_data.size()); 152 SkColorSpace::MakeICC(icc_data.data(), icc_data.size());
153 DCHECK(result); 153 DCHECK(result);
154 return result; 154 return result;
155 } 155 }
156 156
157 ColorSpace ColorSpace::FromSkColorSpace( 157 ColorSpace ColorSpace::FromSkColorSpace(
158 const sk_sp<SkColorSpace>& sk_color_space) { 158 const sk_sp<SkColorSpace>& sk_color_space) {
159 if (!sk_color_space) 159 if (!sk_color_space)
160 return gfx::ColorSpace(); 160 return gfx::ColorSpace();
161 161
162 // TODO(crbug.com/634102): Add conversion to gfx::ColorSpace. 162 // TODO(crbug.com/634102): Add conversion to gfx::ColorSpace.
163 return gfx::ColorSpace(); 163 return gfx::ColorSpace();
164 } 164 }
165 165
166 } // namespace gfx 166 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698