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

Unified Diff: Source/platform/graphics/skia/SkiaUtils.h

Issue 900463002: Make SVG painting independent of GraphicsContext's alpha state (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address reviewer comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/GraphicsContextState.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/skia/SkiaUtils.h
diff --git a/Source/platform/graphics/skia/SkiaUtils.h b/Source/platform/graphics/skia/SkiaUtils.h
index d3c9b8539856ff875b7307b4723c4299fa20a0f8..a54d28fac2abfdce619ed655b6e1372a0714e65e 100644
--- a/Source/platform/graphics/skia/SkiaUtils.h
+++ b/Source/platform/graphics/skia/SkiaUtils.h
@@ -52,6 +52,17 @@ SkXfermode::Mode PLATFORM_EXPORT WebCoreCompositeToSkiaComposite(CompositeOperat
CompositeOperator PLATFORM_EXPORT compositeOperatorFromSkia(SkXfermode::Mode);
WebBlendMode PLATFORM_EXPORT blendModeFromSkia(SkXfermode::Mode);
+// Map alpha values from [0, 1] to [0, 256] for alpha blending.
+int PLATFORM_EXPORT clampedAlphaForBlending(float);
+
+// Multiply a color's alpha channel by an additional alpha factor where
+// alpha is in the range [0, 1].
+SkColor PLATFORM_EXPORT multiplyAlpha(SkColor, float);
+
+// Multiply a color's alpha channel by an additional alpha factor where
+// alpha is in the range [0, 256].
+SkColor PLATFORM_EXPORT multiplyAlpha(SkColor, int);
+
inline SkPaint::FilterLevel WebCoreInterpolationQualityToSkFilterLevel(InterpolationQuality quality)
{
// FIXME: this reflects existing client mappings, but should probably
« no previous file with comments | « Source/platform/graphics/GraphicsContextState.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698