| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 4278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4289 updateRootLayerTransform(); | 4289 updateRootLayerTransform(); |
| 4290 m_layerTreeView->setRootLayer(*m_rootLayer); | 4290 m_layerTreeView->setRootLayer(*m_rootLayer); |
| 4291 // We register viewport layers here since there may not be a layer | 4291 // We register viewport layers here since there may not be a layer |
| 4292 // tree view prior to this point. | 4292 // tree view prior to this point. |
| 4293 visualViewport.registerLayersWithTreeView(m_layerTreeView); | 4293 visualViewport.registerLayersWithTreeView(m_layerTreeView); |
| 4294 updatePageOverlays(); | 4294 updatePageOverlays(); |
| 4295 // TODO(enne): Work around page visibility changes not being | 4295 // TODO(enne): Work around page visibility changes not being |
| 4296 // propagated to the WebView in some circumstances. This needs to | 4296 // propagated to the WebView in some circumstances. This needs to |
| 4297 // be refreshed here when setting a new root layer to avoid being | 4297 // be refreshed here when setting a new root layer to avoid being |
| 4298 // stuck in a presumed incorrectly invisible state. | 4298 // stuck in a presumed incorrectly invisible state. |
| 4299 bool visible = page()->visibilityState() == PageVisibilityStateVisible; | 4299 m_layerTreeView->setVisible(page()->isPageVisible()); |
| 4300 m_layerTreeView->setVisible(visible); | |
| 4301 } else { | 4300 } else { |
| 4302 m_rootGraphicsLayer = nullptr; | 4301 m_rootGraphicsLayer = nullptr; |
| 4303 m_rootLayer = nullptr; | 4302 m_rootLayer = nullptr; |
| 4304 // This means that we're transitioning to a new page. Suppress | 4303 // This means that we're transitioning to a new page. Suppress |
| 4305 // commits until Blink generates invalidations so we don't | 4304 // commits until Blink generates invalidations so we don't |
| 4306 // attempt to paint too early in the next page load. | 4305 // attempt to paint too early in the next page load. |
| 4307 m_layerTreeView->setDeferCommits(true); | 4306 m_layerTreeView->setDeferCommits(true); |
| 4308 m_layerTreeView->clearRootLayer(); | 4307 m_layerTreeView->clearRootLayer(); |
| 4309 visualViewport.clearLayersForTreeView(m_layerTreeView); | 4308 visualViewport.clearLayersForTreeView(m_layerTreeView); |
| 4310 } | 4309 } |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4617 // TODO(jbroman): This should probably have hookups for overlays, visual | 4616 // TODO(jbroman): This should probably have hookups for overlays, visual |
| 4618 // viewport, etc. | 4617 // viewport, etc. |
| 4619 | 4618 |
| 4620 m_paintArtifactCompositor.initializeIfNeeded(); | 4619 m_paintArtifactCompositor.initializeIfNeeded(); |
| 4621 WebLayer* rootLayer = m_paintArtifactCompositor.webLayer(); | 4620 WebLayer* rootLayer = m_paintArtifactCompositor.webLayer(); |
| 4622 ASSERT(rootLayer); | 4621 ASSERT(rootLayer); |
| 4623 m_layerTreeView->setRootLayer(*rootLayer); | 4622 m_layerTreeView->setRootLayer(*rootLayer); |
| 4624 | 4623 |
| 4625 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it | 4624 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it |
| 4626 // necessary? | 4625 // necessary? |
| 4627 bool visible = page()->visibilityState() == PageVisibilityStateVisible; | 4626 m_layerTreeView->setVisible(page()->isPageVisible()); |
| 4628 m_layerTreeView->setVisible(visible); | |
| 4629 } | 4627 } |
| 4630 | 4628 |
| 4631 void WebViewImpl::detachPaintArtifactCompositor() | 4629 void WebViewImpl::detachPaintArtifactCompositor() |
| 4632 { | 4630 { |
| 4633 if (!m_layerTreeView) | 4631 if (!m_layerTreeView) |
| 4634 return; | 4632 return; |
| 4635 | 4633 |
| 4636 m_layerTreeView->setDeferCommits(true); | 4634 m_layerTreeView->setDeferCommits(true); |
| 4637 m_layerTreeView->clearRootLayer(); | 4635 m_layerTreeView->clearRootLayer(); |
| 4638 } | 4636 } |
| 4639 | 4637 |
| 4640 float WebViewImpl::deviceScaleFactor() const | 4638 float WebViewImpl::deviceScaleFactor() const |
| 4641 { | 4639 { |
| 4642 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4640 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4643 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4641 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4644 if (!page()) | 4642 if (!page()) |
| 4645 return 1; | 4643 return 1; |
| 4646 | 4644 |
| 4647 return page()->deviceScaleFactor(); | 4645 return page()->deviceScaleFactor(); |
| 4648 } | 4646 } |
| 4649 | 4647 |
| 4650 } // namespace blink | 4648 } // namespace blink |
| OLD | NEW |