Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(729)

Unified Diff: Source/core/platform/graphics/RoundedRect.cpp

Issue 16402019: Remove clips where we can show that they are unnecessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: per jchaffraix Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/graphics/RoundedRect.h ('k') | Source/core/platform/graphics/RoundedRectTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/RoundedRect.cpp
diff --git a/Source/core/platform/graphics/RoundedRect.cpp b/Source/core/platform/graphics/RoundedRect.cpp
index 8eab02dab79ab43124af781e6f5d5fb44007e9be..4ef82618f82e8055efef9c63332505947434f982 100644
--- a/Source/core/platform/graphics/RoundedRect.cpp
+++ b/Source/core/platform/graphics/RoundedRect.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "core/platform/graphics/RoundedRect.h"
+#include "wtf/Assertions.h"
#include <algorithm>
@@ -150,6 +151,16 @@ RoundedRect::RoundedRect(const IntRect& rect, const IntSize& topLeft, const IntS
{
}
+IntRect RoundedRect::radiusCenterRect() const
+{
+ ASSERT(isRenderable());
+ int minX = m_rect.x() + max(m_radii.topLeft().width(), m_radii.bottomLeft().width());
+ int minY = m_rect.y() + max(m_radii.topLeft().height(), m_radii.topRight().height());
+ int maxX = m_rect.maxX() - max(m_radii.topRight().width(), m_radii.bottomRight().width());
+ int maxY = m_rect.maxY() - max(m_radii.bottomLeft().height(), m_radii.bottomRight().height());
+ return IntRect(minX, minY, maxX - minX, maxY - minY);
+}
+
void RoundedRect::includeLogicalEdges(const Radii& edges, bool isHorizontal, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
m_radii.includeLogicalEdges(edges, isHorizontal, includeLogicalLeftEdge, includeLogicalRightEdge);
« no previous file with comments | « Source/core/platform/graphics/RoundedRect.h ('k') | Source/core/platform/graphics/RoundedRectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698