[Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
Created attachment 336115 [details] Patch
Comment on attachment 336115 [details] Patch Clearing flags on attachment: 336115 Committed r229796: <https://trac.webkit.org/changeset/229796>
All reviewed patches have been landed. Closing bug.
<rdar://problem/38697417>
Comment on attachment 336115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336115&action=review > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:155 > + cairo_paint_with_alpha(cr, std::max<float>(0, std::min<float>(1.0, alpha))); Another way to write this with MathExtras.h is clampTo<float>(alpha, 0, 1).
Comment on attachment 336115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336115&action=review >> Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:155 >> + cairo_paint_with_alpha(cr, std::max<float>(0, std::min<float>(1.0, alpha))); > > Another way to write this with MathExtras.h is clampTo<float>(alpha, 0, 1). But I just realized that MathExtras does not have enough overloads for float, so maybe itβs better to write it the way you did, or write std::max(0.0f, std::min(1.0f, alpha)).