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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 // We should always have enough memory for UI. | 262 // We should always have enough memory for UI. |
263 DCHECK(resource->texture()->canAcquireBackingTexture()); | 263 DCHECK(resource->texture()->canAcquireBackingTexture()); |
264 if (!resource->texture()->canAcquireBackingTexture()) | 264 if (!resource->texture()->canAcquireBackingTexture()) |
265 return; | 265 return; |
266 | 266 |
267 // Paint and upload the entire part. | 267 // Paint and upload the entire part. |
268 gfx::Rect paintedOpaqueRect; | 268 gfx::Rect paintedOpaqueRect; |
269 painter->prepareToUpdate(rect, rect.size(), contentsScaleX(), contentsScaleY
(), paintedOpaqueRect, stats); | 269 painter->prepareToUpdate(rect, rect.size(), contentsScaleX(), contentsScaleY
(), paintedOpaqueRect, stats); |
270 if (!painter->pixelsDidChange() && resource->texture()->haveBackingTexture()
) { | 270 if (!painter->pixelsDidChange() && resource->texture()->haveBackingTexture()
) { |
271 TRACE_EVENT_INSTANT0("cc","ScrollbarLayer::updatePart no texture upload
needed"); | 271 TRACE_EVENT_INSTANT0("cc", "ScrollbarLayer::updatePart no texture upload
needed", |
| 272 TRACE_EVENT_SCOPE_THREAD); |
272 return; | 273 return; |
273 } | 274 } |
274 | 275 |
275 bool partialUpdatesAllowed = layerTreeHost()->settings().maxPartialTextureUp
dates > 0; | 276 bool partialUpdatesAllowed = layerTreeHost()->settings().maxPartialTextureUp
dates > 0; |
276 if (!partialUpdatesAllowed) | 277 if (!partialUpdatesAllowed) |
277 resource->texture()->returnBackingTexture(); | 278 resource->texture()->returnBackingTexture(); |
278 | 279 |
279 gfx::Vector2d destOffset(0, 0); | 280 gfx::Vector2d destOffset(0, 0); |
280 resource->update(queue, rect, destOffset, partialUpdatesAllowed, stats); | 281 resource->update(queue, rect, destOffset, partialUpdatesAllowed, stats); |
281 } | 282 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 335 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
335 m_thumbSize = thumbRect.size(); | 336 m_thumbSize = thumbRect.size(); |
336 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); | 337 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); |
337 if (!originThumbRect.IsEmpty()) | 338 if (!originThumbRect.IsEmpty()) |
338 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 339 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
339 | 340 |
340 m_dirtyRect = gfx::RectF(); | 341 m_dirtyRect = gfx::RectF(); |
341 } | 342 } |
342 | 343 |
343 } // namespace cc | 344 } // namespace cc |
OLD | NEW |