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

Unified 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: unittests fixed Created 7 years, 1 month 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
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.h
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index b552a35736cc05c64d8c8dd720597d7b9d1043b5..9af3dea7c7de4f3165334cc6da8e3bfbe36ce105 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -29,6 +29,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
+#include "third_party/skia/include/core/SkXfermode.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/transform.h"
@@ -126,6 +127,22 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
bool OpacityIsAnimating() const;
virtual bool OpacityCanAnimateOnImplThread() const;
+ void SetBlendMode(SkXfermode::Mode blend_mode);
+ SkXfermode::Mode blend_mode() const { return blend_mode_; }
+
+ bool uses_default_blend_mode() const {
+ return blend_mode_ == SkXfermode::kSrcOver_Mode;
+ }
+
+ // A layer is root for an isolated group when it and all its descendants are
+ // drawn over a black and fully transparent background, creating an isolated
+ // group. It should be used along with SetBlendMode(), in order to restrict
+ // layers within the group to blend with layers outside this group.
+ void SetIsRootForIsolatedGroup(bool root);
+ bool is_root_for_isolated_group() const {
+ return is_root_for_isolated_group_;
+ }
+
void SetFilters(const FilterOperations& filters);
const FilterOperations& filters() const { return filters_; }
bool FilterIsAnimating() const;
@@ -459,6 +476,9 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// unused resources on the impl thread are returned before commit completes.
void SetNextCommitWaitsForActivation();
+ // Called when the blend mode or filters have been changed.
+ void SetNeedsFilterContextIfNeeded();
+
void SetNeedsPushProperties();
void AddDependentNeedsPushProperties();
void RemoveDependentNeedsPushProperties();
@@ -552,6 +572,8 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
SkColor background_color_;
CompositingReasons compositing_reasons_;
float opacity_;
+ SkXfermode::Mode blend_mode_;
+ bool is_root_for_isolated_group_;
FilterOperations filters_;
FilterOperations background_filters_;
float anchor_point_z_;
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698