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

Unified Diff: cc/layer.cc

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 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/layer.h ('k') | cc/layer_impl.h » ('j') | cc/skia_refptr.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index c7b7ebc503b02e3e7190777985bf67d880a685e7..c794d320a4877c41116775073dc100861d8c1f5e 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -41,7 +41,6 @@ Layer::Layer()
, m_anchorPoint(0.5, 0.5)
, m_backgroundColor(0)
, m_opacity(1.0)
- , m_filter(0)
, m_anchorPointZ(0)
, m_isContainerForFixedPositionLayers(false)
, m_fixedToContainerLayer(false)
@@ -81,8 +80,6 @@ Layer::~Layer()
// Remove the parent reference from all children.
removeAllChildren();
-
- SkSafeUnref(m_filter);
}
void Layer::setUseLCDText(bool useLCDText)
@@ -328,12 +325,12 @@ void Layer::setFilters(const WebKit::WebFilterOperations& filters)
LayerTreeHost::setNeedsFilterContext(true);
}
-void Layer::setFilter(SkImageFilter* filter)
+void Layer::setFilter(const SkiaRefPtr<SkImageFilter>& filter)
{
- if (m_filter == filter)
+ if (m_filter.get() == filter.get())
return;
DCHECK(m_filters.isEmpty());
- SkRefCnt_SafeAssign(m_filter, filter);
+ m_filter = filter;
setNeedsCommit();
if (filter)
LayerTreeHost::setNeedsFilterContext(true);
« no previous file with comments | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | cc/skia_refptr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698