| 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/layer_painter.h" | 9 #include "cc/layer_painter.h" |
| 10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 m_foreTrack->texture()->setDimensions(contentBounds(), m_textureFormat); | 293 m_foreTrack->texture()->setDimensions(contentBounds(), m_textureFormat); |
| 294 m_foreTrack->texture()->setRequestPriority(PriorityCalculator::uiPriorit
y(drawsToRoot)); | 294 m_foreTrack->texture()->setRequestPriority(PriorityCalculator::uiPriorit
y(drawsToRoot)); |
| 295 } | 295 } |
| 296 if (m_thumb) { | 296 if (m_thumb) { |
| 297 gfx::Size thumbSize = scrollbarLayerRectToContentRect(m_geometry->thumbR
ect(m_scrollbar.get())).size(); | 297 gfx::Size thumbSize = scrollbarLayerRectToContentRect(m_geometry->thumbR
ect(m_scrollbar.get())).size(); |
| 298 m_thumb->texture()->setDimensions(thumbSize, m_textureFormat); | 298 m_thumb->texture()->setDimensions(thumbSize, m_textureFormat); |
| 299 m_thumb->texture()->setRequestPriority(PriorityCalculator::uiPriority(dr
awsToRoot)); | 299 m_thumb->texture()->setRequestPriority(PriorityCalculator::uiPriority(dr
awsToRoot)); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*,
RenderingStats& stats) | 303 void ScrollbarLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*
occlusion, RenderingStats& stats) |
| 304 { | 304 { |
| 305 ContentsScalingLayer::update(queue, occlusion, stats); |
| 306 |
| 305 if (contentBounds().IsEmpty()) | 307 if (contentBounds().IsEmpty()) |
| 306 return; | 308 return; |
| 307 | 309 |
| 308 createUpdaterIfNeeded(); | 310 createUpdaterIfNeeded(); |
| 309 | 311 |
| 310 gfx::Rect contentRect = scrollbarLayerRectToContentRect(gfx::Rect(m_scrollba
r->location(), bounds())); | 312 gfx::Rect contentRect = scrollbarLayerRectToContentRect(gfx::Rect(m_scrollba
r->location(), bounds())); |
| 311 updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, queue,
stats); | 313 updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, queue,
stats); |
| 312 if (m_foreTrack && m_foreTrackUpdater) | 314 if (m_foreTrack && m_foreTrackUpdater) |
| 313 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); | 315 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); |
| 314 | 316 |
| 315 // Consider the thumb to be at the origin when painting. | 317 // Consider the thumb to be at the origin when painting. |
| 316 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 318 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
| 317 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(0, 0,
thumbRect.width, thumbRect.height)); | 319 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(0, 0,
thumbRect.width, thumbRect.height)); |
| 318 if (!originThumbRect.IsEmpty()) | 320 if (!originThumbRect.IsEmpty()) |
| 319 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 321 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
| 320 } | 322 } |
| 321 | 323 |
| 322 } // namespace cc | 324 } // namespace cc |
| OLD | NEW |