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

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

Issue 1990533002: Fix leak of SkGammas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | no next file » | 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 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkColorSpace.h" 9 #include "SkColorSpace.h"
10 #include "SkColorSpacePriv.h" 10 #include "SkColorSpacePriv.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 gammas = sk_ref_sp(gStandardGammas); 88 gammas = sk_ref_sp(gStandardGammas);
89 89
90 if (xyz_almost_equal(toXYZD50, gSRGB_toXYZD50)) { 90 if (xyz_almost_equal(toXYZD50, gSRGB_toXYZD50)) {
91 return SkColorSpace::NewNamed(kSRGB_Named); 91 return SkColorSpace::NewNamed(kSRGB_Named);
92 } else if (xyz_almost_equal(toXYZD50, gAdobeRGB_toXYZD50)) { 92 } else if (xyz_almost_equal(toXYZD50, gAdobeRGB_toXYZD50)) {
93 return SkColorSpace::NewNamed(kAdobeRGB_Named); 93 return SkColorSpace::NewNamed(kAdobeRGB_Named);
94 } 94 }
95 } 95 }
96 96
97 if (!gammas) { 97 if (!gammas) {
98 gammas = sk_ref_sp(new SkGammas(gammaVals[0], gammaVals[1], gammaVals[2] )); 98 gammas = sk_sp<SkGammas>(new SkGammas(gammaVals[0], gammaVals[1], gammaV als[2]));
99 } 99 }
100 return sk_sp<SkColorSpace>(new SkColorSpace(gammas, toXYZD50, kUnknown_Named )); 100 return sk_sp<SkColorSpace>(new SkColorSpace(gammas, toXYZD50, kUnknown_Named ));
101 } 101 }
102 102
103 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { 103 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) {
104 static SkOnce sRGBOnce; 104 static SkOnce sRGBOnce;
105 static SkColorSpace* sRGB; 105 static SkColorSpace* sRGB;
106 static SkOnce adobeRGBOnce; 106 static SkOnce adobeRGBOnce;
107 static SkColorSpace* adobeRGB; 107 static SkColorSpace* adobeRGB;
108 108
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 } 738 }
739 } 739 }
740 740
741 } 741 }
742 default: 742 default:
743 break; 743 break;
744 } 744 }
745 745
746 return_null("ICC profile contains unsupported colorspace"); 746 return_null("ICC profile contains unsupported colorspace");
747 } 747 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698