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

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: add TestExpectations for layout test changes due to crbug.com/249478 Created 7 years, 6 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
Index: Source/core/platform/graphics/RoundedRect.cpp
diff --git a/Source/core/platform/graphics/RoundedRect.cpp b/Source/core/platform/graphics/RoundedRect.cpp
index 124af84a62ef7880bd0681673d5d9d0f186eea01..804eb0ad0d081c893da64baa1c490400b43ada53 100644
--- a/Source/core/platform/graphics/RoundedRect.cpp
+++ b/Source/core/platform/graphics/RoundedRect.cpp
@@ -80,6 +80,15 @@ void RoundedRect::Radii::expand(int topWidth, int bottomWidth, int leftWidth, in
}
}
+IntRect RoundedRect::enclosedRect() const
Julien - ping for review 2013/06/19 19:42:58 This will return a smaller rectangle that what enc
jbroman 2013/08/02 14:28:17 What I want is "quickly give me a rect which is en
+{
+ 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::inflateWithRadii(int size)
{
IntRect old = m_rect;

Powered by Google App Engine
This is Rietveld 408576698