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

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

Issue 2192903002: Add writeToMemory() API to SkColorSpace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added unit test Created 4 years, 4 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 | « no previous file | 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 bool gammaCloseToSRGB() const { 76 bool gammaCloseToSRGB() const {
77 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam maNamed; 77 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam maNamed;
78 } 78 }
79 79
80 /** 80 /**
81 * Returns nullptr on failure. Fails when we fallback to serializing ICC d ata and 81 * Returns nullptr on failure. Fails when we fallback to serializing ICC d ata and
82 * the data is too large to serialize. 82 * the data is too large to serialize.
83 */ 83 */
84 sk_sp<SkData> serialize() const; 84 sk_sp<SkData> serialize() const;
85 85
86 /**
87 * If |memory| is nullptr, returns the size required to serialize.
88 * Otherwise, serializes into |memory| and returns the size.
89 */
90 size_t writeToMemory(void* memory) const;
91
86 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); 92 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length);
87 93
88 protected: 94 protected:
89 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ; 95 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ;
90 96
91 const GammaNamed fGammaNamed; 97 const GammaNamed fGammaNamed;
92 const SkMatrix44 fToXYZD50; 98 const SkMatrix44 fToXYZD50;
93 const Named fNamed; 99 const Named fNamed;
94 }; 100 };
95 101
96 #endif 102 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698