OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 19 matching lines...) Expand all Loading... |
30 #include "platform/geometry/IntRectExtent.h" | 30 #include "platform/geometry/IntRectExtent.h" |
31 #include "platform/graphics/filters/FilterOperation.h" | 31 #include "platform/graphics/filters/FilterOperation.h" |
32 #include "wtf/RefPtr.h" | 32 #include "wtf/RefPtr.h" |
33 #include "wtf/Vector.h" | 33 #include "wtf/Vector.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 typedef IntRectExtent FilterOutsets; | 37 typedef IntRectExtent FilterOutsets; |
38 | 38 |
39 class PLATFORM_EXPORT FilterOperations { | 39 class PLATFORM_EXPORT FilterOperations { |
| 40 #if ENABLE(OILPAN) |
| 41 DISALLOW_ALLOCATION(); |
| 42 #else |
40 WTF_MAKE_FAST_ALLOCATED; | 43 WTF_MAKE_FAST_ALLOCATED; |
| 44 #endif |
41 public: | 45 public: |
42 FilterOperations(); | 46 FilterOperations(); |
43 FilterOperations(const FilterOperations& other) { *this = other; } | 47 FilterOperations(const FilterOperations& other) { *this = other; } |
44 | 48 |
45 FilterOperations& operator=(const FilterOperations&); | 49 FilterOperations& operator=(const FilterOperations&); |
46 | 50 |
47 bool operator==(const FilterOperations&) const; | 51 bool operator==(const FilterOperations&) const; |
48 bool operator!=(const FilterOperations& o) const | 52 bool operator!=(const FilterOperations& o) const |
49 { | 53 { |
50 return !(*this == o); | 54 return !(*this == o); |
51 } | 55 } |
52 | 56 |
53 void clear() | 57 void clear() |
54 { | 58 { |
55 m_operations.clear(); | 59 m_operations.clear(); |
56 } | 60 } |
57 | 61 |
58 Vector<RefPtr<FilterOperation> >& operations() { return m_operations; } | 62 typedef WillBeHeapVector<RefPtrWillBeMember<FilterOperation> > FilterOperati
onVector; |
59 const Vector<RefPtr<FilterOperation> >& operations() const { return m_operat
ions; } | 63 |
| 64 FilterOperationVector& operations() { return m_operations; } |
| 65 const FilterOperationVector& operations() const { return m_operations; } |
60 | 66 |
61 bool isEmpty() const { return !m_operations.size(); } | 67 bool isEmpty() const { return !m_operations.size(); } |
62 size_t size() const { return m_operations.size(); } | 68 size_t size() const { return m_operations.size(); } |
63 const FilterOperation* at(size_t index) const { return index < m_operations.
size() ? m_operations.at(index).get() : 0; } | 69 const FilterOperation* at(size_t index) const { return index < m_operations.
size() ? m_operations.at(index).get() : 0; } |
64 | 70 |
65 bool canInterpolateWith(const FilterOperations&) const; | 71 bool canInterpolateWith(const FilterOperations&) const; |
66 | 72 |
67 bool hasOutsets() const; | 73 bool hasOutsets() const; |
68 FilterOutsets outsets() const; | 74 FilterOutsets outsets() const; |
69 | 75 |
70 bool hasFilterThatAffectsOpacity() const; | 76 bool hasFilterThatAffectsOpacity() const; |
71 bool hasFilterThatMovesPixels() const; | 77 bool hasFilterThatMovesPixels() const; |
72 | 78 |
73 bool hasReferenceFilter() const; | 79 bool hasReferenceFilter() const; |
| 80 |
| 81 void trace(Visitor*); |
| 82 |
74 private: | 83 private: |
75 Vector<RefPtr<FilterOperation> > m_operations; | 84 FilterOperationVector m_operations; |
76 }; | 85 }; |
77 | 86 |
| 87 #if ENABLE(OILPAN) |
| 88 // Wrapper object for the FilterOperations part object. |
| 89 class FilterOperationsWrapper : public GarbageCollected<FilterOperationsWrapper>
{ |
| 90 public: |
| 91 static FilterOperationsWrapper* create() |
| 92 { |
| 93 return new FilterOperationsWrapper(); |
| 94 } |
| 95 |
| 96 const FilterOperations& operations() const { return m_operations; } |
| 97 |
| 98 void trace(Visitor* visitor) { visitor->trace(m_operations); } |
| 99 |
| 100 private: |
| 101 FilterOperationsWrapper() |
| 102 { |
| 103 } |
| 104 |
| 105 FilterOperations m_operations; |
| 106 }; |
| 107 #endif |
| 108 |
78 } // namespace blink | 109 } // namespace blink |
79 | 110 |
80 | 111 |
81 #endif // FilterOperations_h | 112 #endif // FilterOperations_h |
OLD | NEW |