Chromium Code Reviews| 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 |