Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: sky/engine/core/painting/CanvasGradient.h

Issue 1169863002: Sky: Added radial gradients. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/core/painting/CanvasGradient.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/painting/CanvasGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698