未验证 提交 5944867c 编写于 作者: R reed-at-google 提交者: GitHub

update to use SkTileMode (#8439)

上级 ad9d2417
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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(
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册