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

Unified Diff: cc/scrollbar_layer.cc

Issue 11464041: cc: Don't use partial updates for scrollbars when they are not allowed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « cc/scrollbar_layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer.cc
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc
index 817ead819b532a820254b37fb0400c5cdb6b01fc..f105ca86559fa532517bccd115e2fc642b7c680b 100644
--- a/cc/scrollbar_layer.cc
+++ b/cc/scrollbar_layer.cc
@@ -247,7 +247,7 @@ void ScrollbarLayer::updatePart(CachingBitmapContentLayerUpdater* painter, Layer
// we already have valid texture data.
if (resource->texture()->haveBackingTexture() &&
resource->texture()->size() == rect.size() &&
- m_updateRect.IsEmpty())
+ !isDirty())
return;
// We should always have enough memory for UI.
@@ -263,8 +263,12 @@ void ScrollbarLayer::updatePart(CachingBitmapContentLayerUpdater* painter, Layer
return;
}
+ bool partialUpdatesAllowed = layerTreeHost()->settings().maxPartialTextureUpdates > 0;
+ if (!partialUpdatesAllowed)
+ resource->texture()->returnBackingTexture();
+
gfx::Vector2d destOffset(0, 0);
- resource->update(queue, rect, destOffset, false, stats);
+ resource->update(queue, rect, destOffset, partialUpdatesAllowed, stats);
}
gfx::Rect ScrollbarLayer::scrollbarLayerRectToContentRect(const gfx::Rect& layerRect) const
@@ -302,8 +306,13 @@ void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&)
void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*, RenderingStats& stats)
{
+ m_dirtyRect.Union(m_updateRect);
enne (OOO) 2012/12/17 20:59:02 What does adding m_dirtyRect enable you to do that
danakj 2012/12/17 21:27:06 it lets you return when visibleContentRect() is em
enne (OOO) 2012/12/17 21:36:45 Ah, ok. I see. :)
if (contentBounds().IsEmpty())
return;
+ if (visibleContentRect().IsEmpty())
+ return;
+ if (!isDirty())
+ return;
createUpdaterIfNeeded();
@@ -313,10 +322,12 @@ void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*,
updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, queue, stats);
// Consider the thumb to be at the origin when painting.
- WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get());
- gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(0, 0, thumbRect.width, thumbRect.height));
+ gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get());
+ gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbRect.size()));
if (!originThumbRect.IsEmpty())
updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue, stats);
+
+ m_dirtyRect = gfx::RectF();
}
} // namespace cc
« no previous file with comments | « cc/scrollbar_layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698