| 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 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 | 8 |
| 9 #include "ScrollbarLayerChromium.h" | 9 #include "ScrollbarLayerChromium.h" |
| 10 | 10 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // Paint and upload the entire part. | 228 // Paint and upload the entire part. |
| 229 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi
dth(); | 229 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi
dth(); |
| 230 float heightScale = static_cast<float>(contentBounds().height()) / bounds().
height(); | 230 float heightScale = static_cast<float>(contentBounds().height()) / bounds().
height(); |
| 231 IntRect paintedOpaqueRect; | 231 IntRect paintedOpaqueRect; |
| 232 painter->prepareToUpdate(rect, rect.size(), widthScale, heightScale, painted
OpaqueRect, stats); | 232 painter->prepareToUpdate(rect, rect.size(), widthScale, heightScale, painted
OpaqueRect, stats); |
| 233 if (!painter->pixelsDidChange() && texture->texture()->haveBackingTexture())
{ | 233 if (!painter->pixelsDidChange() && texture->texture()->haveBackingTexture())
{ |
| 234 TRACE_EVENT_INSTANT0("cc","ScrollbarLayerChromium::updatePart no texture
upload needed"); | 234 TRACE_EVENT_INSTANT0("cc","ScrollbarLayerChromium::updatePart no texture
upload needed"); |
| 235 return; | 235 return; |
| 236 } | 236 } |
| 237 | 237 |
| 238 texture->prepareRect(rect, stats); | |
| 239 | |
| 240 IntSize destOffset(0, 0); | 238 IntSize destOffset(0, 0); |
| 241 TextureUploader::Parameters upload = { texture, rect, destOffset }; | 239 texture->update(queue, rect, destOffset, false, stats); |
| 242 queue.appendFullUpload(upload); | |
| 243 } | 240 } |
| 244 | 241 |
| 245 | 242 |
| 246 void ScrollbarLayerChromium::setTexturePriorities(const CCPriorityCalculator&) | 243 void ScrollbarLayerChromium::setTexturePriorities(const CCPriorityCalculator&) |
| 247 { | 244 { |
| 248 if (contentBounds().isEmpty()) | 245 if (contentBounds().isEmpty()) |
| 249 return; | 246 return; |
| 250 | 247 |
| 251 createTextureUpdaterIfNeeded(); | 248 createTextureUpdaterIfNeeded(); |
| 252 | 249 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 281 | 278 |
| 282 // Consider the thumb to be at the origin when painting. | 279 // Consider the thumb to be at the origin when painting. |
| 283 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 280 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
| 284 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); | 281 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); |
| 285 if (!originThumbRect.isEmpty()) | 282 if (!originThumbRect.isEmpty()) |
| 286 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 283 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
| 287 } | 284 } |
| 288 | 285 |
| 289 } | 286 } |
| 290 #endif // USE(ACCELERATED_COMPOSITING) | 287 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |