| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ | 5 #ifndef SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ |
| 6 #define SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ | 6 #define SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ |
| 7 | 7 |
| 8 #include "sky/engine/core/painting/CanvasColor.h" | 8 #include "sky/engine/core/painting/CanvasColor.h" |
| 9 #include "sky/engine/core/painting/Point.h" | 9 #include "sky/engine/core/painting/Point.h" |
| 10 #include "sky/engine/core/painting/Shader.h" | 10 #include "sky/engine/core/painting/Shader.h" |
| 11 #include "sky/engine/tonic/dart_wrappable.h" | 11 #include "sky/engine/tonic/dart_wrappable.h" |
| 12 #include "third_party/skia/include/effects/SkGradientShader.h" | 12 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class TileMode {}; |
| 17 |
| 18 template <> |
| 19 struct DartConverter<TileMode> : public DartConverterEnum<SkShader::TileMode> {}
; |
| 20 |
| 21 COMPILE_ASSERT(SkShader::kTileModeCount == 3, Need_to_update_Gradient_dart); |
| 22 |
| 16 class CanvasGradient : public Shader { | 23 class CanvasGradient : public Shader { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 25 public: |
| 19 ~CanvasGradient() override; | 26 ~CanvasGradient() override; |
| 20 static PassRefPtr<CanvasGradient> create(); | 27 static PassRefPtr<CanvasGradient> create(); |
| 21 | 28 |
| 22 void initLinear(const Vector<Point>& end_points, | 29 void initLinear(const Vector<Point>& end_points, |
| 23 const Vector<SkColor>& colors, | 30 const Vector<SkColor>& colors, |
| 24 const Vector<float>& color_stops, | 31 const Vector<float>& color_stops, |
| 25 unsigned tile_mode); | 32 SkShader::TileMode tile_mode); |
| 26 void initRadial(const Point& center, | 33 void initRadial(const Point& center, |
| 27 double radius, | 34 double radius, |
| 28 const Vector<SkColor>& colors, | 35 const Vector<SkColor>& colors, |
| 29 const Vector<float>& color_stops, | 36 const Vector<float>& color_stops, |
| 30 unsigned tile_mode); | 37 SkShader::TileMode tile_mode); |
| 31 | 38 |
| 32 private: | 39 private: |
| 33 CanvasGradient(); | 40 CanvasGradient(); |
| 34 }; | 41 }; |
| 35 | 42 |
| 36 } // namespace blink | 43 } // namespace blink |
| 37 | 44 |
| 38 #endif // SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ | 45 #endif // SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ |
| OLD | NEW |