1 //
2 // Copyright (c) 2002-2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // Path.h: Defines the gl::Path class, representing CHROMIUM_path_rendering
8 // path object.
9 
10 #ifndef LIBANGLE_PATH_H_
11 #define LIBANGLE_PATH_H_
12 
13 #include "angle_gl.h"
14 #include "common/angleutils.h"
15 #include "libANGLE/Error.h"
16 #include "libANGLE/RefCountObject.h"
17 
18 namespace rx
19 {
20 class PathImpl;
21 }
22 
23 namespace gl
24 {
25 class Path final : angle::NonCopyable
26 {
27   public:
28     Path(rx::PathImpl *impl);
29 
30     ~Path();
31 
32     Error setCommands(GLsizei numCommands,
33                       const GLubyte *commands,
34                       GLsizei numCoords,
35                       GLenum coordType,
36                       const void *coords);
37 
38     void setStrokeWidth(GLfloat width);
39     void setStrokeBound(GLfloat bound);
40     void setEndCaps(GLenum type);
41     void setJoinStyle(GLenum type);
42     void setMiterLimit(GLfloat value);
43 
getStrokeWidth()44     GLfloat getStrokeWidth() const { return mStrokeWidth; }
getStrokeBound()45     GLfloat getStrokeBound() const { return mStrokeBound; }
getMiterLimit()46     GLfloat getMiterLimit() const { return mMiterLimit; }
getEndCaps()47     GLenum getEndCaps() const { return mEndCaps; }
getJoinStyle()48     GLenum getJoinStyle() const { return mJoinStyle; }
49 
hasPathData()50     bool hasPathData() const { return mHasData; }
51 
getImplementation()52     rx::PathImpl *getImplementation() const { return mPath; }
53 
54   private:
55     rx::PathImpl *mPath;
56 
57     // a Path object is not actually considered "a path"
58     // untill it has been specified with data. So we'll
59     // keep this flag to support this semantics.
60     bool mHasData;
61 
62     GLenum mEndCaps;
63     GLenum mJoinStyle;
64     GLfloat mStrokeWidth;
65     GLfloat mStrokeBound;
66     GLfloat mMiterLimit;
67 };
68 
69 }  // namespace gl
70 
71 #endif  // LIBANGLE_PATH_H_