OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CCRenderPass_h | 5 #ifndef CCRenderPass_h |
6 #define CCRenderPass_h | 6 #define CCRenderPass_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "cc/hash_pair.h" | 9 #include "cc/hash_pair.h" |
10 #include "cc/scoped_ptr_hash_map.h" | 10 #include "cc/scoped_ptr_hash_map.h" |
11 #include "cc/scoped_ptr_vector.h" | 11 #include "cc/scoped_ptr_vector.h" |
12 #include "CCDrawQuad.h" | 12 #include "CCDrawQuad.h" |
13 #include "CCSharedQuadState.h" | 13 #include "CCSharedQuadState.h" |
14 #include "FloatRect.h" | 14 #include "FloatRect.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
16 #include <public/WebFilterOperations.h> | 16 #include <public/WebFilterOperations.h> |
17 #include <public/WebTransformationMatrix.h> | 17 #include <public/WebTransformationMatrix.h> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 class SkImageFilter; | |
21 | |
20 namespace cc { | 22 namespace cc { |
21 | 23 |
22 class CCLayerImpl; | 24 class CCLayerImpl; |
23 template<typename LayerType, typename SurfaceType> | 25 template<typename LayerType, typename SurfaceType> |
24 class CCOcclusionTrackerBase; | 26 class CCOcclusionTrackerBase; |
25 class CCRenderSurface; | 27 class CCRenderSurface; |
26 | 28 |
27 struct CCAppendQuadsData; | 29 struct CCAppendQuadsData; |
28 | 30 |
29 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI mpl; | 31 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI mpl; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 | 85 |
84 FloatRect damageRect() const { return m_damageRect; } | 86 FloatRect damageRect() const { return m_damageRect; } |
85 void setDamageRect(FloatRect rect) { m_damageRect = rect; } | 87 void setDamageRect(FloatRect rect) { m_damageRect = rect; } |
86 | 88 |
87 const WebKit::WebFilterOperations& filters() const { return m_filters; } | 89 const WebKit::WebFilterOperations& filters() const { return m_filters; } |
88 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi lters; } | 90 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi lters; } |
89 | 91 |
90 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back groundFilters; } | 92 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back groundFilters; } |
91 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba ckgroundFilters = filters; } | 93 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba ckgroundFilters = filters; } |
92 | 94 |
95 SkImageFilter* filter() const { return m_filter; } | |
danakj
2012/10/19 19:34:24
can we rename this to imageFilter()?
| |
96 void setFilter(SkImageFilter* filter); | |
97 | |
93 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 98 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
94 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; } | 99 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; } |
95 | 100 |
96 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro mOutsideTargetSurface; } | 101 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro mOutsideTargetSurface; } |
97 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa rgetSurface; } | 102 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa rgetSurface; } |
98 protected: | 103 protected: |
99 CCRenderPass(Id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget); | 104 CCRenderPass(Id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget); |
100 | 105 |
101 Id m_id; | 106 Id m_id; |
102 CCQuadList m_quadList; | 107 CCQuadList m_quadList; |
103 CCSharedQuadStateList m_sharedQuadStateList; | 108 CCSharedQuadStateList m_sharedQuadStateList; |
104 WebKit::WebTransformationMatrix m_transformToRootTarget; | 109 WebKit::WebTransformationMatrix m_transformToRootTarget; |
105 IntRect m_outputRect; | 110 IntRect m_outputRect; |
106 FloatRect m_damageRect; | 111 FloatRect m_damageRect; |
107 bool m_hasTransparentBackground; | 112 bool m_hasTransparentBackground; |
108 bool m_hasOcclusionFromOutsideTargetSurface; | 113 bool m_hasOcclusionFromOutsideTargetSurface; |
109 WebKit::WebFilterOperations m_filters; | 114 WebKit::WebFilterOperations m_filters; |
110 WebKit::WebFilterOperations m_backgroundFilters; | 115 WebKit::WebFilterOperations m_backgroundFilters; |
116 SkImageFilter* m_filter; | |
111 | 117 |
112 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); | 118 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); |
113 }; | 119 }; |
114 | 120 |
115 } // namespace cc | 121 } // namespace cc |
116 | 122 |
117 namespace BASE_HASH_NAMESPACE { | 123 namespace BASE_HASH_NAMESPACE { |
118 #if defined(COMPILER_MSVC) | 124 #if defined(COMPILER_MSVC) |
119 template<> | 125 template<> |
120 inline size_t hash_value<cc::CCRenderPass::Id>(const cc::CCRenderPass::Id& key) { | 126 inline size_t hash_value<cc::CCRenderPass::Id>(const cc::CCRenderPass::Id& key) { |
(...skipping 10 matching lines...) Expand all Loading... | |
131 #error define a hash function for your compiler | 137 #error define a hash function for your compiler |
132 #endif // COMPILER | 138 #endif // COMPILER |
133 } | 139 } |
134 | 140 |
135 namespace cc { | 141 namespace cc { |
136 typedef std::vector<CCRenderPass*> CCRenderPassList; | 142 typedef std::vector<CCRenderPass*> CCRenderPassList; |
137 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; | 143 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; |
138 } // namespace cc | 144 } // namespace cc |
139 | 145 |
140 #endif | 146 #endif |
OLD | NEW |