Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: Source/web/PageOverlay.cpp

Issue 173763002: DevTools: hide page overlay layers in LayerTreeAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed stray watchdog from test Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 WebPageOverlay* m_overlay; 95 WebPageOverlay* m_overlay;
96 }; 96 };
97 97
98 void PageOverlay::clear() 98 void PageOverlay::clear()
99 { 99 {
100 invalidateWebFrame(); 100 invalidateWebFrame();
101 101
102 if (m_layer) { 102 if (m_layer) {
103 m_layer->removeFromParent(); 103 m_layer->removeFromParent();
104 if (WebCore::Page* page = m_viewImpl->page())
105 page->inspectorController().didRemovePageOverlay(m_layer.get());
104 m_layer = nullptr; 106 m_layer = nullptr;
105 m_layerClient = nullptr; 107 m_layerClient = nullptr;
106 } 108 }
107 } 109 }
108 110
109 void PageOverlay::update() 111 void PageOverlay::update()
110 { 112 {
111 invalidateWebFrame(); 113 invalidateWebFrame();
112 114
113 if (!m_layer) { 115 if (!m_layer) {
114 m_layerClient = OverlayGraphicsLayerClientImpl::create(m_overlay); 116 m_layerClient = OverlayGraphicsLayerClientImpl::create(m_overlay);
115 m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_la yerClient.get()); 117 m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_la yerClient.get());
116 m_layer->setDrawsContent(true); 118 m_layer->setDrawsContent(true);
117 119
120 if (WebCore::Page* page = m_viewImpl->page())
121 page->inspectorController().willAddPageOverlay(m_layer.get());
122
118 // Compositor hit-testing does not know how to deal with layers that may be 123 // Compositor hit-testing does not know how to deal with layers that may be
119 // transparent to events (see http://crbug.com/269598). So require 124 // transparent to events (see http://crbug.com/269598). So require
120 // scrolling and touches on this layer to go to the main thread. 125 // scrolling and touches on this layer to go to the main thread.
121 WebLayer* platformLayer = m_layer->platformLayer(); 126 WebLayer* platformLayer = m_layer->platformLayer();
122 platformLayer->setShouldScrollOnMainThread(true); 127 platformLayer->setShouldScrollOnMainThread(true);
123 WebVector<WebRect> webRects(static_cast<size_t>(1)); 128 WebVector<WebRect> webRects(static_cast<size_t>(1));
124 webRects[0] = WebRect(0, 0, INT_MAX, INT_MAX); 129 webRects[0] = WebRect(0, 0, INT_MAX, INT_MAX);
125 platformLayer->setTouchEventHandlerRegion(webRects); 130 platformLayer->setTouchEventHandlerRegion(webRects);
126 } 131 }
127 132
(...skipping 28 matching lines...) Expand all
156 // this is not on a critical codepath? In order to do so, we'd 161 // this is not on a critical codepath? In order to do so, we'd
157 // have to take scrolling into account. 162 // have to take scrolling into account.
158 const WebSize& size = m_viewImpl->size(); 163 const WebSize& size = m_viewImpl->size();
159 WebRect damagedRect(0, 0, size.width, size.height); 164 WebRect damagedRect(0, 0, size.width, size.height);
160 if (m_viewImpl->client()) 165 if (m_viewImpl->client())
161 m_viewImpl->client()->didInvalidateRect(damagedRect); 166 m_viewImpl->client()->didInvalidateRect(damagedRect);
162 } 167 }
163 } 168 }
164 169
165 } // namespace blink 170 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698