 Chromium Code Reviews
 Chromium Code Reviews Issue 11175009:
  Implement SkImageFilter support in the compositor.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 11175009:
  Implement SkImageFilter support in the compositor.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 CCLayerImpl; | 25 class CCLayerImpl; | 
| 24 template<typename LayerType, typename SurfaceType> | 26 template<typename LayerType, typename SurfaceType> | 
| 25 class CCOcclusionTrackerBase; | 27 class CCOcclusionTrackerBase; | 
| 26 class CCRenderSurface; | 28 class CCRenderSurface; | 
| 27 | 29 | 
| 28 struct CCAppendQuadsData; | 30 struct CCAppendQuadsData; | 
| 29 | 31 | 
| 30 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI mpl; | 32 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI mpl; | 
| (...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 CCRenderPass(Id, gfx::Rect outputRect, const WebKit::WebTransformationMatrix & transformToRootTarget); | 105 CCRenderPass(Id, gfx::Rect outputRect, const WebKit::WebTransformationMatrix & transformToRootTarget); | 
| 101 | 106 | 
| 102 Id m_id; | 107 Id m_id; | 
| 103 CCQuadList m_quadList; | 108 CCQuadList m_quadList; | 
| 104 CCSharedQuadStateList m_sharedQuadStateList; | 109 CCSharedQuadStateList 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; | |
| 
danakj
2012/10/22 18:00:43
This data type is passed over IPC, we can't add po
 
Stephen White
2012/10/22 18:51:00
I understand that this is only a problem for the u
 
danakj
2012/10/22 18:56:02
Ok. We can serialize this as a 0 until then.
 | |
| 112 | 118 | 
| 113 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); | 119 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); | 
| 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::CCRenderPass::Id>(const cc::CCRenderPass::Id& key) { | 127 inline size_t hash_value<cc::CCRenderPass::Id>(const cc::CCRenderPass::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<CCRenderPass*> CCRenderPassList; | 143 typedef std::vector<CCRenderPass*> CCRenderPassList; | 
| 138 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; | 144 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; | 
| 139 } // namespace cc | 145 } // namespace cc | 
| 140 | 146 | 
| 141 #endif | 147 #endif | 
| OLD | NEW |