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

Side by Side Diff: Source/core/platform/graphics/RoundedRect.h

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 unified diff | Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/platform/graphics/RoundedRect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 explicit RoundedRect(const IntRect&, const Radii& = Radii()); 76 explicit RoundedRect(const IntRect&, const Radii& = Radii());
77 RoundedRect(int x, int y, int width, int height); 77 RoundedRect(int x, int y, int width, int height);
78 RoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight); 78 RoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
79 79
80 const IntRect& rect() const { return m_rect; } 80 const IntRect& rect() const { return m_rect; }
81 const Radii& radii() const { return m_radii; } 81 const Radii& radii() const { return m_radii; }
82 bool isRounded() const { return !m_radii.isZero(); } 82 bool isRounded() const { return !m_radii.isZero(); }
83 bool isEmpty() const { return m_rect.isEmpty(); } 83 bool isEmpty() const { return m_rect.isEmpty(); }
84 84
85 // Returns a quickly computed rect enclosed by the rounded rect.
86 IntRect radiusCenterRect() const;
87
85 void setRect(const IntRect& rect) { m_rect = rect; } 88 void setRect(const IntRect& rect) { m_rect = rect; }
86 void setRadii(const Radii& radii) { m_radii = radii; } 89 void setRadii(const Radii& radii) { m_radii = radii; }
87 90
88 void move(const IntSize& size) { m_rect.move(size); } 91 void move(const IntSize& size) { m_rect.move(size); }
89 void inflate(int size) { m_rect.inflate(size); } 92 void inflate(int size) { m_rect.inflate(size); }
90 void inflateWithRadii(int size); 93 void inflateWithRadii(int size);
91 void expandRadii(int size) { m_radii.expand(size); } 94 void expandRadii(int size) { m_radii.expand(size); }
92 void shrinkRadii(int size) { m_radii.shrink(size); } 95 void shrinkRadii(int size) { m_radii.shrink(size); }
93 96
94 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool include LogicalLeftEdge, bool includeLogicalRightEdge); 97 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool include LogicalLeftEdge, bool includeLogicalRightEdge);
(...skipping 23 matching lines...) Expand all
118 121
119 inline bool operator==(const RoundedRect& a, const RoundedRect& b) 122 inline bool operator==(const RoundedRect& a, const RoundedRect& b)
120 { 123 {
121 return a.rect() == b.rect() && a.radii() == b.radii(); 124 return a.rect() == b.rect() && a.radii() == b.radii();
122 } 125 }
123 126
124 127
125 } // namespace WebCore 128 } // namespace WebCore
126 129
127 #endif // RoundedRect_h 130 #endif // RoundedRect_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/platform/graphics/RoundedRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698