Summary: | [Cairo] Draw Cairo patterns with cairo_paint_with_alpha() | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Zan Dobersek <zan> | ||||
Component: | New Bugs | Assignee: | Zan Dobersek <zan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | cgarcia, darin, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Zan Dobersek
2018-03-20 05:26:22 PDT
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. 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)). |