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 4186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4197 // be refreshed here when setting a new root layer to avoid being | 4197 // be refreshed here when setting a new root layer to avoid being |
4198 // stuck in a presumed incorrectly invisible state. | 4198 // stuck in a presumed incorrectly invisible state. |
4199 m_layerTreeView->setVisible(page()->isPageVisible()); | 4199 m_layerTreeView->setVisible(page()->isPageVisible()); |
4200 } else { | 4200 } else { |
4201 m_rootGraphicsLayer = nullptr; | 4201 m_rootGraphicsLayer = nullptr; |
4202 m_visualViewportContainerLayer = nullptr; | 4202 m_visualViewportContainerLayer = nullptr; |
4203 m_rootLayer = nullptr; | 4203 m_rootLayer = nullptr; |
4204 // This means that we're transitioning to a new page. Suppress | 4204 // This means that we're transitioning to a new page. Suppress |
4205 // commits until Blink generates invalidations so we don't | 4205 // commits until Blink generates invalidations so we don't |
4206 // attempt to paint too early in the next page load. | 4206 // attempt to paint too early in the next page load. |
| 4207 LOG(ERROR) << "Stop painting"; |
4207 m_layerTreeView->setDeferCommits(true); | 4208 m_layerTreeView->setDeferCommits(true); |
4208 m_layerTreeView->clearRootLayer(); | 4209 m_layerTreeView->clearRootLayer(); |
4209 visualViewport.clearLayersForTreeView(m_layerTreeView); | 4210 visualViewport.clearLayersForTreeView(m_layerTreeView); |
4210 } | 4211 } |
4211 } | 4212 } |
4212 | 4213 |
4213 void WebViewImpl::invalidateRect(const IntRect& rect) | 4214 void WebViewImpl::invalidateRect(const IntRect& rect) |
4214 { | 4215 { |
4215 if (m_layerTreeView) | 4216 if (m_layerTreeView) |
4216 updateLayerTreeViewport(); | 4217 updateLayerTreeViewport(); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4503 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it | 4504 // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it |
4504 // necessary? | 4505 // necessary? |
4505 m_layerTreeView->setVisible(page()->isPageVisible()); | 4506 m_layerTreeView->setVisible(page()->isPageVisible()); |
4506 } | 4507 } |
4507 | 4508 |
4508 void WebViewImpl::detachPaintArtifactCompositor() | 4509 void WebViewImpl::detachPaintArtifactCompositor() |
4509 { | 4510 { |
4510 if (!m_layerTreeView) | 4511 if (!m_layerTreeView) |
4511 return; | 4512 return; |
4512 | 4513 |
| 4514 LOG(ERROR) << "Stop painting"; |
4513 m_layerTreeView->setDeferCommits(true); | 4515 m_layerTreeView->setDeferCommits(true); |
4514 m_layerTreeView->clearRootLayer(); | 4516 m_layerTreeView->clearRootLayer(); |
4515 } | 4517 } |
4516 | 4518 |
4517 float WebViewImpl::deviceScaleFactor() const | 4519 float WebViewImpl::deviceScaleFactor() const |
4518 { | 4520 { |
4519 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4521 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4520 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4522 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4521 if (!page()) | 4523 if (!page()) |
4522 return 1; | 4524 return 1; |
4523 | 4525 |
4524 return page()->deviceScaleFactor(); | 4526 return page()->deviceScaleFactor(); |
4525 } | 4527 } |
4526 | 4528 |
4527 } // namespace blink | 4529 } // namespace blink |
OLD | NEW |