| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 CC_LAYERS_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 SkXfermode::Mode blend_mode() const { return inputs_.blend_mode; } | 143 SkXfermode::Mode blend_mode() const { return inputs_.blend_mode; } |
| 144 | 144 |
| 145 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { | 145 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { |
| 146 if (draw_blend_mode_ == blend_mode) | 146 if (draw_blend_mode_ == blend_mode) |
| 147 return; | 147 return; |
| 148 draw_blend_mode_ = blend_mode; | 148 draw_blend_mode_ = blend_mode; |
| 149 SetNeedsPushProperties(); | 149 SetNeedsPushProperties(); |
| 150 } | 150 } |
| 151 SkXfermode::Mode draw_blend_mode() const { return draw_blend_mode_; } | 151 SkXfermode::Mode draw_blend_mode() const { return draw_blend_mode_; } |
| 152 | 152 |
| 153 bool uses_default_blend_mode() const { | |
| 154 return inputs_.blend_mode == SkXfermode::kSrcOver_Mode; | |
| 155 } | |
| 156 | |
| 157 // A layer is root for an isolated group when it and all its descendants are | 153 // A layer is root for an isolated group when it and all its descendants are |
| 158 // drawn over a black and fully transparent background, creating an isolated | 154 // drawn over a black and fully transparent background, creating an isolated |
| 159 // group. It should be used along with SetBlendMode(), in order to restrict | 155 // group. It should be used along with SetBlendMode(), in order to restrict |
| 160 // layers within the group to blend with layers outside this group. | 156 // layers within the group to blend with layers outside this group. |
| 161 void SetIsRootForIsolatedGroup(bool root); | 157 void SetIsRootForIsolatedGroup(bool root); |
| 162 bool is_root_for_isolated_group() const { | 158 bool is_root_for_isolated_group() const { |
| 163 return inputs_.is_root_for_isolated_group; | 159 return inputs_.is_root_for_isolated_group; |
| 164 } | 160 } |
| 165 | 161 |
| 166 void SetFilters(const FilterOperations& filters); | 162 void SetFilters(const FilterOperations& filters); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // These all act like draw properties, so don't need push properties. | 721 // These all act like draw properties, so don't need push properties. |
| 726 gfx::Rect visible_layer_rect_; | 722 gfx::Rect visible_layer_rect_; |
| 727 size_t num_unclipped_descendants_; | 723 size_t num_unclipped_descendants_; |
| 728 | 724 |
| 729 DISALLOW_COPY_AND_ASSIGN(Layer); | 725 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 730 }; | 726 }; |
| 731 | 727 |
| 732 } // namespace cc | 728 } // namespace cc |
| 733 | 729 |
| 734 #endif // CC_LAYERS_LAYER_H_ | 730 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |