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

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

Issue 258883002: Gamma correction for distance field text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix SkAutoGlyphCache destructor Created 6 years, 6 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/SkPaint.cpp ('k') | src/gpu/GrDistanceFieldTextContext.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkScalerContext_DEFINED 8 #ifndef SkScalerContext_DEFINED
9 #define SkScalerContext_DEFINED 9 #define SkScalerContext_DEFINED
10 10
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 */ 177 */
178 SkUnichar glyphIDToChar(uint16_t glyphID); 178 SkUnichar glyphIDToChar(uint16_t glyphID);
179 179
180 unsigned getGlyphCount() { return this->generateGlyphCount(); } 180 unsigned getGlyphCount() { return this->generateGlyphCount(); }
181 void getAdvance(SkGlyph*); 181 void getAdvance(SkGlyph*);
182 void getMetrics(SkGlyph*); 182 void getMetrics(SkGlyph*);
183 void getImage(const SkGlyph&); 183 void getImage(const SkGlyph&);
184 void getPath(const SkGlyph&, SkPath*); 184 void getPath(const SkGlyph&, SkPath*);
185 void getFontMetrics(SkPaint::FontMetrics*); 185 void getFontMetrics(SkPaint::FontMetrics*);
186 186
187 /** Return the size in bytes of the associated gamma lookup table
188 */
189 static size_t GetGammaLUTSize(SkScalar contrast, SkScalar paintGamma, SkScal ar deviceGamma,
190 int* width, int* height);
191
192 /** Get the associated gamma lookup table. The 'data' pointer must point to pre-allocated
193 memory, with size in bytes greater than or equal to the return value of getGammaLUTSize().
194 */
195 static void GetGammaLUTData(SkScalar contrast, SkScalar paintGamma, SkScal ar deviceGamma,
196 void* data);
197
187 #ifdef SK_BUILD_FOR_ANDROID 198 #ifdef SK_BUILD_FOR_ANDROID
188 unsigned getBaseGlyphCount(SkUnichar charCode); 199 unsigned getBaseGlyphCount(SkUnichar charCode);
189 200
190 // This function must be public for SkTypeface_android.h, but should not be 201 // This function must be public for SkTypeface_android.h, but should not be
191 // called by other callers 202 // called by other callers
192 SkFontID findTypefaceIdForChar(SkUnichar uni); 203 SkFontID findTypefaceIdForChar(SkUnichar uni);
193 #endif 204 #endif
194 205
195 static void MakeRec(const SkPaint&, const SkDeviceProperties* deviceProperti es, 206 static void MakeRec(const SkPaint&, const SkDeviceProperties* deviceProperti es,
196 const SkMatrix*, Rec* rec); 207 const SkMatrix*, Rec* rec);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 return static_cast<SkPaint::Hinting>(hint); 348 return static_cast<SkPaint::Hinting>(hint);
338 } 349 }
339 350
340 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { 351 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) {
341 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | 352 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) |
342 (hinting << SkScalerContext::kHinting_Shift); 353 (hinting << SkScalerContext::kHinting_Shift);
343 } 354 }
344 355
345 356
346 #endif 357 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/gpu/GrDistanceFieldTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698