summaryrefslogtreecommitdiffstats
path: root/cc/resources/layer_quad.h
diff options
context:
space:
mode:
Diffstat (limited to 'cc/resources/layer_quad.h')
-rw-r--r--cc/resources/layer_quad.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/resources/layer_quad.h b/cc/resources/layer_quad.h
index ed1db10..7433645 100644
--- a/cc/resources/layer_quad.h
+++ b/cc/resources/layer_quad.h
@@ -22,7 +22,7 @@ class CC_EXPORT LayerQuad {
public:
class Edge {
public:
- Edge() : x_(0), y_(0), z_(0) {}
+ Edge() : x_(0), y_(0), z_(0), degenerate_(false) {}
Edge(const gfx::PointF& p, const gfx::PointF& q);
float x() const { return x_; }
@@ -57,6 +57,8 @@ class CC_EXPORT LayerQuad {
}
void scale(float s) { scale(s, s, s); }
+ bool degenerate() const { return degenerate_; }
+
gfx::PointF Intersect(const Edge& e) const {
return gfx::PointF(
(y() * e.z() - e.y() * z()) / (x() * e.y() - e.x() * y()),
@@ -67,6 +69,7 @@ class CC_EXPORT LayerQuad {
float x_;
float y_;
float z_;
+ bool degenerate_;
};
LayerQuad(const Edge& left,