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

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

Issue 1866293003: Decouple contrast boost from fake gamma. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Improve ignorePreBlend API, add storage type to enum Created 4 years, 8 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/SkDraw.cpp ('k') | src/core/SkPaint.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 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 found in the LICENSE file. 4 * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef SkGlyphCache_DEFINED 7 #ifndef SkGlyphCache_DEFINED
8 #define SkGlyphCache_DEFINED 8 #define SkGlyphCache_DEFINED
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 SkGlyphCache* getCache() const { return this->get(); } 278 SkGlyphCache* getCache() const { return this->get(); }
279 279
280 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {} 280 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {}
281 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc) 281 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc)
282 : INHERITED(SkGlyphCache::DetachCache(typeface, desc)) 282 : INHERITED(SkGlyphCache::DetachCache(typeface, desc))
283 {} 283 {}
284 /** deprecated: always enables fake gamma */ 284 /** deprecated: always enables fake gamma */
285 SkAutoGlyphCache(const SkPaint& paint, 285 SkAutoGlyphCache(const SkPaint& paint,
286 const SkSurfaceProps* surfaceProps, 286 const SkSurfaceProps* surfaceProps,
287 const SkMatrix* matrix) 287 const SkMatrix* matrix)
288 : INHERITED(paint.detachCache(surfaceProps, SkPaint::FakeGamma::On, matr ix)) 288 : INHERITED(paint.detachCache(surfaceProps,
289 SkPaint::kFakeGammaAndBoostContrast_Scaler ContextFlags,
290 matrix))
289 {} 291 {}
290 SkAutoGlyphCache(const SkPaint& paint, 292 SkAutoGlyphCache(const SkPaint& paint,
291 const SkSurfaceProps* surfaceProps, 293 const SkSurfaceProps* surfaceProps,
292 SkPaint::FakeGamma fakeGamma, 294 uint32_t scalerContextFlags,
293 const SkMatrix* matrix) 295 const SkMatrix* matrix)
294 : INHERITED(paint.detachCache(surfaceProps, fakeGamma, matrix)) 296 : INHERITED(paint.detachCache(surfaceProps, scalerContextFlags, matrix))
295 {} 297 {}
296 private: 298 private:
297 using INHERITED = std::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFun ctor>; 299 using INHERITED = std::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFun ctor>;
298 }; 300 };
299 301
300 class SkAutoGlyphCacheNoGamma : public SkAutoGlyphCache { 302 class SkAutoGlyphCacheNoGamma : public SkAutoGlyphCache {
301 public: 303 public:
302 SkAutoGlyphCacheNoGamma(const SkPaint& paint, 304 SkAutoGlyphCacheNoGamma(const SkPaint& paint,
303 const SkSurfaceProps* surfaceProps, 305 const SkSurfaceProps* surfaceProps,
304 const SkMatrix* matrix) 306 const SkMatrix* matrix)
305 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::FakeGamma::Off, matrix) 307 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::kNone_ScalerContextFlag s, matrix)
306 {} 308 {}
307 }; 309 };
308 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache) 310 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache)
309 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a) 311 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a)
310 312
311 #endif 313 #endif
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698