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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 if (!m_scrollbarAnimationController) | 628 if (!m_scrollbarAnimationController) |
620 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); | 629 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); |
621 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 630 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
622 m_scrollbarAnimationController->updateScrollOffset(this); | 631 m_scrollbarAnimationController->updateScrollOffset(this); |
623 } | 632 } |
624 | 633 |
625 } | 634 } |
626 | 635 |
627 | 636 |
628 #endif // USE(ACCELERATED_COMPOSITING) | 637 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |