Index: cc/draw_quad.h |
diff --git a/cc/draw_quad.h b/cc/draw_quad.h |
index dc87a5d96a0d2ffe4a55b3819ca5f4db5733d058..4ac3f070cf900f21d0de4c0330c6b39d777862d6 100644 |
--- a/cc/draw_quad.h |
+++ b/cc/draw_quad.h |
@@ -66,11 +66,38 @@ class CC_EXPORT DrawQuad { |
const SharedQuadState* shared_quad_state; |
bool IsDebugQuad() const { return material == DEBUG_BORDER; } |
+ |
bool ShouldDrawWithBlending() const { |
return needs_blending || shared_quad_state->opacity < 1.0f || |
!opaque_rect.Contains(visible_rect); |
} |
+ // Is the left edge of this tile aligned with the originating layer's |
+ // left edge? |
+ bool IsLeftEdge() const { return !rect.x(); } |
+ |
+ // Is the top edge of this tile aligned with the originating layer's |
+ // top edge? |
+ bool IsTopEdge() const { return !rect.y(); } |
+ |
+ // Is the right edge of this tile aligned with the originating layer's |
+ // right edge? |
+ bool IsRightEdge() const { |
+ return rect.right() == shared_quad_state->content_bounds.width(); |
+ } |
+ |
+ // Is the bottom edge of this tile aligned with the originating layer's |
+ // bottom edge? |
+ bool IsBottomEdge() const { |
+ return rect.bottom() == shared_quad_state->content_bounds.height(); |
+ } |
+ |
+ // Is any edge of this tile aligned with the originating layer's |
+ // corresponding edge? |
+ bool IsEdge() const { |
+ return IsLeftEdge() || IsTopEdge() || IsRightEdge() || IsBottomEdge(); |
+ } |
+ |
virtual void AppendResources(ResourceProvider::ResourceIdArray* resources); |
protected: |