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

Side by Side Diff: src/core/SkColorSpace.h

Issue 1766413002: Use a smart pointer for SkColorSpace factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix spacing Created 4 years, 9 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
« no previous file with comments | « src/codec/SkWebpCodec.h ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorSpace_DEFINED 8 #ifndef SkColorSpace_DEFINED
9 #define SkColorSpace_DEFINED 9 #define SkColorSpace_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 enum Named { 43 enum Named {
44 kUnknown_Named, 44 kUnknown_Named,
45 kDevice_Named, 45 kDevice_Named,
46 kSRGB_Named, 46 kSRGB_Named,
47 }; 47 };
48 48
49 /** 49 /**
50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D 50_XYZ 50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D 50_XYZ
51 * and the src-gamma, return a ColorSpace 51 * and the src-gamma, return a ColorSpace
52 */ 52 */
53 static SkColorSpace* NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3& gamm a); 53 static sk_sp<SkColorSpace> NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3 & gamma);
54 54
55 static SkColorSpace* NewNamed(Named); 55 static sk_sp<SkColorSpace> NewNamed(Named);
56 static SkColorSpace* NewICC(const void*, size_t); 56 static sk_sp<SkColorSpace> NewICC(const void*, size_t);
57 57
58 SkFloat3 gamma() const { return fGamma; } 58 SkFloat3 gamma() const { return fGamma; }
59 SkFloat3x3 xyz() const { return fToXYZD50; } 59 SkFloat3x3 xyz() const { return fToXYZD50; }
60 Named named() const { return fNamed; } 60 Named named() const { return fNamed; }
61 uint32_t uniqueID() const { return fUniqueID; } 61 uint32_t uniqueID() const { return fUniqueID; }
62 62
63 enum Result { 63 enum Result {
64 kFailure_Result, 64 kFailure_Result,
65 kIdentity_Result, 65 kIdentity_Result,
66 kNormal_Result, 66 kNormal_Result,
(...skipping 12 matching lines...) Expand all
79 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); 79 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named);
80 80
81 private: 81 private:
82 const SkFloat3x3 fToXYZD50; 82 const SkFloat3x3 fToXYZD50;
83 const SkFloat3 fGamma; 83 const SkFloat3 fGamma;
84 const uint32_t fUniqueID; 84 const uint32_t fUniqueID;
85 const Named fNamed; 85 const Named fNamed;
86 }; 86 };
87 87
88 #endif 88 #endif
OLDNEW
« no previous file with comments | « src/codec/SkWebpCodec.h ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698