Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "cc/layers/draw_properties.h" | 21 #include "cc/layers/draw_properties.h" |
| 22 #include "cc/layers/layer_lists.h" | 22 #include "cc/layers/layer_lists.h" |
| 23 #include "cc/layers/layer_position_constraint.h" | 23 #include "cc/layers/layer_position_constraint.h" |
| 24 #include "cc/layers/paint_properties.h" | 24 #include "cc/layers/paint_properties.h" |
| 25 #include "cc/layers/render_surface.h" | 25 #include "cc/layers/render_surface.h" |
| 26 #include "cc/output/filter_operations.h" | 26 #include "cc/output/filter_operations.h" |
| 27 #include "cc/trees/occlusion_tracker.h" | 27 #include "cc/trees/occlusion_tracker.h" |
| 28 #include "skia/ext/refptr.h" | 28 #include "skia/ext/refptr.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "third_party/skia/include/core/SkImageFilter.h" | 30 #include "third_party/skia/include/core/SkImageFilter.h" |
| 31 #include "third_party/skia/include/core/SkPicture.h" | 31 #include "third_party/skia/include/core/SkPicture.h" |
|
danakj
2013/11/13 21:02:03
Can we include SkXfermode.h in this file since we'
rosca
2013/11/14 21:56:34
Done.
| |
| 32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 33 #include "ui/gfx/rect_f.h" | 33 #include "ui/gfx/rect_f.h" |
| 34 #include "ui/gfx/transform.h" | 34 #include "ui/gfx/transform.h" |
| 35 | 35 |
| 36 namespace gfx { | 36 namespace gfx { |
| 37 class BoxF; | 37 class BoxF; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace cc { | 40 namespace cc { |
| 41 | 41 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 const Layer* mask_layer() const { return mask_layer_.get(); } | 119 const Layer* mask_layer() const { return mask_layer_.get(); } |
| 120 | 120 |
| 121 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); | 121 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); |
| 122 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } | 122 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } |
| 123 | 123 |
| 124 void SetOpacity(float opacity); | 124 void SetOpacity(float opacity); |
| 125 float opacity() const { return opacity_; } | 125 float opacity() const { return opacity_; } |
| 126 bool OpacityIsAnimating() const; | 126 bool OpacityIsAnimating() const; |
| 127 virtual bool OpacityCanAnimateOnImplThread() const; | 127 virtual bool OpacityCanAnimateOnImplThread() const; |
| 128 | 128 |
| 129 void SetBlendMode(SkXfermode::Mode blend_mode); | |
| 130 SkXfermode::Mode blend_mode() const { return blend_mode_; } | |
| 131 | |
| 132 bool uses_default_blend_mode() const { | |
| 133 return blend_mode_ == SkXfermode::kSrcOver_Mode; | |
| 134 } | |
| 135 | |
| 136 void SetIsRootForIsolatedGroup(bool root); | |
|
danakj
2013/11/13 21:02:03
Can you put a comment explaining what this means?
rosca
2013/11/14 21:56:34
Done.
| |
| 137 bool is_root_for_isolated_group() const { | |
| 138 return is_root_for_isolated_group_; | |
| 139 } | |
| 140 | |
| 129 void SetFilters(const FilterOperations& filters); | 141 void SetFilters(const FilterOperations& filters); |
| 130 const FilterOperations& filters() const { return filters_; } | 142 const FilterOperations& filters() const { return filters_; } |
| 131 bool FilterIsAnimating() const; | 143 bool FilterIsAnimating() const; |
| 132 | 144 |
| 133 // Background filters are filters applied to what is behind this layer, when | 145 // Background filters are filters applied to what is behind this layer, when |
| 134 // they are viewed through non-opaque regions in this layer. They are used | 146 // they are viewed through non-opaque regions in this layer. They are used |
| 135 // through the WebLayer interface, and are not exposed to HTML. | 147 // through the WebLayer interface, and are not exposed to HTML. |
| 136 void SetBackgroundFilters(const FilterOperations& filters); | 148 void SetBackgroundFilters(const FilterOperations& filters); |
| 137 const FilterOperations& background_filters() const { | 149 const FilterOperations& background_filters() const { |
| 138 return background_filters_; | 150 return background_filters_; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 void SetNeedsCommit(); | 464 void SetNeedsCommit(); |
| 453 // Called when there's been a change in layer structure. Implies both | 465 // Called when there's been a change in layer structure. Implies both |
| 454 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. | 466 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. |
| 455 void SetNeedsFullTreeSync(); | 467 void SetNeedsFullTreeSync(); |
| 456 | 468 |
| 457 // Called when the next commit should wait until the pending tree is activated | 469 // Called when the next commit should wait until the pending tree is activated |
| 458 // before finishing the commit and unblocking the main thread. Used to ensure | 470 // before finishing the commit and unblocking the main thread. Used to ensure |
| 459 // unused resources on the impl thread are returned before commit completes. | 471 // unused resources on the impl thread are returned before commit completes. |
| 460 void SetNextCommitWaitsForActivation(); | 472 void SetNextCommitWaitsForActivation(); |
| 461 | 473 |
| 474 // Called when the blend mode or filters have been changed | |
|
danakj
2013/11/13 21:02:03
period at the end of sentences
rosca
2013/11/14 21:56:34
Done.
| |
| 475 void SetNeedsFilterContextIfNeeded(); | |
| 476 | |
| 462 void SetNeedsPushProperties(); | 477 void SetNeedsPushProperties(); |
| 463 void AddDependentNeedsPushProperties(); | 478 void AddDependentNeedsPushProperties(); |
| 464 void RemoveDependentNeedsPushProperties(); | 479 void RemoveDependentNeedsPushProperties(); |
| 465 bool parent_should_know_need_push_properties() const { | 480 bool parent_should_know_need_push_properties() const { |
| 466 return needs_push_properties() || descendant_needs_push_properties(); | 481 return needs_push_properties() || descendant_needs_push_properties(); |
| 467 } | 482 } |
| 468 | 483 |
| 469 bool IsPropertyChangeAllowed() const; | 484 bool IsPropertyChangeAllowed() const; |
| 470 | 485 |
| 471 // If this layer has a scroll parent, it removes |this| from its list of | 486 // If this layer has a scroll parent, it removes |this| from its list of |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 bool have_wheel_event_handlers_; | 559 bool have_wheel_event_handlers_; |
| 545 bool user_scrollable_horizontal_; | 560 bool user_scrollable_horizontal_; |
| 546 bool user_scrollable_vertical_; | 561 bool user_scrollable_vertical_; |
| 547 Region non_fast_scrollable_region_; | 562 Region non_fast_scrollable_region_; |
| 548 Region touch_event_handler_region_; | 563 Region touch_event_handler_region_; |
| 549 gfx::PointF position_; | 564 gfx::PointF position_; |
| 550 gfx::PointF anchor_point_; | 565 gfx::PointF anchor_point_; |
| 551 SkColor background_color_; | 566 SkColor background_color_; |
| 552 CompositingReasons compositing_reasons_; | 567 CompositingReasons compositing_reasons_; |
| 553 float opacity_; | 568 float opacity_; |
| 569 SkXfermode::Mode blend_mode_; | |
| 570 bool is_root_for_isolated_group_; | |
| 554 FilterOperations filters_; | 571 FilterOperations filters_; |
| 555 FilterOperations background_filters_; | 572 FilterOperations background_filters_; |
| 556 float anchor_point_z_; | 573 float anchor_point_z_; |
| 557 bool is_container_for_fixed_position_layers_; | 574 bool is_container_for_fixed_position_layers_; |
| 558 LayerPositionConstraint position_constraint_; | 575 LayerPositionConstraint position_constraint_; |
| 559 bool is_drawable_; | 576 bool is_drawable_; |
| 560 bool hide_layer_and_subtree_; | 577 bool hide_layer_and_subtree_; |
| 561 bool masks_to_bounds_; | 578 bool masks_to_bounds_; |
| 562 bool contents_opaque_; | 579 bool contents_opaque_; |
| 563 bool double_sided_; | 580 bool double_sided_; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 589 DrawProperties<Layer> draw_properties_; | 606 DrawProperties<Layer> draw_properties_; |
| 590 | 607 |
| 591 PaintProperties paint_properties_; | 608 PaintProperties paint_properties_; |
| 592 | 609 |
| 593 DISALLOW_COPY_AND_ASSIGN(Layer); | 610 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 594 }; | 611 }; |
| 595 | 612 |
| 596 } // namespace cc | 613 } // namespace cc |
| 597 | 614 |
| 598 #endif // CC_LAYERS_LAYER_H_ | 615 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |