diff options
author | Chris Craik <ccraik@google.com> | 2013-05-08 18:35:44 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-05-14 14:12:55 -0700 |
commit | 6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a (patch) | |
tree | e7b76c068ff3e8485fdc164118914ee3b53a2368 /libs/hwui/Vertex.h | |
parent | 0ace0aa7d643b5b9952d32827575f041ba563c58 (diff) | |
download | frameworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.zip frameworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.tar.gz frameworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.tar.bz2 |
Add tessellation path for points
bug:4351353
bug:8185479
Point tessellation is similar to line special case, except that we
only tessellate one point (as a circle or rect) and duplicate it
across other instances.
Additionally:
Fixes square caps for AA=false lines
Cleanup in CanvasCompare, disabling interpolation on zoomed-in
comparison view
Change-Id: I0756fcc4b20f77878fed0d8057297c80e82ed9dc
Diffstat (limited to 'libs/hwui/Vertex.h')
-rw-r--r-- | libs/hwui/Vertex.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/hwui/Vertex.h b/libs/hwui/Vertex.h index 523120e..c06762f 100644 --- a/libs/hwui/Vertex.h +++ b/libs/hwui/Vertex.h @@ -17,6 +17,8 @@ #ifndef ANDROID_HWUI_VERTEX_H #define ANDROID_HWUI_VERTEX_H +#include "Vector.h" + namespace android { namespace uirenderer { @@ -30,6 +32,15 @@ struct Vertex { vertex[0].position[0] = x; vertex[0].position[1] = y; } + + static inline void set(Vertex* vertex, vec2 val) { + set(vertex, val.x, val.y); + } + + static inline void copyWithOffset(Vertex* vertex, const Vertex& src, float x, float y) { + set(vertex, src.position[0] + x, src.position[1] + y); + } + }; // struct Vertex /** @@ -81,6 +92,12 @@ struct AlphaVertex : Vertex { vertex[0].alpha = alpha; } + static inline void copyWithOffset(AlphaVertex* vertex, const AlphaVertex& src, + float x, float y) { + Vertex::set(vertex, src.position[0] + x, src.position[1] + y); + vertex[0].alpha = src.alpha; + } + static inline void setColor(AlphaVertex* vertex, float alpha) { vertex[0].alpha = alpha; } |