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 CanvasGradient : public Shader { | 16 class CanvasGradient : public Shader { |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 18 public: |
19 ~CanvasGradient() override; | 19 ~CanvasGradient() override; |
20 static PassRefPtr<CanvasGradient> create(int type, | 20 static PassRefPtr<CanvasGradient> create(); |
21 const Vector<Point>& end_points, | 21 |
22 const Vector<SkColor>& colors, | 22 void initLinear(const Vector<Point>& end_points, |
23 const Vector<float>& color_stops); | 23 const Vector<SkColor>& colors, |
| 24 const Vector<float>& color_stops); |
| 25 void initRadial(const Point& center, |
| 26 double radius, |
| 27 const Vector<SkColor>& colors, |
| 28 const Vector<float>& color_stops); |
24 | 29 |
25 private: | 30 private: |
26 CanvasGradient(PassRefPtr<SkShader> shader); | 31 CanvasGradient(); |
27 }; | 32 }; |
28 | 33 |
29 } // namespace blink | 34 } // namespace blink |
30 | 35 |
31 #endif // SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ | 36 #endif // SKY_ENGINE_CORE_PAINTING_CANVASGRADIENT_H_ |
OLD | NEW |