From b33dc6002d6c4b95e9183aebe71da97756e89754 Mon Sep 17 00:00:00 2001 From: reed-at-google Date: Thu, 4 Apr 2019 08:41:49 -0400 Subject: [PATCH] update to use SkTileMode (flutter/engine#8439) --- engine/src/flutter/flow/paint_utils.cc | 4 ++-- engine/src/flutter/lib/ui/painting/gradient.cc | 8 ++++---- engine/src/flutter/lib/ui/painting/gradient.h | 10 +++++----- engine/src/flutter/lib/ui/painting/image_shader.cc | 4 ++-- engine/src/flutter/lib/ui/painting/image_shader.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/engine/src/flutter/flow/paint_utils.cc b/engine/src/flutter/flow/paint_utils.cc index 22b0735b89..791965f69b 100644 --- a/engine/src/flutter/flow/paint_utils.cc +++ b/engine/src/flutter/flow/paint_utils.cc @@ -20,8 +20,8 @@ sk_sp CreateCheckerboardShader(SkColor c1, SkColor c2, int size) { bm.eraseColor(c1); bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); - return SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); + return SkShader::MakeBitmapShader(bm, SkTileMode::kRepeat, + SkTileMode::kRepeat); } } // anonymous namespace diff --git a/engine/src/flutter/lib/ui/painting/gradient.cc b/engine/src/flutter/lib/ui/painting/gradient.cc index 287e8e7862..d18f0a637c 100644 --- a/engine/src/flutter/lib/ui/painting/gradient.cc +++ b/engine/src/flutter/lib/ui/painting/gradient.cc @@ -42,7 +42,7 @@ fml::RefPtr CanvasGradient::Create() { void CanvasGradient::initLinear(const tonic::Float32List& end_points, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode) { + SkTileMode tile_mode) { FML_DCHECK(end_points.num_elements() == 4); FML_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); @@ -63,7 +63,7 @@ void CanvasGradient::initRadial(double center_x, double radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, const tonic::Float64List& matrix4) { FML_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); @@ -87,7 +87,7 @@ void CanvasGradient::initSweep(double center_x, double center_y, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, double start_angle, double end_angle, const tonic::Float64List& matrix4) { @@ -118,7 +118,7 @@ void CanvasGradient::initTwoPointConical(double start_x, double end_radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, const tonic::Float64List& matrix4) { FML_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); diff --git a/engine/src/flutter/lib/ui/painting/gradient.h b/engine/src/flutter/lib/ui/painting/gradient.h index 83e2a45e0d..622542db0a 100644 --- a/engine/src/flutter/lib/ui/painting/gradient.h +++ b/engine/src/flutter/lib/ui/painting/gradient.h @@ -20,7 +20,7 @@ class DartLibraryNatives; namespace blink { // TODO: update this if/when Skia adds Decal mode skbug.com/7638 -static_assert(SkShader::kTileModeCount >= 3, "Need to update tile mode enum"); +static_assert(kSkTileModeCount >= 3, "Need to update tile mode enum"); class CanvasGradient : public Shader { DEFINE_WRAPPERTYPEINFO(); @@ -33,21 +33,21 @@ class CanvasGradient : public Shader { void initLinear(const tonic::Float32List& end_points, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode); + SkTileMode tile_mode); void initRadial(double center_x, double center_y, double radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, const tonic::Float64List& matrix4); void initSweep(double center_x, double center_y, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, double start_angle, double end_angle, const tonic::Float64List& matrix4); @@ -60,7 +60,7 @@ class CanvasGradient : public Shader { double end_radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, + SkTileMode tile_mode, const tonic::Float64List& matrix4); static void RegisterNatives(tonic::DartLibraryNatives* natives); diff --git a/engine/src/flutter/lib/ui/painting/image_shader.cc b/engine/src/flutter/lib/ui/painting/image_shader.cc index 389a214270..136471e26c 100644 --- a/engine/src/flutter/lib/ui/painting/image_shader.cc +++ b/engine/src/flutter/lib/ui/painting/image_shader.cc @@ -35,8 +35,8 @@ fml::RefPtr ImageShader::Create() { } void ImageShader::initWithImage(CanvasImage* image, - SkShader::TileMode tmx, - SkShader::TileMode tmy, + SkTileMode tmx, + SkTileMode tmy, const tonic::Float64List& matrix4) { if (!image) { Dart_ThrowException( diff --git a/engine/src/flutter/lib/ui/painting/image_shader.h b/engine/src/flutter/lib/ui/painting/image_shader.h index 1365577fa1..e2a35cb285 100644 --- a/engine/src/flutter/lib/ui/painting/image_shader.h +++ b/engine/src/flutter/lib/ui/painting/image_shader.h @@ -29,8 +29,8 @@ class ImageShader : public Shader { static fml::RefPtr Create(); void initWithImage(CanvasImage* image, - SkShader::TileMode tmx, - SkShader::TileMode tmy, + SkTileMode tmx, + SkTileMode tmy, const tonic::Float64List& matrix4); static void RegisterNatives(tonic::DartLibraryNatives* natives);