| 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 30 matching lines...) Expand all Loading... |
| 41 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 41 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
| 42 #include "core/loader/FrameLoaderClient.h" | 42 #include "core/loader/FrameLoaderClient.h" |
| 43 #include "core/page/ChromeClient.h" | 43 #include "core/page/ChromeClient.h" |
| 44 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
| 45 #include "core/page/scrolling/ScrollingCoordinator.h" | 45 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 46 #include "platform/TraceEvent.h" | 46 #include "platform/TraceEvent.h" |
| 47 #include "platform/geometry/DoubleRect.h" | 47 #include "platform/geometry/DoubleRect.h" |
| 48 #include "platform/geometry/FloatSize.h" | 48 #include "platform/geometry/FloatSize.h" |
| 49 #include "platform/graphics/GraphicsLayer.h" | 49 #include "platform/graphics/GraphicsLayer.h" |
| 50 #include "platform/graphics/GraphicsLayerFactory.h" | 50 #include "platform/graphics/GraphicsLayerFactory.h" |
| 51 #include "platform/scroll/Scrollbar.h" | |
| 52 #include "platform/scroll/ScrollbarTheme.h" | |
| 53 #include "public/platform/Platform.h" | 51 #include "public/platform/Platform.h" |
| 54 #include "public/platform/WebCompositorSupport.h" | 52 #include "public/platform/WebCompositorSupport.h" |
| 55 #include "public/platform/WebLayer.h" | 53 #include "public/platform/WebLayer.h" |
| 56 #include "public/platform/WebLayerTreeView.h" | 54 #include "public/platform/WebLayerTreeView.h" |
| 57 #include "public/platform/WebScrollbar.h" | |
| 58 #include "public/platform/WebScrollbarLayer.h" | |
| 59 | 55 |
| 60 using blink::WebLayer; | 56 using blink::WebLayer; |
| 61 using blink::WebLayerTreeView; | 57 using blink::WebLayerTreeView; |
| 62 using blink::WebScrollbar; | |
| 63 using blink::WebScrollbarLayer; | |
| 64 using blink::FrameHost; | 58 using blink::FrameHost; |
| 65 using blink::GraphicsLayer; | 59 using blink::GraphicsLayer; |
| 66 using blink::GraphicsLayerFactory; | 60 using blink::GraphicsLayerFactory; |
| 67 | 61 |
| 68 namespace blink { | 62 namespace blink { |
| 69 | 63 |
| 70 VisualViewport::VisualViewport(FrameHost& owner) | 64 VisualViewport::VisualViewport(FrameHost& owner) |
| 71 : m_frameHost(&owner) | 65 : m_frameHost(&owner) |
| 72 , m_scale(1) | 66 , m_scale(1) |
| 73 , m_topControlsAdjustment(0) | 67 , m_topControlsAdjustment(0) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 97 bool autosizerNeedsUpdating = | 91 bool autosizerNeedsUpdating = |
| 98 (size.width() != m_size.width()) | 92 (size.width() != m_size.width()) |
| 99 && mainFrame()->settings() | 93 && mainFrame()->settings() |
| 100 && mainFrame()->settings()->textAutosizingEnabled(); | 94 && mainFrame()->settings()->textAutosizingEnabled(); |
| 101 | 95 |
| 102 TRACE_EVENT2("blink", "VisualViewport::setSize", "width", size.width(), "hei
ght", size.height()); | 96 TRACE_EVENT2("blink", "VisualViewport::setSize", "width", size.width(), "hei
ght", size.height()); |
| 103 m_size = size; | 97 m_size = size; |
| 104 | 98 |
| 105 if (m_innerViewportContainerLayer) { | 99 if (m_innerViewportContainerLayer) { |
| 106 m_innerViewportContainerLayer->setSize(m_size); | 100 m_innerViewportContainerLayer->setSize(m_size); |
| 107 | |
| 108 // Need to re-compute sizes for the overlay scrollbars. | |
| 109 setupScrollbar(WebScrollbar::Horizontal); | |
| 110 setupScrollbar(WebScrollbar::Vertical); | |
| 111 } | 101 } |
| 112 | 102 |
| 113 if (autosizerNeedsUpdating) { | 103 if (autosizerNeedsUpdating) { |
| 114 // This needs to happen after setting the m_size member since it'll be r
ead in the update call. | 104 // This needs to happen after setting the m_size member since it'll be r
ead in the update call. |
| 115 if (TextAutosizer* textAutosizer = mainFrame()->document()->textAutosize
r()) | 105 if (TextAutosizer* textAutosizer = mainFrame()->document()->textAutosize
r()) |
| 116 textAutosizer->updatePageInfoInAllFrames(); | 106 textAutosizer->updatePageInfoInAllFrames(); |
| 117 } | 107 } |
| 118 } | 108 } |
| 119 | 109 |
| 120 void VisualViewport::reset() | 110 void VisualViewport::reset() |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // | 256 // |
| 267 // *rootTransformLayer | 257 // *rootTransformLayer |
| 268 // +- *innerViewportContainerLayer (fixed pos container) | 258 // +- *innerViewportContainerLayer (fixed pos container) |
| 269 // | +- *overscrollElasticityLayer | 259 // | +- *overscrollElasticityLayer |
| 270 // | +- *pageScaleLayer | 260 // | +- *pageScaleLayer |
| 271 // | +- *innerViewportScrollLayer | 261 // | +- *innerViewportScrollLayer |
| 272 // | +-- overflowControlsHostLayer (root layer) | 262 // | +-- overflowControlsHostLayer (root layer) |
| 273 // | +-- outerViewportContainerLayer (fixed pos container) [f
rame container layer in DeprecatedPaintLayerCompositor] | 263 // | +-- outerViewportContainerLayer (fixed pos container) [f
rame container layer in DeprecatedPaintLayerCompositor] |
| 274 // | | +-- outerViewportScrollLayer [frame scroll layer in
DeprecatedPaintLayerCompositor] | 264 // | | +-- outerViewportScrollLayer [frame scroll layer in
DeprecatedPaintLayerCompositor] |
| 275 // | | +-- content layers ... | 265 // | | +-- content layers ... |
| 276 // | +-- horizontal ScrollbarLayer (non-overlay) | 266 // +- horizontalScrollbarLayer |
| 277 // | +-- verticalScrollbarLayer (non-overlay) | 267 // +- verticalScrollbarLayer |
| 278 // | +-- scroll corner (non-overlay) | 268 // +- scroll corner (non-overlay only) |
| 279 // +- *horizontalScrollbarLayer (overlay) | |
| 280 // +- *verticalScrollbarLayer (overlay) | |
| 281 // | 269 // |
| 282 void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, Grap
hicsLayerFactory* graphicsLayerFactory) | 270 void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, Grap
hicsLayerFactory* graphicsLayerFactory) |
| 283 { | 271 { |
| 284 TRACE_EVENT1("blink", "VisualViewport::attachToLayerTree", "currentLayerTree
Root", (bool)currentLayerTreeRoot); | 272 TRACE_EVENT1("blink", "VisualViewport::attachToLayerTree", "currentLayerTree
Root", (bool)currentLayerTreeRoot); |
| 285 if (!currentLayerTreeRoot) { | 273 if (!currentLayerTreeRoot) { |
| 286 if (m_innerViewportScrollLayer) | 274 if (m_innerViewportScrollLayer) |
| 287 m_innerViewportScrollLayer->removeAllChildren(); | 275 m_innerViewportScrollLayer->removeAllChildren(); |
| 288 return; | 276 return; |
| 289 } | 277 } |
| 290 | 278 |
| 291 if (currentLayerTreeRoot->parent() && currentLayerTreeRoot->parent() == m_in
nerViewportScrollLayer) | 279 if (currentLayerTreeRoot->parent() && currentLayerTreeRoot->parent() == m_in
nerViewportScrollLayer) |
| 292 return; | 280 return; |
| 293 | 281 |
| 294 if (!m_innerViewportScrollLayer) { | 282 if (!m_innerViewportScrollLayer) { |
| 295 ASSERT(!m_overlayScrollbarHorizontal | 283 ASSERT(!m_overscrollElasticityLayer |
| 296 && !m_overlayScrollbarVertical | |
| 297 && !m_overscrollElasticityLayer | |
| 298 && !m_pageScaleLayer | 284 && !m_pageScaleLayer |
| 299 && !m_innerViewportContainerLayer); | 285 && !m_innerViewportContainerLayer); |
| 300 | 286 |
| 301 // FIXME: The root transform layer should only be created on demand. | 287 // FIXME: The root transform layer should only be created on demand. |
| 302 m_rootTransformLayer = GraphicsLayer::create(graphicsLayerFactory, this)
; | 288 m_rootTransformLayer = GraphicsLayer::create(graphicsLayerFactory, this)
; |
| 303 m_innerViewportContainerLayer = GraphicsLayer::create(graphicsLayerFacto
ry, this); | 289 m_innerViewportContainerLayer = GraphicsLayer::create(graphicsLayerFacto
ry, this); |
| 304 m_overscrollElasticityLayer = GraphicsLayer::create(graphicsLayerFactory
, this); | 290 m_overscrollElasticityLayer = GraphicsLayer::create(graphicsLayerFactory
, this); |
| 305 m_pageScaleLayer = GraphicsLayer::create(graphicsLayerFactory, this); | 291 m_pageScaleLayer = GraphicsLayer::create(graphicsLayerFactory, this); |
| 306 m_innerViewportScrollLayer = GraphicsLayer::create(graphicsLayerFactory,
this); | 292 m_innerViewportScrollLayer = GraphicsLayer::create(graphicsLayerFactory,
this); |
| 307 m_overlayScrollbarHorizontal = GraphicsLayer::create(graphicsLayerFactor
y, this); | |
| 308 m_overlayScrollbarVertical = GraphicsLayer::create(graphicsLayerFactory,
this); | |
| 309 | 293 |
| 310 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina
tor(); | 294 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina
tor(); |
| 311 ASSERT(coordinator); | 295 ASSERT(coordinator); |
| 312 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); | 296 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); |
| 313 | 297 |
| 314 // Set masks to bounds so the compositor doesn't clobber a manually | 298 // Set masks to bounds so the compositor doesn't clobber a manually |
| 315 // set inner viewport container layer size. | 299 // set inner viewport container layer size. |
| 316 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); | 300 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); |
| 317 m_innerViewportContainerLayer->setSize(m_size); | 301 m_innerViewportContainerLayer->setSize(m_size); |
| 318 | 302 |
| 319 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( | 303 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( |
| 320 m_innerViewportContainerLayer->platformLayer()); | 304 m_innerViewportContainerLayer->platformLayer()); |
| 321 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); | 305 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); |
| 322 | 306 |
| 323 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); | 307 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); |
| 324 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); | 308 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); |
| 325 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); | 309 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); |
| 326 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); | 310 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); |
| 327 m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get
()); | |
| 328 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get()
); | |
| 329 | 311 |
| 330 // Ensure this class is set as the scroll layer's ScrollableArea. | 312 // Ensure this class is set as the scroll layer's ScrollableArea. |
| 331 coordinator->scrollableAreaScrollLayerDidChange(this); | 313 coordinator->scrollableAreaScrollLayerDidChange(this); |
| 332 | |
| 333 // Setup the inner viewport overlay scrollbars. | |
| 334 setupScrollbar(WebScrollbar::Horizontal); | |
| 335 setupScrollbar(WebScrollbar::Vertical); | |
| 336 } | 314 } |
| 337 | 315 |
| 338 m_innerViewportScrollLayer->removeAllChildren(); | 316 m_innerViewportScrollLayer->removeAllChildren(); |
| 339 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot); | 317 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot); |
| 340 } | 318 } |
| 341 | 319 |
| 342 void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation) | |
| 343 { | |
| 344 bool isHorizontal = orientation == WebScrollbar::Horizontal; | |
| 345 GraphicsLayer* scrollbarGraphicsLayer = isHorizontal ? | |
| 346 m_overlayScrollbarHorizontal.get() : m_overlayScrollbarVertical.get(); | |
| 347 OwnPtr<WebScrollbarLayer>& webScrollbarLayer = isHorizontal ? | |
| 348 m_webOverlayScrollbarHorizontal : m_webOverlayScrollbarVertical; | |
| 349 | |
| 350 int thumbThickness = frameHost().settings().pinchOverlayScrollbarThickness()
; | |
| 351 int scrollbarThickness = thumbThickness; | |
| 352 int scrollbarMargin = scrollbarThickness; | |
| 353 | |
| 354 // FIXME: Rather than manually creating scrollbar layers, we should create | |
| 355 // real scrollbars so we can reuse all the machinery from ScrollbarTheme. | |
| 356 #if OS(ANDROID) | |
| 357 thumbThickness = ScrollbarTheme::theme()->thumbThickness(0); | |
| 358 scrollbarThickness = ScrollbarTheme::theme()->scrollbarThickness(RegularScro
llbar); | |
| 359 scrollbarMargin = ScrollbarTheme::theme()->scrollbarMargin(); | |
| 360 #endif | |
| 361 | |
| 362 if (!webScrollbarLayer) { | |
| 363 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina
tor(); | |
| 364 ASSERT(coordinator); | |
| 365 ScrollbarOrientation webcoreOrientation = isHorizontal ? HorizontalScrol
lbar : VerticalScrollbar; | |
| 366 webScrollbarLayer = coordinator->createSolidColorScrollbarLayer(webcoreO
rientation, thumbThickness, scrollbarMargin, false); | |
| 367 | |
| 368 webScrollbarLayer->setClipLayer(m_innerViewportContainerLayer->platformL
ayer()); | |
| 369 | |
| 370 // The compositor will control the scrollbar's visibility. Set to invisi
ble by defualt | |
| 371 // so scrollbars don't show up in layout tests. | |
| 372 webScrollbarLayer->layer()->setOpacity(0); | |
| 373 | |
| 374 scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->la
yer()); | |
| 375 scrollbarGraphicsLayer->setDrawsContent(false); | |
| 376 } | |
| 377 | |
| 378 int xPosition = isHorizontal ? 0 : m_innerViewportContainerLayer->size().wid
th() - scrollbarThickness; | |
| 379 int yPosition = isHorizontal ? m_innerViewportContainerLayer->size().height(
) - scrollbarThickness : 0; | |
| 380 int width = isHorizontal ? m_innerViewportContainerLayer->size().width() - s
crollbarThickness : scrollbarThickness; | |
| 381 int height = isHorizontal ? scrollbarThickness : m_innerViewportContainerLay
er->size().height() - scrollbarThickness; | |
| 382 | |
| 383 // Use the GraphicsLayer to position the scrollbars. | |
| 384 scrollbarGraphicsLayer->setPosition(IntPoint(xPosition, yPosition)); | |
| 385 scrollbarGraphicsLayer->setSize(IntSize(width, height)); | |
| 386 scrollbarGraphicsLayer->setContentsRect(IntRect(0, 0, width, height)); | |
| 387 } | |
| 388 | |
| 389 void VisualViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
const | 320 void VisualViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
const |
| 390 { | 321 { |
| 391 TRACE_EVENT0("blink", "VisualViewport::registerLayersWithTreeView"); | 322 TRACE_EVENT0("blink", "VisualViewport::registerLayersWithTreeView"); |
| 392 ASSERT(layerTreeView); | 323 ASSERT(layerTreeView); |
| 393 | 324 |
| 394 if (!mainFrame()) | 325 if (!mainFrame()) |
| 395 return; | 326 return; |
| 396 | 327 |
| 397 ASSERT(frameHost().page().deprecatedLocalMainFrame()->contentLayoutObject())
; | 328 ASSERT(frameHost().page().deprecatedLocalMainFrame()->contentLayoutObject())
; |
| 398 | 329 |
| 399 DeprecatedPaintLayerCompositor* compositor = frameHost().page().deprecatedLo
calMainFrame()->contentLayoutObject()->compositor(); | 330 DeprecatedPaintLayerCompositor* compositor = frameHost().page().deprecatedLo
calMainFrame()->contentLayoutObject()->compositor(); |
| 400 // Get the outer viewport scroll layer. | 331 // Get the outer viewport scroll layer. |
| 401 WebLayer* scrollLayer = compositor->scrollLayer() ? compositor->scrollLayer(
)->platformLayer() : 0; | 332 WebLayer* scrollLayer = compositor->scrollLayer() ? compositor->scrollLayer(
)->platformLayer() : 0; |
| 402 | 333 |
| 403 m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); | |
| 404 m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); | |
| 405 | |
| 406 ASSERT(compositor); | 334 ASSERT(compositor); |
| 407 layerTreeView->registerViewportLayers( | 335 layerTreeView->registerViewportLayers( |
| 408 m_overscrollElasticityLayer->platformLayer(), | 336 m_overscrollElasticityLayer->platformLayer(), |
| 409 m_pageScaleLayer->platformLayer(), | 337 m_pageScaleLayer->platformLayer(), |
| 410 m_innerViewportScrollLayer->platformLayer(), | 338 m_innerViewportScrollLayer->platformLayer(), |
| 411 scrollLayer); | 339 scrollLayer); |
| 340 |
| 341 layerTreeView->setHidePinchScrollbarsNearMinScale(false); |
| 412 } | 342 } |
| 413 | 343 |
| 414 void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) con
st | 344 void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) con
st |
| 415 { | 345 { |
| 416 ASSERT(layerTreeView); | 346 ASSERT(layerTreeView); |
| 417 | 347 |
| 418 layerTreeView->clearViewportLayers(); | 348 layerTreeView->clearViewportLayers(); |
| 419 } | 349 } |
| 420 | 350 |
| 421 DoubleRect VisualViewport::visibleContentRectDouble(IncludeScrollbarsInRect) con
st | 351 DoubleRect VisualViewport::visibleContentRectDouble(IncludeScrollbarsInRect) con
st |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 LocalFrame* frame = mainFrame(); | 451 LocalFrame* frame = mainFrame(); |
| 522 | 452 |
| 523 if (!frame || !frame->view()) | 453 if (!frame || !frame->view()) |
| 524 return IntSize(); | 454 return IntSize(); |
| 525 | 455 |
| 526 return frame->view()->visibleContentRect(IncludeScrollbars).size(); | 456 return frame->view()->visibleContentRect(IncludeScrollbars).size(); |
| 527 } | 457 } |
| 528 | 458 |
| 529 void VisualViewport::invalidateScrollbarRect(Scrollbar*, const IntRect&) | 459 void VisualViewport::invalidateScrollbarRect(Scrollbar*, const IntRect&) |
| 530 { | 460 { |
| 531 // Do nothing. Visual scrollbars live on the compositor thread and will | |
| 532 // be updated when the viewport is synced to the CC. | |
| 533 } | 461 } |
| 534 | 462 |
| 535 void VisualViewport::setScrollOffset(const IntPoint& offset, ScrollType scrollTy
pe) | 463 void VisualViewport::setScrollOffset(const IntPoint& offset, ScrollType scrollTy
pe) |
| 536 { | 464 { |
| 537 setScrollOffset(DoublePoint(offset), scrollType); | 465 setScrollOffset(DoublePoint(offset), scrollType); |
| 538 } | 466 } |
| 539 | 467 |
| 540 void VisualViewport::setScrollOffset(const DoublePoint& offset, ScrollType) | 468 void VisualViewport::setScrollOffset(const DoublePoint& offset, ScrollType) |
| 541 { | 469 { |
| 542 setLocation(toFloatPoint(offset)); | 470 setLocation(toFloatPoint(offset)); |
| 543 } | 471 } |
| 544 | 472 |
| 545 GraphicsLayer* VisualViewport::layerForContainer() const | 473 GraphicsLayer* VisualViewport::layerForContainer() const |
| 546 { | 474 { |
| 547 return m_innerViewportContainerLayer.get(); | 475 return m_innerViewportContainerLayer.get(); |
| 548 } | 476 } |
| 549 | 477 |
| 550 GraphicsLayer* VisualViewport::layerForScrolling() const | 478 GraphicsLayer* VisualViewport::layerForScrolling() const |
| 551 { | 479 { |
| 552 return m_innerViewportScrollLayer.get(); | 480 return m_innerViewportScrollLayer.get(); |
| 553 } | 481 } |
| 554 | 482 |
| 555 GraphicsLayer* VisualViewport::layerForHorizontalScrollbar() const | 483 GraphicsLayer* VisualViewport::layerForHorizontalScrollbar() const |
| 556 { | 484 { |
| 557 return m_overlayScrollbarHorizontal.get(); | 485 return 0; |
| 558 } | 486 } |
| 559 | 487 |
| 560 GraphicsLayer* VisualViewport::layerForVerticalScrollbar() const | 488 GraphicsLayer* VisualViewport::layerForVerticalScrollbar() const |
| 561 { | 489 { |
| 562 return m_overlayScrollbarVertical.get(); | 490 return 0; |
| 563 } | 491 } |
| 564 | 492 |
| 565 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph
icsLayerPaintingPhase, const IntRect& inClip) | 493 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph
icsLayerPaintingPhase, const IntRect& inClip) |
| 566 { | 494 { |
| 567 } | 495 } |
| 568 | 496 |
| 569 LocalFrame* VisualViewport::mainFrame() const | 497 LocalFrame* VisualViewport::mainFrame() const |
| 570 { | 498 { |
| 571 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL
ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0; | 499 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL
ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0; |
| 572 } | 500 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 { | 572 { |
| 645 String name; | 573 String name; |
| 646 if (graphicsLayer == m_innerViewportContainerLayer.get()) { | 574 if (graphicsLayer == m_innerViewportContainerLayer.get()) { |
| 647 name = "Inner Viewport Container Layer"; | 575 name = "Inner Viewport Container Layer"; |
| 648 } else if (graphicsLayer == m_overscrollElasticityLayer.get()) { | 576 } else if (graphicsLayer == m_overscrollElasticityLayer.get()) { |
| 649 name = "Overscroll Elasticity Layer"; | 577 name = "Overscroll Elasticity Layer"; |
| 650 } else if (graphicsLayer == m_pageScaleLayer.get()) { | 578 } else if (graphicsLayer == m_pageScaleLayer.get()) { |
| 651 name = "Page Scale Layer"; | 579 name = "Page Scale Layer"; |
| 652 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) { | 580 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) { |
| 653 name = "Inner Viewport Scroll Layer"; | 581 name = "Inner Viewport Scroll Layer"; |
| 654 } else if (graphicsLayer == m_overlayScrollbarHorizontal.get()) { | |
| 655 name = "Overlay Scrollbar Horizontal Layer"; | |
| 656 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { | |
| 657 name = "Overlay Scrollbar Vertical Layer"; | |
| 658 } else if (graphicsLayer == m_rootTransformLayer) { | 582 } else if (graphicsLayer == m_rootTransformLayer) { |
| 659 name = "Root Transform Layer"; | 583 name = "Root Transform Layer"; |
| 660 } else { | 584 } else { |
| 661 ASSERT_NOT_REACHED(); | 585 ASSERT_NOT_REACHED(); |
| 662 } | 586 } |
| 663 | 587 |
| 664 return name; | 588 return name; |
| 665 } | 589 } |
| 666 | 590 |
| 667 } // namespace blink | 591 } // namespace blink |
| OLD | NEW |