update to use SkTileMode (flutter/engine#8439)

This commit is contained in:
reed-at-google
2019-04-04 08:41:49 -04:00
committed by GitHub
parent 8cad449e9e
commit b33dc6002d
5 changed files with 15 additions and 15 deletions

View File

@@ -20,8 +20,8 @@ sk_sp<SkShader> 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

View File

@@ -42,7 +42,7 @@ fml::RefPtr<CanvasGradient> 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);

View File

@@ -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);

View File

@@ -35,8 +35,8 @@ fml::RefPtr<ImageShader> 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(

View File

@@ -29,8 +29,8 @@ class ImageShader : public Shader {
static fml::RefPtr<ImageShader> 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);