| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "CCLayerTreeHost.h" | 12 #include "CCLayerTreeHost.h" |
| 13 #include "CCScrollbarLayerImpl.h" | 13 #include "CCScrollbarLayerImpl.h" |
| 14 #include "CCTextureUpdateQueue.h" | 14 #include "CCTextureUpdateQueue.h" |
| 15 #include "LayerPainterChromium.h" | 15 #include "LayerPainterChromium.h" |
| 16 #include "TraceEvent.h" | 16 #include "TraceEvent.h" |
| 17 #include <public/WebRect.h> | 17 #include <public/WebRect.h> |
| 18 | 18 |
| 19 using WebKit::WebRect; | 19 using WebKit::WebRect; |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 | 22 |
| 23 scoped_ptr<CCLayerImpl> ScrollbarLayerChromium::createCCLayerImpl() | 23 PassOwnPtr<CCLayerImpl> ScrollbarLayerChromium::createCCLayerImpl() |
| 24 { | 24 { |
| 25 return CCScrollbarLayerImpl::create(id()).PassAs<CCLayerImpl>(); | 25 return CCScrollbarLayerImpl::create(id()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(PassOwnPtr<
WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassO
wnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId) | 28 scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(PassOwnPtr<
WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassO
wnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId) |
| 29 { | 29 { |
| 30 return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar, painter, geo
metry, scrollLayerId)); | 30 return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar, painter, geo
metry, scrollLayerId)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>
scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrol
lbarThemeGeometry> geometry, int scrollLayerId) | 33 ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>
scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrol
lbarThemeGeometry> geometry, int scrollLayerId) |
| 34 : m_scrollbar(scrollbar) | 34 : m_scrollbar(scrollbar) |
| 35 , m_painter(painter) | 35 , m_painter(painter) |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 // Consider the thumb to be at the origin when painting. | 284 // Consider the thumb to be at the origin when painting. |
| 285 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 285 WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
| 286 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); | 286 IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumb
Rect.width, thumbRect.height)); |
| 287 if (!originThumbRect.isEmpty()) | 287 if (!originThumbRect.isEmpty()) |
| 288 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 288 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } | 291 } |
| 292 #endif // USE(ACCELERATED_COMPOSITING) | 292 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |