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

Unified Diff: cc/layer.cc

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed build Created 8 years 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/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index f3f9b4d0dab6c04adf7c6b032164eab4eb0c00ce..6113878e31e81f88fb4dada809aa785bbe6c73bd 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -48,7 +48,7 @@ Layer::Layer()
, m_masksToBounds(false)
, m_contentsOpaque(false)
, m_doubleSided(true)
- , m_useLCDText(false)
+ , m_canUseLCDText(false)
, m_preserves3D(false)
, m_useParentBackfaceVisibility(false)
, m_drawCheckerboardForMissingTiles(false)
@@ -76,9 +76,16 @@ Layer::~Layer()
removeAllChildren();
}
-void Layer::setUseLCDText(bool useLCDText)
+void Layer::setCanUseLCDText(bool useLCDText)
{
- m_useLCDText = useLCDText;
+ if (m_canUseLCDText == useLCDText)
+ return;
+
+ if (!canUseLCDTextWillChange())
+ return;
+
+ m_canUseLCDText = useLCDText;
+ canUseLCDTextDidChange();
}
void Layer::setLayerTreeHost(LayerTreeHost* host)
@@ -113,6 +120,11 @@ void Layer::setNeedsFullTreeSync()
m_layerTreeHost->setNeedsFullTreeSync();
}
+bool Layer::canUseLCDTextWillChange()
+{
+ return true;
+}
+
gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const
{
gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), contentsScaleY());
@@ -567,7 +579,7 @@ void Layer::pushPropertiesTo(LayerImpl* layer)
layer->setFilters(filters());
layer->setFilter(filter());
layer->setBackgroundFilters(backgroundFilters());
- layer->setUseLCDText(m_useLCDText);
+ layer->setCanUseLCDText(m_canUseLCDText);
layer->setMasksToBounds(m_masksToBounds);
layer->setScrollable(m_scrollable);
layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread);

Powered by Google App Engine
This is Rietveld 408576698