OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/scrollbar_layer.h" | 5 #include "cc/scrollbar_layer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/caching_bitmap_content_layer_updater.h" | 9 #include "cc/caching_bitmap_content_layer_updater.h" |
10 #include "cc/layer_painter.h" | 10 #include "cc/layer_painter.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*
occlusion, RenderingStats& stats) | 316 void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*
occlusion, RenderingStats& stats) |
317 { | 317 { |
318 ContentsScalingLayer::update(queue, occlusion, stats); | 318 ContentsScalingLayer::update(queue, occlusion, stats); |
319 | 319 |
320 m_dirtyRect.Union(m_updateRect); | 320 m_dirtyRect.Union(m_updateRect); |
321 if (contentBounds().IsEmpty()) | 321 if (contentBounds().IsEmpty()) |
322 return; | 322 return; |
323 if (visibleContentRect().IsEmpty()) | 323 if (visibleContentRect().IsEmpty()) |
324 return; | 324 return; |
325 if (!isDirty()) | |
326 return; | |
327 | 325 |
328 createUpdaterIfNeeded(); | 326 createUpdaterIfNeeded(); |
329 | 327 |
330 gfx::Rect contentRect = scrollbarLayerRectToContentRect(gfx::Rect(m_scrollba
r->location(), bounds())); | 328 gfx::Rect contentRect = scrollbarLayerRectToContentRect(gfx::Rect(m_scrollba
r->location(), bounds())); |
331 updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, queue,
stats); | 329 updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, queue,
stats); |
332 if (m_foreTrack && m_foreTrackUpdater) | 330 if (m_foreTrack && m_foreTrackUpdater) |
333 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); | 331 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); |
334 | 332 |
335 // Consider the thumb to be at the origin when painting. | 333 // Consider the thumb to be at the origin when painting. |
336 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 334 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
337 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); | 335 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); |
338 if (!originThumbRect.IsEmpty()) | 336 if (!originThumbRect.IsEmpty()) |
339 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 337 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
340 | 338 |
341 m_dirtyRect = gfx::RectF(); | 339 m_dirtyRect = gfx::RectF(); |
342 } | 340 } |
343 | 341 |
344 } // namespace cc | 342 } // namespace cc |
OLD | NEW |