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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/FloatClipRect.h

Issue 2699593006: Refactor to remove need for infiniteIntRect when computing rects in pre-paint (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef FloatClipRect_h 5 #ifndef FloatClipRect_h
6 #define FloatClipRect_h 6 #define FloatClipRect_h
7 7
8 #include "platform/geometry/FloatRect.h" 8 #include "platform/geometry/FloatRect.h"
9 #include "platform/geometry/LayoutRect.h" 9 #include "platform/geometry/LayoutRect.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
(...skipping 27 matching lines...) Expand all
38 void setHasRadius(bool hasRadius) { 38 void setHasRadius(bool hasRadius) {
39 m_hasRadius = hasRadius; 39 m_hasRadius = hasRadius;
40 m_isInfinite = false; 40 m_isInfinite = false;
41 } 41 }
42 42
43 void setRect(const FloatRect& rect) { 43 void setRect(const FloatRect& rect) {
44 m_rect = rect; 44 m_rect = rect;
45 m_isInfinite = false; 45 m_isInfinite = false;
46 } 46 }
47 47
48 void moveBy(const FloatPoint& offset) {
wkorman 2017/02/16 21:45:32 Maybe worth starting a FloatClipRectTest. Would ob
chrishtr 2017/02/16 23:48:32 Done.
49 if (m_isInfinite)
50 return;
51 m_rect.moveBy(offset);
52 }
53
48 bool isInfinite() const { return m_isInfinite; } 54 bool isInfinite() const { return m_isInfinite; }
49 55
50 private: 56 private:
51 FloatRect m_rect; 57 FloatRect m_rect;
52 bool m_hasRadius : 1; 58 bool m_hasRadius : 1;
53 bool m_isInfinite : 1; 59 bool m_isInfinite : 1;
54 }; 60 };
55 61
56 inline bool operator==(const FloatClipRect& a, const FloatClipRect& b) { 62 inline bool operator==(const FloatClipRect& a, const FloatClipRect& b) {
57 if (a.isInfinite() && b.isInfinite()) 63 if (a.isInfinite() && b.isInfinite())
58 return true; 64 return true;
59 if (!a.isInfinite() && !b.isInfinite()) 65 if (!a.isInfinite() && !b.isInfinite())
60 return a.rect() == b.rect() && a.hasRadius() == b.hasRadius(); 66 return a.rect() == b.rect() && a.hasRadius() == b.hasRadius();
61 return false; 67 return false;
62 } 68 }
63 69
64 } // namespace blink 70 } // namespace blink
65 71
66 #endif // FloatClipRect_h 72 #endif // FloatClipRect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698