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

Unified Diff: cc/layers/layer.cc

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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 15de22340069d2ca2622db4f13b00f81338ade75..4a61721e14fe24af250980f7d90f8ea5092b3b18 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -45,6 +45,8 @@ Layer::Layer()
background_color_(0),
compositing_reasons_(kCompositingReasonUnknown),
opacity_(1.f),
+ blend_mode_(SkXfermode::kSrcOver_Mode),
+ is_root_for_isolated_group_(false),
anchor_point_z_(0.f),
is_container_for_fixed_position_layers_(false),
is_drawable_(false),
@@ -123,7 +125,8 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) {
if (host && layer_animation_controller_->has_any_animation())
host->SetNeedsCommit();
- if (host && (!filters_.IsEmpty() || !background_filters_.IsEmpty()))
+ if (host && (!filters_.IsEmpty() || !background_filters_.IsEmpty() ||
enne (OOO) 2013/11/01 18:49:02 Can you combine all these conditions in a single "
rosca 2013/11/04 17:14:34 Done.
+ !uses_default_blend_mode()))
layer_tree_host_->set_needs_filter_context();
}
@@ -503,6 +506,22 @@ bool Layer::OpacityCanAnimateOnImplThread() const {
return false;
}
+void Layer::SetBlendMode(SkXfermode::Mode blend_mode) {
+ if (blend_mode_ == blend_mode)
+ return;
+ blend_mode_ = blend_mode;
+ SetNeedsCommit();
+ if (!uses_default_blend_mode() && layer_tree_host_)
+ layer_tree_host_->set_needs_filter_context();
+}
+
+void Layer::SetIsRootForIsolatedGroup(bool root) {
+ if (is_root_for_isolated_group_ == root)
+ return;
+ is_root_for_isolated_group_ = root;
+ SetNeedsCommit();
+}
+
void Layer::SetContentsOpaque(bool opaque) {
DCHECK(IsPropertyChangeAllowed());
if (contents_opaque_ == opaque)
@@ -820,6 +839,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating())
layer->SetOpacity(opacity_);
DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly()));
+ layer->SetBlendMode(blend_mode_);
+ layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_);
layer->SetPosition(position_);
layer->SetIsContainerForFixedPositionLayers(
IsContainerForFixedPositionLayers());
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698