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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 invalidateWebFrame(); | 115 invalidateWebFrame(); |
116 | 116 |
117 if (!m_layer) { | 117 if (!m_layer) { |
118 m_layerClient = OverlayGraphicsLayerClientImpl::create(m_overlay); | 118 m_layerClient = OverlayGraphicsLayerClientImpl::create(m_overlay); |
119 m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_la
yerClient.get()); | 119 m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_la
yerClient.get()); |
120 m_layer->setDrawsContent(true); | 120 m_layer->setDrawsContent(true); |
121 | 121 |
122 if (WebCore::Page* page = m_viewImpl->page()) | 122 if (WebCore::Page* page = m_viewImpl->page()) |
123 page->inspectorController().willAddPageOverlay(m_layer.get()); | 123 page->inspectorController().willAddPageOverlay(m_layer.get()); |
124 | 124 |
125 // Compositor hit-testing does not know how to deal with layers that may
be | 125 // This is required for contents of overlay to stay in sync with the pag
e while scrolling. |
126 // transparent to events (see http://crbug.com/269598). So require | |
127 // scrolling and touches on this layer to go to the main thread. | |
128 WebLayer* platformLayer = m_layer->platformLayer(); | 126 WebLayer* platformLayer = m_layer->platformLayer(); |
129 platformLayer->setShouldScrollOnMainThread(true); | 127 platformLayer->setShouldScrollOnMainThread(true); |
130 WebVector<WebRect> webRects(static_cast<size_t>(1)); | |
131 webRects[0] = WebRect(0, 0, INT_MAX, INT_MAX); | |
132 platformLayer->setTouchEventHandlerRegion(webRects); | |
133 } | 128 } |
134 | 129 |
135 FloatSize size(m_viewImpl->size()); | 130 FloatSize size(m_viewImpl->size()); |
136 if (size != m_layer->size()) { | 131 if (size != m_layer->size()) { |
137 // Triggers re-adding to root layer to ensure that we are on top of | 132 // Triggers re-adding to root layer to ensure that we are on top of |
138 // scrollbars. | 133 // scrollbars. |
139 m_layer->removeFromParent(); | 134 m_layer->removeFromParent(); |
140 m_layer->setSize(size); | 135 m_layer->setSize(size); |
141 } | 136 } |
142 | 137 |
(...skipping 20 matching lines...) Expand all Loading... |
163 // this is not on a critical codepath? In order to do so, we'd | 158 // this is not on a critical codepath? In order to do so, we'd |
164 // have to take scrolling into account. | 159 // have to take scrolling into account. |
165 const WebSize& size = m_viewImpl->size(); | 160 const WebSize& size = m_viewImpl->size(); |
166 WebRect damagedRect(0, 0, size.width, size.height); | 161 WebRect damagedRect(0, 0, size.width, size.height); |
167 if (m_viewImpl->client()) | 162 if (m_viewImpl->client()) |
168 m_viewImpl->client()->didInvalidateRect(damagedRect); | 163 m_viewImpl->client()->didInvalidateRect(damagedRect); |
169 } | 164 } |
170 } | 165 } |
171 | 166 |
172 } // namespace blink | 167 } // namespace blink |
OLD | NEW |