| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "ScrollbarLayerChromium.h" | 7 #include "ScrollbarLayerChromium.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "CCLayerTreeHost.h" | 10 #include "CCLayerTreeHost.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 WebKit::WebScrollbar* m_scrollbar; | 170 WebKit::WebScrollbar* m_scrollbar; |
| 171 WebKit::WebScrollbarThemePainter m_painter; | 171 WebKit::WebScrollbarThemePainter m_painter; |
| 172 WebKit::WebScrollbarThemeGeometry* m_geometry; | 172 WebKit::WebScrollbarThemeGeometry* m_geometry; |
| 173 | 173 |
| 174 DISALLOW_COPY_AND_ASSIGN(ScrollbarThumbPainter); | 174 DISALLOW_COPY_AND_ASSIGN(ScrollbarThumbPainter); |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 void ScrollbarLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) | 177 void ScrollbarLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) |
| 178 { | 178 { |
| 179 if (!host || host != layerTreeHost()) { | 179 if (!host || host != layerTreeHost()) { |
| 180 m_backTrackUpdater.clear(); | 180 m_backTrackUpdater = NULL; |
| 181 m_backTrack.clear(); | 181 m_backTrack.reset(); |
| 182 m_thumbUpdater.clear(); | 182 m_thumbUpdater = NULL; |
| 183 m_thumb.clear(); | 183 m_thumb.reset(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 LayerChromium::setLayerTreeHost(host); | 186 LayerChromium::setLayerTreeHost(host); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void ScrollbarLayerChromium::createTextureUpdaterIfNeeded() | 189 void ScrollbarLayerChromium::createTextureUpdaterIfNeeded() |
| 190 { | 190 { |
| 191 m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; | 191 m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; |
| 192 | 192 |
| 193 if (!m_backTrackUpdater) | 193 if (!m_backTrackUpdater) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); | 275 updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, que
ue, stats); |
| 276 | 276 |
| 277 // Consider the thumb to be at the origin when painting. | 277 // Consider the thumb to be at the origin when painting. |
| 278 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 278 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
| 279 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); | 279 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); |
| 280 if (!originThumbRect.isEmpty()) | 280 if (!originThumbRect.isEmpty()) |
| 281 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 281 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } | 284 } |
| OLD | NEW |