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

Unified Diff: cc/layer_impl.cc

Issue 11175009: Implement SkImageFilter support in the compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated to ToT (past the Great Renaming) Created 8 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
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 7ce15266901a5394d276eb156246ddb806091022..12d514c20714e296c46500acc2cf0ae46949584b 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -15,6 +15,7 @@
#include "cc/quad_sink.h"
#include "cc/scrollbar_animation_controller.h"
#include "cc/settings.h"
+#include "third_party/skia/include/core/SkImageFilter.h"
using WebKit::WebTransformationMatrix;
@@ -52,6 +53,7 @@ LayerImpl::LayerImpl(int id)
, m_drawOpacityIsAnimating(false)
, m_debugBorderColor(0)
, m_debugBorderWidth(0)
+ , m_filter(0)
, m_drawTransformIsAnimating(false)
, m_screenSpaceTransformIsAnimating(false)
#ifndef NDEBUG
@@ -69,6 +71,7 @@ LayerImpl::~LayerImpl()
#ifndef NDEBUG
DCHECK(!m_betweenWillDrawAndDidDraw);
#endif
+ SkSafeUnref(m_filter);
}
void LayerImpl::addChild(scoped_ptr<LayerImpl> child)
@@ -473,6 +476,7 @@ void LayerImpl::setBackgroundColor(SkColor backgroundColor)
void LayerImpl::setFilters(const WebKit::WebFilterOperations& filters)
{
+ DCHECK(!m_filter);
if (m_filters == filters)
return;
@@ -489,6 +493,16 @@ void LayerImpl::setBackgroundFilters(const WebKit::WebFilterOperations& backgrou
m_layerPropertyChanged = true;
}
+void LayerImpl::setFilter(SkImageFilter* filter)
+{
+ DCHECK(m_filters.isEmpty());
+ if (m_filter == filter)
+ return;
+
+ SkRefCnt_SafeAssign(m_filter, filter);
+ noteLayerPropertyChangedForSubtree();
+}
+
void LayerImpl::setMasksToBounds(bool masksToBounds)
{
if (m_masksToBounds == masksToBounds)
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698