Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: cc/layers/layer.h

Issue 23455060: mix-blend-mode implementation for accelerated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding compositor pixel tests, clang-format Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 const Layer* mask_layer() const { return mask_layer_.get(); } 115 const Layer* mask_layer() const { return mask_layer_.get(); }
116 116
117 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); 117 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect);
118 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } 118 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); }
119 119
120 void SetOpacity(float opacity); 120 void SetOpacity(float opacity);
121 float opacity() const { return opacity_; } 121 float opacity() const { return opacity_; }
122 bool OpacityIsAnimating() const; 122 bool OpacityIsAnimating() const;
123 virtual bool OpacityCanAnimateOnImplThread() const; 123 virtual bool OpacityCanAnimateOnImplThread() const;
124 124
125 void SetBlendMode(SkXfermode::Mode blend_mode);
126 SkXfermode::Mode blend_mode() const { return blend_mode_; }
127
128 bool uses_default_blend_mode() const {
129 return blend_mode_ == SkXfermode::kSrcOver_Mode;
130 }
131
132 void SetIsRootForIsolatedGroup(bool root);
133 bool is_root_for_isolated_group() const {
134 return is_root_for_isolated_group_;
135 }
136
125 void SetFilters(const FilterOperations& filters); 137 void SetFilters(const FilterOperations& filters);
126 const FilterOperations& filters() const { return filters_; } 138 const FilterOperations& filters() const { return filters_; }
127 bool FilterIsAnimating() const; 139 bool FilterIsAnimating() const;
128 140
129 // Background filters are filters applied to what is behind this layer, when 141 // Background filters are filters applied to what is behind this layer, when
130 // they are viewed through non-opaque regions in this layer. They are used 142 // they are viewed through non-opaque regions in this layer. They are used
131 // through the WebLayer interface, and are not exposed to HTML. 143 // through the WebLayer interface, and are not exposed to HTML.
132 void SetBackgroundFilters(const FilterOperations& filters); 144 void SetBackgroundFilters(const FilterOperations& filters);
133 const FilterOperations& background_filters() const { 145 const FilterOperations& background_filters() const {
134 return background_filters_; 146 return background_filters_;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 bool scrollable_; 549 bool scrollable_;
538 bool should_scroll_on_main_thread_; 550 bool should_scroll_on_main_thread_;
539 bool have_wheel_event_handlers_; 551 bool have_wheel_event_handlers_;
540 Region non_fast_scrollable_region_; 552 Region non_fast_scrollable_region_;
541 Region touch_event_handler_region_; 553 Region touch_event_handler_region_;
542 gfx::PointF position_; 554 gfx::PointF position_;
543 gfx::PointF anchor_point_; 555 gfx::PointF anchor_point_;
544 SkColor background_color_; 556 SkColor background_color_;
545 CompositingReasons compositing_reasons_; 557 CompositingReasons compositing_reasons_;
546 float opacity_; 558 float opacity_;
559 SkXfermode::Mode blend_mode_;
560 bool is_root_for_isolated_group_;
547 FilterOperations filters_; 561 FilterOperations filters_;
548 FilterOperations background_filters_; 562 FilterOperations background_filters_;
549 float anchor_point_z_; 563 float anchor_point_z_;
550 bool is_container_for_fixed_position_layers_; 564 bool is_container_for_fixed_position_layers_;
551 LayerPositionConstraint position_constraint_; 565 LayerPositionConstraint position_constraint_;
552 bool is_drawable_; 566 bool is_drawable_;
553 bool hide_layer_and_subtree_; 567 bool hide_layer_and_subtree_;
554 bool masks_to_bounds_; 568 bool masks_to_bounds_;
555 bool contents_opaque_; 569 bool contents_opaque_;
556 bool double_sided_; 570 bool double_sided_;
(...skipping 25 matching lines...) Expand all
582 DrawProperties<Layer, RenderSurface> draw_properties_; 596 DrawProperties<Layer, RenderSurface> draw_properties_;
583 597
584 PaintProperties paint_properties_; 598 PaintProperties paint_properties_;
585 599
586 DISALLOW_COPY_AND_ASSIGN(Layer); 600 DISALLOW_COPY_AND_ASSIGN(Layer);
587 }; 601 };
588 602
589 } // namespace cc 603 } // namespace cc
590 604
591 #endif // CC_LAYERS_LAYER_H_ 605 #endif // CC_LAYERS_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698