| 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 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4539 if (!m_layerTreeView) | 4539 if (!m_layerTreeView) |
| 4540 return; | 4540 return; |
| 4541 | 4541 |
| 4542 // Otherwise, PaintLayerCompositor is expected to supply a root | 4542 // Otherwise, PaintLayerCompositor is expected to supply a root |
| 4543 // GraphicsLayer via setRootGraphicsLayer. | 4543 // GraphicsLayer via setRootGraphicsLayer. |
| 4544 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 4544 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 4545 | 4545 |
| 4546 // TODO(jbroman): This should probably have hookups for overlays, visual | 4546 // TODO(jbroman): This should probably have hookups for overlays, visual |
| 4547 // viewport, etc. | 4547 // viewport, etc. |
| 4548 | 4548 |
| 4549 m_paintArtifactCompositor.initializeIfNeeded(); | |
| 4550 WebLayer* rootLayer = m_paintArtifactCompositor.webLayer(); | 4549 WebLayer* rootLayer = m_paintArtifactCompositor.webLayer(); |
| 4551 ASSERT(rootLayer); | 4550 ASSERT(rootLayer); |
| 4552 m_layerTreeView->setRootLayer(*rootLayer); | 4551 m_layerTreeView->setRootLayer(*rootLayer); |
| 4553 | 4552 |
| 4554 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it | 4553 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it |
| 4555 // necessary? | 4554 // necessary? |
| 4556 m_layerTreeView->setVisible(page()->isPageVisible()); | 4555 m_layerTreeView->setVisible(page()->isPageVisible()); |
| 4557 } | 4556 } |
| 4558 | 4557 |
| 4559 void WebViewImpl::detachPaintArtifactCompositor() | 4558 void WebViewImpl::detachPaintArtifactCompositor() |
| 4560 { | 4559 { |
| 4561 if (!m_layerTreeView) | 4560 if (!m_layerTreeView) |
| 4562 return; | 4561 return; |
| 4563 | 4562 |
| 4564 m_layerTreeView->setDeferCommits(true); | 4563 m_layerTreeView->setDeferCommits(true); |
| 4565 m_layerTreeView->clearRootLayer(); | 4564 m_layerTreeView->clearRootLayer(); |
| 4566 } | 4565 } |
| 4567 | 4566 |
| 4568 float WebViewImpl::deviceScaleFactor() const | 4567 float WebViewImpl::deviceScaleFactor() const |
| 4569 { | 4568 { |
| 4570 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4569 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4571 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4570 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4572 if (!page()) | 4571 if (!page()) |
| 4573 return 1; | 4572 return 1; |
| 4574 | 4573 |
| 4575 return page()->deviceScaleFactor(); | 4574 return page()->deviceScaleFactor(); |
| 4576 } | 4575 } |
| 4577 | 4576 |
| 4578 } // namespace blink | 4577 } // namespace blink |
| OLD | NEW |