OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 if (!scrollable()) { | 204 if (!scrollable()) { |
205 TRACE_EVENT0("cc", "CCLayerImpl::tryScroll: Ignored not scrollable"); | 205 TRACE_EVENT0("cc", "CCLayerImpl::tryScroll: Ignored not scrollable"); |
206 return CCInputHandlerClient::ScrollIgnored; | 206 return CCInputHandlerClient::ScrollIgnored; |
207 } | 207 } |
208 | 208 |
209 return CCInputHandlerClient::ScrollStarted; | 209 return CCInputHandlerClient::ScrollStarted; |
210 } | 210 } |
211 | 211 |
| 212 IntRect CCLayerImpl::layerRectToContentRect(const WebKit::WebRect& layerRect) |
| 213 { |
| 214 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi
dth(); |
| 215 float heightScale = static_cast<float>(contentBounds().height()) / bounds().
height(); |
| 216 FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.h
eight); |
| 217 contentRect.scale(widthScale, heightScale); |
| 218 return enclosingIntRect(contentRect); |
| 219 } |
| 220 |
212 std::string CCLayerImpl::indentString(int indent) | 221 std::string CCLayerImpl::indentString(int indent) |
213 { | 222 { |
214 std::string str; | 223 std::string str; |
215 for (int i = 0; i != indent; ++i) | 224 for (int i = 0; i != indent; ++i) |
216 str.append(" "); | 225 str.append(" "); |
217 return str; | 226 return str; |
218 } | 227 } |
219 | 228 |
220 void CCLayerImpl::dumpLayerProperties(std::string* str, int indent) const | 229 void CCLayerImpl::dumpLayerProperties(std::string* str, int indent) const |
221 { | 230 { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 if (!m_scrollbarAnimationController) | 653 if (!m_scrollbarAnimationController) |
645 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); | 654 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); |
646 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 655 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
647 m_scrollbarAnimationController->updateScrollOffset(this); | 656 m_scrollbarAnimationController->updateScrollOffset(this); |
648 } | 657 } |
649 | 658 |
650 } | 659 } |
651 | 660 |
652 | 661 |
653 #endif // USE(ACCELERATED_COMPOSITING) | 662 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |