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

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

Issue 1152383002: A proof of concept for annular sector layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add the Path C++ and IDL files which I forgot before 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 | « sky/engine/core/painting/Canvas.idl ('k') | sky/engine/core/painting/CanvasPath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SKY_ENGINE_CORE_PAINTING_PATH_H_
6 #define SKY_ENGINE_CORE_PAINTING_PATH_H_
7
8 #include "sky/engine/core/painting/Rect.h"
9 #include "sky/engine/tonic/dart_wrappable.h"
10 #include "sky/engine/wtf/PassRefPtr.h"
11 #include "sky/engine/wtf/RefCounted.h"
12 #include "third_party/skia/include/core/SkPath.h"
13
14 // Note: There's a very similar class in ../../platform/graphics/Path.h
15 // We should probably rationalise these two.
16 // (The existence of that class is why this is CanvasPath and not just Path.)
17
18 namespace blink {
19
20 class CanvasPath : public RefCounted<CanvasPath>, public DartWrappable {
21 DEFINE_WRAPPERTYPEINFO();
22 public:
23 ~CanvasPath() override;
24 static PassRefPtr<CanvasPath> create()
25 {
26 return adoptRef(new CanvasPath);
27 }
28
29 void moveTo(float x, float y)
30 {
31 m_path.moveTo(x, y);
32 }
33
34 void lineTo(float x, float y)
35 {
36 m_path.lineTo(x, y);
37 }
38
39 void arcTo(const Rect& rect, float startAngle, float sweepAngle, bool forceM oveTo)
40 {
41 m_path.arcTo(rect.sk_rect, startAngle, sweepAngle, forceMoveTo);
42 }
43
44 void close()
45 {
46 m_path.close();
47 }
48
49 const SkPath& path() const { return m_path; }
50
51 private:
52 CanvasPath();
53
54 SkPath m_path;
55 };
56
57 } // namespace blink
58
59 #endif // SKY_ENGINE_CORE_PAINTING_PATH_H_
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Canvas.idl ('k') | sky/engine/core/painting/CanvasPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698