| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 if (!scrollable()) { | 219 if (!scrollable()) { |
| 220 TRACE_EVENT0("cc", "CCLayerImpl::tryScroll: Ignored not scrollable"); | 220 TRACE_EVENT0("cc", "CCLayerImpl::tryScroll: Ignored not scrollable"); |
| 221 return CCInputHandlerClient::ScrollIgnored; | 221 return CCInputHandlerClient::ScrollIgnored; |
| 222 } | 222 } |
| 223 | 223 |
| 224 return CCInputHandlerClient::ScrollStarted; | 224 return CCInputHandlerClient::ScrollStarted; |
| 225 } | 225 } |
| 226 | 226 |
| 227 IntRect CCLayerImpl::layerRectToContentRect(const WebKit::WebRect& layerRect) | |
| 228 { | |
| 229 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi
dth(); | |
| 230 float heightScale = static_cast<float>(contentBounds().height()) / bounds().
height(); | |
| 231 FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.h
eight); | |
| 232 contentRect.scale(widthScale, heightScale); | |
| 233 return enclosingIntRect(contentRect); | |
| 234 } | |
| 235 | |
| 236 std::string CCLayerImpl::indentString(int indent) | 227 std::string CCLayerImpl::indentString(int indent) |
| 237 { | 228 { |
| 238 std::string str; | 229 std::string str; |
| 239 for (int i = 0; i != indent; ++i) | 230 for (int i = 0; i != indent; ++i) |
| 240 str.append(" "); | 231 str.append(" "); |
| 241 return str; | 232 return str; |
| 242 } | 233 } |
| 243 | 234 |
| 244 void CCLayerImpl::dumpLayerProperties(std::string* str, int indent) const | 235 void CCLayerImpl::dumpLayerProperties(std::string* str, int indent) const |
| 245 { | 236 { |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 if (!m_scrollbarAnimationController) | 659 if (!m_scrollbarAnimationController) |
| 669 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); | 660 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); |
| 670 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 661 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 671 m_scrollbarAnimationController->updateScrollOffset(this); | 662 m_scrollbarAnimationController->updateScrollOffset(this); |
| 672 } | 663 } |
| 673 | 664 |
| 674 } | 665 } |
| 675 | 666 |
| 676 | 667 |
| 677 #endif // USE(ACCELERATED_COMPOSITING) | 668 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |