diff options
author | Chet Haase <chet@google.com> | 2011-04-13 17:58:08 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2011-04-21 11:47:05 -0700 |
commit | 5b0200bd47e8a9a4dc8d2e6c3a110d522b30bf82 (patch) | |
tree | 905d0c539f0ed9a4e6ae6538bd6ab7f74efeefb8 /libs/hwui/Vertex.h | |
parent | 3ad604b3d8a3ae87ee3f7545677bacc8f11159c0 (diff) | |
download | frameworks_base-5b0200bd47e8a9a4dc8d2e6c3a110d522b30bf82.zip frameworks_base-5b0200bd47e8a9a4dc8d2e6c3a110d522b30bf82.tar.gz frameworks_base-5b0200bd47e8a9a4dc8d2e6c3a110d522b30bf82.tar.bz2 |
Enable anti-aliasing for hw-accelerated lines
Draw anti-aliased lines with OpenGL by constructing a quad with
a border that fades out (to mimic fragment coverage).
Change-Id: Ib81a3e62d663acdf1b46b401ac4aa7ee9855cc7e
Diffstat (limited to 'libs/hwui/Vertex.h')
-rw-r--r-- | libs/hwui/Vertex.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/hwui/Vertex.h b/libs/hwui/Vertex.h index bbf4d4a..c120428 100644 --- a/libs/hwui/Vertex.h +++ b/libs/hwui/Vertex.h @@ -23,6 +23,18 @@ namespace uirenderer { /** * Simple structure to describe a vertex with a position and a texture. */ +struct Vertex { + float position[2]; + + static inline void set(Vertex* vertex, float x, float y) { + vertex[0].position[0] = x; + vertex[0].position[1] = y; + } +}; // struct Vertex + +/** + * Simple structure to describe a vertex with a position and a texture. + */ struct TextureVertex { float position[2]; float texture[2]; @@ -40,6 +52,22 @@ struct TextureVertex { } }; // struct TextureVertex +/** + * Simple structure to describe a vertex with a position and an alpha value. + */ +struct AlphaVertex : Vertex { + float alpha; + + static inline void set(AlphaVertex* vertex, float x, float y, float alpha) { + Vertex::set(vertex, x, y); + vertex[0].alpha = alpha; + } + + static inline void setColor(AlphaVertex* vertex, float alpha) { + vertex[0].alpha = alpha; + } +}; // struct AlphaVertex + }; // namespace uirenderer }; // namespace android |