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

Side by Side Diff: third_party/WebKit/Source/core/paint/ClipRect.h

Issue 2743733004: Revert of Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 25 matching lines...) Expand all
36 36
37 class ClipRect { 37 class ClipRect {
38 USING_FAST_MALLOC(ClipRect); 38 USING_FAST_MALLOC(ClipRect);
39 39
40 public: 40 public:
41 ClipRect() : m_hasRadius(false) {} 41 ClipRect() : m_hasRadius(false) {}
42 42
43 ClipRect(const LayoutRect& rect) : m_rect(rect), m_hasRadius(false) {} 43 ClipRect(const LayoutRect& rect) : m_rect(rect), m_hasRadius(false) {}
44 44
45 ClipRect(const FloatClipRect& rect) 45 ClipRect(const FloatClipRect& rect)
46 : m_rect(rect.rect()), m_hasRadius(rect.hasRadius()) {} 46 : m_rect(LayoutRect(rect.rect())), m_hasRadius(rect.hasRadius()) {}
47
48 void setRect(const FloatClipRect& rect) {
49 m_rect = LayoutRect(rect.rect());
50 m_hasRadius = rect.hasRadius();
51 }
52 47
53 const LayoutRect& rect() const { return m_rect; } 48 const LayoutRect& rect() const { return m_rect; }
54 49
55 bool hasRadius() const { return m_hasRadius; } 50 bool hasRadius() const { return m_hasRadius; }
56 void setHasRadius(bool hasRadius) { m_hasRadius = hasRadius; } 51 void setHasRadius(bool hasRadius) { m_hasRadius = hasRadius; }
57 52
58 bool operator==(const ClipRect& other) const { 53 bool operator==(const ClipRect& other) const {
59 return rect() == other.rect() && hasRadius() == other.hasRadius(); 54 return rect() == other.rect() && hasRadius() == other.hasRadius();
60 } 55 }
61 bool operator!=(const ClipRect& other) const { 56 bool operator!=(const ClipRect& other) const {
(...skipping 25 matching lines...) Expand all
87 82
88 inline ClipRect intersection(const ClipRect& a, const ClipRect& b) { 83 inline ClipRect intersection(const ClipRect& a, const ClipRect& b) {
89 ClipRect c = a; 84 ClipRect c = a;
90 c.intersect(b); 85 c.intersect(b);
91 return c; 86 return c;
92 } 87 }
93 88
94 } // namespace blink 89 } // namespace blink
95 90
96 #endif // ClipRect_h 91 #endif // ClipRect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698