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

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

Issue 2745563004: Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: none 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(LayoutRect(rect.rect())), m_hasRadius(rect.hasRadius()) {} 46 : m_rect(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 }
47 52
48 const LayoutRect& rect() const { return m_rect; } 53 const LayoutRect& rect() const { return m_rect; }
49 54
50 bool hasRadius() const { return m_hasRadius; } 55 bool hasRadius() const { return m_hasRadius; }
51 void setHasRadius(bool hasRadius) { m_hasRadius = hasRadius; } 56 void setHasRadius(bool hasRadius) { m_hasRadius = hasRadius; }
52 57
53 bool operator==(const ClipRect& other) const { 58 bool operator==(const ClipRect& other) const {
54 return rect() == other.rect() && hasRadius() == other.hasRadius(); 59 return rect() == other.rect() && hasRadius() == other.hasRadius();
55 } 60 }
56 bool operator!=(const ClipRect& other) const { 61 bool operator!=(const ClipRect& other) const {
(...skipping 25 matching lines...) Expand all
82 87
83 inline ClipRect intersection(const ClipRect& a, const ClipRect& b) { 88 inline ClipRect intersection(const ClipRect& a, const ClipRect& b) {
84 ClipRect c = a; 89 ClipRect c = a;
85 c.intersect(b); 90 c.intersect(b);
86 return c; 91 return c;
87 } 92 }
88 93
89 } // namespace blink 94 } // namespace blink
90 95
91 #endif // ClipRect_h 96 #endif // ClipRect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698