You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chromium/SOURCES/SkColor4f-init.patch

35 lines
1.7 KiB

../../third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc:94:22: error: no matching constructor for initialization of 'SkColor4f' (aka 'SkRGBA4f<kUnpremul_SkAlphaType>')
flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/skia/include/core/SkColor.h:262:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4 were provided
struct SkRGBA4f {
^
../../third_party/skia/include/core/SkColor.h:262:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4 were provided
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
@@ -84,6 +84,7 @@ CanvasStyle::CanvasStyle(const CanvasSty
void CanvasStyle::ApplyToFlags(cc::PaintFlags& flags,
float global_alpha) const {
+ SkColor4f clr = { 0.0f, 0.0f, 0.0f, global_alpha };
switch (type_) {
case kColor:
ApplyColorToFlags(flags, global_alpha);
@@ -91,12 +92,12 @@ void CanvasStyle::ApplyToFlags(cc::Paint
case kGradient:
GetCanvasGradient()->GetGradient()->ApplyToFlags(flags, SkMatrix::I(),
ImageDrawOptions());
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(clr);
break;
case kImagePattern:
GetCanvasPattern()->GetPattern()->ApplyToFlags(
flags, AffineTransformToSkMatrix(GetCanvasPattern()->GetTransform()));
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(clr);
break;
default:
NOTREACHED();