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 "CCDrawQuad.h" | 8 #include "CCDrawQuad.h" |
9 #include "FloatRect.h" | 9 #include "FloatRect.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "cc/hash_pair.h" | 11 #include "cc/hash_pair.h" |
12 #include "cc/scoped_ptr_hash_map.h" | 12 #include "cc/scoped_ptr_hash_map.h" |
13 #include "cc/scoped_ptr_vector.h" | 13 #include "cc/scoped_ptr_vector.h" |
14 #include "cc/shared_quad_state.h" | 14 #include "cc/shared_quad_state.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
16 #include "ui/gfx/rect_f.h" | 16 #include "ui/gfx/rect_f.h" |
17 #include <public/WebFilterOperations.h> | 17 #include <public/WebFilterOperations.h> |
18 #include <public/WebTransformationMatrix.h> | 18 #include <public/WebTransformationMatrix.h> |
19 #include <vector> | 19 #include <vector> |
20 | 20 |
| 21 class SkImageFilter; |
| 22 |
21 namespace cc { | 23 namespace cc { |
22 | 24 |
23 class LayerImpl; | 25 class LayerImpl; |
24 template<typename LayerType, typename SurfaceType> | 26 template<typename LayerType, typename SurfaceType> |
25 class OcclusionTrackerBase; | 27 class OcclusionTrackerBase; |
26 class RenderSurfaceImpl; | 28 class RenderSurfaceImpl; |
27 | 29 |
28 struct AppendQuadsData; | 30 struct AppendQuadsData; |
29 | 31 |
30 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; | 32 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 86 |
85 gfx::RectF damageRect() const { return m_damageRect; } | 87 gfx::RectF damageRect() const { return m_damageRect; } |
86 void setDamageRect(gfx::RectF rect) { m_damageRect = rect; } | 88 void setDamageRect(gfx::RectF rect) { m_damageRect = rect; } |
87 | 89 |
88 const WebKit::WebFilterOperations& filters() const { return m_filters; } | 90 const WebKit::WebFilterOperations& filters() const { return m_filters; } |
89 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } | 91 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } |
90 | 92 |
91 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } | 93 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } |
92 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } | 94 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } |
93 | 95 |
| 96 SkImageFilter* filter() const { return m_filter; } |
| 97 void setFilter(SkImageFilter* filter); |
| 98 |
94 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 99 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
95 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 100 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
96 | 101 |
97 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } | 102 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } |
98 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } | 103 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } |
99 protected: | 104 protected: |
100 RenderPass(Id, gfx::Rect outputRect, const WebKit::WebTransformationMatrix&
transformToRootTarget); | 105 RenderPass(Id, gfx::Rect outputRect, const WebKit::WebTransformationMatrix&
transformToRootTarget); |
101 | 106 |
102 Id m_id; | 107 Id m_id; |
103 QuadList m_quadList; | 108 QuadList m_quadList; |
104 SharedQuadStateList m_sharedQuadStateList; | 109 SharedQuadStateList m_sharedQuadStateList; |
105 WebKit::WebTransformationMatrix m_transformToRootTarget; | 110 WebKit::WebTransformationMatrix m_transformToRootTarget; |
106 gfx::Rect m_outputRect; | 111 gfx::Rect m_outputRect; |
107 gfx::RectF m_damageRect; | 112 gfx::RectF m_damageRect; |
108 bool m_hasTransparentBackground; | 113 bool m_hasTransparentBackground; |
109 bool m_hasOcclusionFromOutsideTargetSurface; | 114 bool m_hasOcclusionFromOutsideTargetSurface; |
110 WebKit::WebFilterOperations m_filters; | 115 WebKit::WebFilterOperations m_filters; |
111 WebKit::WebFilterOperations m_backgroundFilters; | 116 WebKit::WebFilterOperations m_backgroundFilters; |
| 117 SkImageFilter* m_filter; |
112 | 118 |
113 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 119 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
114 }; | 120 }; |
115 | 121 |
116 } // namespace cc | 122 } // namespace cc |
117 | 123 |
118 namespace BASE_HASH_NAMESPACE { | 124 namespace BASE_HASH_NAMESPACE { |
119 #if defined(COMPILER_MSVC) | 125 #if defined(COMPILER_MSVC) |
120 template<> | 126 template<> |
121 inline size_t hash_value<cc::RenderPass::Id>(const cc::RenderPass::Id& key) { | 127 inline size_t hash_value<cc::RenderPass::Id>(const cc::RenderPass::Id& key) { |
(...skipping 10 matching lines...) Expand all Loading... |
132 #error define a hash function for your compiler | 138 #error define a hash function for your compiler |
133 #endif // COMPILER | 139 #endif // COMPILER |
134 } | 140 } |
135 | 141 |
136 namespace cc { | 142 namespace cc { |
137 typedef std::vector<RenderPass*> RenderPassList; | 143 typedef std::vector<RenderPass*> RenderPassList; |
138 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap; | 144 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap; |
139 } // namespace cc | 145 } // namespace cc |
140 | 146 |
141 #endif | 147 #endif |
OLD | NEW |