Remove redundant calls to PaintFlags::setAntiAlias

In most of these cases we use GraphicsContext::FillFlags - which
will already have the value returned by GraphicsContext::ShouldAntialias
set.
In the remaining case we copy the flag from the PaintFlags which
we made a copy of already.

Change-Id: I25fe7f578017c215cd8950aa3a74b2664bf29615
Reviewed-on: https://chromium-review.googlesource.com/c/1403456
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621263}
diff --git a/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc b/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc
index 4550162..59c68f6 100644
--- a/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc
+++ b/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc
@@ -63,7 +63,6 @@
   PaintFlags image_flags(flags);
   image_flags.setBlendMode(SkBlendMode::kSrcOver);
   image_flags.setColor(ScaleAlpha(flags.getColor(), 1 - percentage_));
-  image_flags.setAntiAlias(flags.isAntiAlias());
   // TODO(junov): This code should probably be propagating the
   // RespectImageOrientationEnum from CrossfadeGeneratedImage::draw(). Code was
   // written this way during refactoring to avoid modifying existing behavior,
@@ -106,7 +105,6 @@
 
   PaintFlags flags = context.FillFlags();
   flags.setBlendMode(SkBlendMode::kSrcOver);
-  flags.setAntiAlias(context.ShouldAntialias());
   FloatRect dest_rect((FloatPoint()), crossfade_size_);
   flags.setFilterQuality(
       context.ComputeFilterQuality(this, dest_rect, src_rect));
diff --git a/third_party/blink/renderer/platform/graphics/graphics_context.cc b/third_party/blink/renderer/platform/graphics/graphics_context.cc
index 676eb95..4cc66dadf 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_context.cc
+++ b/third_party/blink/renderer/platform/graphics/graphics_context.cc
@@ -910,7 +910,6 @@
   image_flags.setBlendMode(op);
   image_flags.setColor(SK_ColorBLACK);
   image_flags.setFilterQuality(ComputeFilterQuality(image, dest, src));
-  image_flags.setAntiAlias(ShouldAntialias());
   if (ShouldApplyHighContrastFilterToImage(*image))
     image_flags.setColorFilter(high_contrast_filter_);
   image->Draw(canvas_, image_flags, dest, src, should_respect_image_orientation,
@@ -946,7 +945,6 @@
   image_flags.setColor(SK_ColorBLACK);
   image_flags.setFilterQuality(
       ComputeFilterQuality(image, dest.Rect(), src_rect));
-  image_flags.setAntiAlias(ShouldAntialias());
 
   bool use_shader = (visible_src == src_rect) &&
                     (respect_orientation == kDoNotRespectImageOrientation);
diff --git a/third_party/blink/renderer/platform/graphics/image.cc b/third_party/blink/renderer/platform/graphics/image.cc
index 10b3f47..efa5fa0 100644
--- a/third_party/blink/renderer/platform/graphics/image.cc
+++ b/third_party/blink/renderer/platform/graphics/image.cc
@@ -395,9 +395,8 @@
 
   SkFilterQuality quality_to_use =
       context.ComputeFilterQuality(this, dest_rect, FloatRect(subset_rect));
-  bool should_antialias = context.ShouldAntialias();
   sk_sp<PaintShader> tile_shader = CreatePatternShader(
-      image, local_matrix, quality_to_use, should_antialias,
+      image, local_matrix, quality_to_use, context.ShouldAntialias(),
       FloatSize(repeat_spacing.Width() / scale_src_to_dest.Width(),
                 repeat_spacing.Height() / scale_src_to_dest.Height()),
       tmx, tmy);
@@ -409,7 +408,6 @@
   flags.setColor(tile_shader ? SK_ColorBLACK : SK_ColorTRANSPARENT);
   flags.setBlendMode(composite_op);
   flags.setFilterQuality(quality_to_use);
-  flags.setAntiAlias(should_antialias);
   flags.setShader(std::move(tile_shader));
 
   context.DrawRect(dest_rect, flags);