| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 if (!m_layer) { | 79 if (!m_layer) { |
| 80 m_layer = GraphicsLayer::create(this); | 80 m_layer = GraphicsLayer::create(this); |
| 81 m_layer->setDrawsContent(true); | 81 m_layer->setDrawsContent(true); |
| 82 | 82 |
| 83 if (WebDevToolsAgentImpl* devTools = | 83 if (WebDevToolsAgentImpl* devTools = |
| 84 m_viewImpl->mainFrameDevToolsAgentImpl()) | 84 m_viewImpl->mainFrameDevToolsAgentImpl()) |
| 85 devTools->willAddPageOverlay(m_layer.get()); | 85 devTools->willAddPageOverlay(m_layer.get()); |
| 86 | 86 |
| 87 // This is required for contents of overlay to stay in sync with the page wh
ile scrolling. | 87 // This is required for contents of overlay to stay in sync with the page |
| 88 // while scrolling. |
| 88 WebLayer* platformLayer = m_layer->platformLayer(); | 89 WebLayer* platformLayer = m_layer->platformLayer(); |
| 89 platformLayer->addMainThreadScrollingReasons( | 90 platformLayer->addMainThreadScrollingReasons( |
| 90 MainThreadScrollingReason::kPageOverlay); | 91 MainThreadScrollingReason::kPageOverlay); |
| 91 page->frameHost().visualViewport().containerLayer()->addChild( | 92 page->frameHost().visualViewport().containerLayer()->addChild( |
| 92 m_layer.get()); | 93 m_layer.get()); |
| 93 } | 94 } |
| 94 | 95 |
| 95 FloatSize size(page->frameHost().visualViewport().size()); | 96 FloatSize size(page->frameHost().visualViewport().size()); |
| 96 if (size != m_layer->size()) | 97 if (size != m_layer->size()) |
| 97 m_layer->setSize(size); | 98 m_layer->setSize(size); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 const IntRect& interestRect) const { | 116 const IntRect& interestRect) const { |
| 116 DCHECK(m_layer); | 117 DCHECK(m_layer); |
| 117 m_delegate->paintPageOverlay(*this, gc, interestRect.size()); | 118 m_delegate->paintPageOverlay(*this, gc, interestRect.size()); |
| 118 } | 119 } |
| 119 | 120 |
| 120 String PageOverlay::debugName(const GraphicsLayer*) const { | 121 String PageOverlay::debugName(const GraphicsLayer*) const { |
| 121 return "WebViewImpl Page Overlay Content Layer"; | 122 return "WebViewImpl Page Overlay Content Layer"; |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace blink | 125 } // namespace blink |
| OLD | NEW |