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

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

Issue 1217573002: remove SkInstCnt (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 5 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/core/SkInstCnt.cpp ('k') | src/core/SkPictureFlat.h » ('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 2012 Google Inc. 2 * Copyright 2012 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 SkMaskGamma_DEFINED 8 #ifndef SkMaskGamma_DEFINED
9 #define SkMaskGamma_DEFINED 9 #define SkMaskGamma_DEFINED
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 * contains non-linear alpha values in an attempt to create gamma correct blits 85 * contains non-linear alpha values in an attempt to create gamma correct blits
86 * in the presence of a gamma incorrect (linear) blend in the blitter. 86 * in the presence of a gamma incorrect (linear) blend in the blitter.
87 * 87 *
88 * SkMaskGamma creates and maintains tables which convert linear alpha values 88 * SkMaskGamma creates and maintains tables which convert linear alpha values
89 * to gamma correcting alpha values. 89 * to gamma correcting alpha values.
90 * @param R The number of luminance bits to use [1, 8] from the red channel. 90 * @param R The number of luminance bits to use [1, 8] from the red channel.
91 * @param G The number of luminance bits to use [1, 8] from the green channel. 91 * @param G The number of luminance bits to use [1, 8] from the green channel.
92 * @param B The number of luminance bits to use [1, 8] from the blue channel. 92 * @param B The number of luminance bits to use [1, 8] from the blue channel.
93 */ 93 */
94 template <int R_LUM_BITS, int G_LUM_BITS, int B_LUM_BITS> class SkTMaskGamma : p ublic SkRefCnt { 94 template <int R_LUM_BITS, int G_LUM_BITS, int B_LUM_BITS> class SkTMaskGamma : p ublic SkRefCnt {
95 SK_DECLARE_INST_COUNT(SkTMaskGamma) 95
96 public: 96 public:
97 97
98 /** Creates a linear SkTMaskGamma. */ 98 /** Creates a linear SkTMaskGamma. */
99 SkTMaskGamma() : fIsLinear(true) { } 99 SkTMaskGamma() : fIsLinear(true) { }
100 100
101 /** 101 /**
102 * Creates tables to convert linear alpha values to gamma correcting alpha 102 * Creates tables to convert linear alpha values to gamma correcting alpha
103 * values. 103 * values.
104 * 104 *
105 * @param contrast A value in the range [0.0, 1.0] which indicates the 105 * @param contrast A value in the range [0.0, 1.0] which indicates the
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 */ 221 */
222 template<bool APPLY_LUT> static inline U8CPU sk_apply_lut_if(U8CPU component, co nst uint8_t*) { 222 template<bool APPLY_LUT> static inline U8CPU sk_apply_lut_if(U8CPU component, co nst uint8_t*) {
223 return component; 223 return component;
224 } 224 }
225 template<> /*static*/ inline U8CPU sk_apply_lut_if<true>(U8CPU component, const uint8_t* lut) { 225 template<> /*static*/ inline U8CPU sk_apply_lut_if<true>(U8CPU component, const uint8_t* lut) {
226 return lut[component]; 226 return lut[component];
227 } 227 }
228 ///@} 228 ///@}
229 229
230 #endif 230 #endif
OLDNEW
« no previous file with comments | « src/core/SkInstCnt.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698