OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_LAYERS_BACKGROUND_FILTER_LAYER_H_ |
| 6 #define CC_LAYERS_BACKGROUND_FILTER_LAYER_H_ |
| 7 |
| 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/layers/layer.h" |
| 10 |
| 11 class FilterOperations; |
| 12 |
| 13 namespace cc { |
| 14 |
| 15 // A Layer that applies a filter effect to the background. |
| 16 // The filter is specified by using SetBackgroundFilters() on the base class. |
| 17 class CC_EXPORT BackgroundFilterLayer : public Layer { |
| 18 public: |
| 19 static scoped_refptr<BackgroundFilterLayer> Create(); |
| 20 |
| 21 virtual scoped_ptr<LayerImpl> CreateLayerImpl( |
| 22 LayerTreeImpl* tree_impl) OVERRIDE; |
| 23 |
| 24 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 25 |
| 26 void SetBackgroundFilters(const FilterOperations& filters); |
| 27 |
| 28 void ApplyFilterAtRect(gfx::Rect src_filter_rect); |
| 29 |
| 30 void DrawFilteredBackgroundAtRect(gfx::Rect draw_filter_rect); |
| 31 |
| 32 protected: |
| 33 BackgroundFilterLayer(); |
| 34 |
| 35 private: |
| 36 virtual ~BackgroundFilterLayer(); |
| 37 gfx::Rect src_filter_rect_; |
| 38 gfx::Rect draw_filter_rect_; |
| 39 FilterOperations filter_operations_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(BackgroundFilterLayer); |
| 42 }; |
| 43 |
| 44 } // namespace cc |
| 45 #endif // CC_LAYERS_BACKGROUND_FILTER_LAYER_H_ |
OLD | NEW |