| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 scrollbarGraphicsLayer->setPosition(IntPoint(xPosition, yPosition)); | 306 scrollbarGraphicsLayer->setPosition(IntPoint(xPosition, yPosition)); |
| 307 scrollbarGraphicsLayer->setSize(IntSize(width, height)); | 307 scrollbarGraphicsLayer->setSize(IntSize(width, height)); |
| 308 scrollbarGraphicsLayer->setContentsRect(IntRect(0, 0, width, height)); | 308 scrollbarGraphicsLayer->setContentsRect(IntRect(0, 0, width, height)); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void PinchViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
const | 311 void PinchViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
const |
| 312 { | 312 { |
| 313 TRACE_EVENT0("webkit", "PinchViewport::registerLayersWithTreeView"); | 313 TRACE_EVENT0("webkit", "PinchViewport::registerLayersWithTreeView"); |
| 314 ASSERT(layerTreeView); | 314 ASSERT(layerTreeView); |
| 315 ASSERT(m_frameHost.page().mainFrame()); | 315 ASSERT(m_frameHost.page().mainFrame()); |
| 316 ASSERT(m_frameHost.page().mainFrame()->contentRenderer()); | 316 ASSERT(m_frameHost.page().mainFrame()->isLocalFrame()); |
| 317 ASSERT(m_frameHost.page().deprecatedLocalMainFrame()->contentRenderer()); |
| 317 | 318 |
| 318 RenderLayerCompositor* compositor = m_frameHost.page().mainFrame()->contentR
enderer()->compositor(); | 319 RenderLayerCompositor* compositor = m_frameHost.page().deprecatedLocalMainFr
ame()->contentRenderer()->compositor(); |
| 319 // Get the outer viewport scroll layer. | 320 // Get the outer viewport scroll layer. |
| 320 WebLayer* scrollLayer = compositor->scrollLayer()->platformLayer(); | 321 WebLayer* scrollLayer = compositor->scrollLayer()->platformLayer(); |
| 321 | 322 |
| 322 m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); | 323 m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); |
| 323 m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); | 324 m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); |
| 324 | 325 |
| 325 ASSERT(compositor); | 326 ASSERT(compositor); |
| 326 layerTreeView->registerViewportLayers( | 327 layerTreeView->registerViewportLayers( |
| 327 m_pageScaleLayer->platformLayer(), | 328 m_pageScaleLayer->platformLayer(), |
| 328 m_innerViewportScrollLayer->platformLayer(), | 329 m_innerViewportScrollLayer->platformLayer(), |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 void PinchViewport::notifyAnimationStarted(const GraphicsLayer*, double monotoni
cTime) | 412 void PinchViewport::notifyAnimationStarted(const GraphicsLayer*, double monotoni
cTime) |
| 412 { | 413 { |
| 413 } | 414 } |
| 414 | 415 |
| 415 void PinchViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graphi
csLayerPaintingPhase, const IntRect& inClip) | 416 void PinchViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graphi
csLayerPaintingPhase, const IntRect& inClip) |
| 416 { | 417 { |
| 417 } | 418 } |
| 418 | 419 |
| 419 LocalFrame* PinchViewport::mainFrame() const | 420 LocalFrame* PinchViewport::mainFrame() const |
| 420 { | 421 { |
| 421 return m_frameHost.page().mainFrame(); | 422 return m_frameHost.page().mainFrame() && m_frameHost.page().mainFrame()->isL
ocalFrame() ? m_frameHost.page().deprecatedLocalMainFrame() : 0; |
| 422 } | 423 } |
| 423 | 424 |
| 424 FloatPoint PinchViewport::clampOffsetToBoundaries(const FloatPoint& offset) | 425 FloatPoint PinchViewport::clampOffsetToBoundaries(const FloatPoint& offset) |
| 425 { | 426 { |
| 426 FloatPoint clampedOffset(offset); | 427 FloatPoint clampedOffset(offset); |
| 427 clampedOffset = clampedOffset.shrunkTo(FloatPoint(maximumScrollPosition())); | 428 clampedOffset = clampedOffset.shrunkTo(FloatPoint(maximumScrollPosition())); |
| 428 clampedOffset = clampedOffset.expandedTo(FloatPoint(minimumScrollPosition())
); | 429 clampedOffset = clampedOffset.expandedTo(FloatPoint(minimumScrollPosition())
); |
| 429 return clampedOffset; | 430 return clampedOffset; |
| 430 } | 431 } |
| 431 | 432 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 443 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { | 444 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { |
| 444 name = "Overlay Scrollbar Vertical Layer"; | 445 name = "Overlay Scrollbar Vertical Layer"; |
| 445 } else { | 446 } else { |
| 446 ASSERT_NOT_REACHED(); | 447 ASSERT_NOT_REACHED(); |
| 447 } | 448 } |
| 448 | 449 |
| 449 return name; | 450 return name; |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace WebCore | 453 } // namespace WebCore |
| OLD | NEW |