Changeset 88582 in webkit
- Timestamp:
- Jun 10, 2011 5:39:10 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r88578 r88582 1 2011-06-10 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Reviewed by James Robinson. 4 5 Web Inspector: [Chromium] DevTools does not highlight elements when accelerated compositing is on. 6 https://bugs.webkit.org/show_bug.cgi?id=62149 7 8 Added page overlay for inspector highlight support. 9 10 * WebKit.gyp: 11 * src/ChromeClientImpl.cpp: 12 (WebKit::ChromeClientImpl::attachRootGraphicsLayer): 13 * src/PageOverlay.cpp: Added. 14 (WebKit::PageOverlay::create): 15 (WebKit::PageOverlay::PageOverlay): 16 (WebKit::OverlayGraphicsLayerClientImpl::create): 17 (WebKit::OverlayGraphicsLayerClientImpl::~OverlayGraphicsLayerClientImpl): 18 (WebKit::OverlayGraphicsLayerClientImpl::notifyAnimationStarted): 19 (WebKit::OverlayGraphicsLayerClientImpl::notifySyncRequired): 20 (WebKit::OverlayGraphicsLayerClientImpl::paintContents): 21 (WebKit::OverlayGraphicsLayerClientImpl::showDebugBorders): 22 (WebKit::OverlayGraphicsLayerClientImpl::showRepaintCounter): 23 (WebKit::OverlayGraphicsLayerClientImpl::OverlayGraphicsLayerClientImpl): 24 (WebKit::PageOverlay::clear): 25 (WebKit::PageOverlay::update): 26 (WebKit::PageOverlay::paintWebFrame): 27 (WebKit::PageOverlay::invalidateWebFrame): 28 * src/PageOverlay.h: Added. 29 (WebKit::PageOverlay::~PageOverlay): 30 (WebKit::PageOverlay::setClient): 31 * src/WebDevToolsAgentImpl.cpp: 32 (WebKit::WebDevToolsAgentImpl::paintPageOverlay): 33 (WebKit::WebDevToolsAgentImpl::highlight): 34 (WebKit::WebDevToolsAgentImpl::hideHighlight): 35 * src/WebDevToolsAgentImpl.h: 36 * src/WebFrameImpl.cpp: 37 (WebKit::WebFrameImpl::paintWithContext): 38 * src/WebViewImpl.cpp: 39 (WebKit::WebViewImpl::WebViewImpl): 40 (WebKit::WebViewImpl::setPageOverlayClient): 41 (WebKit::WebViewImpl::setOverlayLayer): 42 (WebKit::WebViewImpl::setRootGraphicsLayer): 43 (WebKit::WebViewImpl::setRootPlatformLayer): 44 (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): 45 (WebKit::WebViewImpl::doComposite): 46 (WebKit::WebViewImpl::reallocateRenderer): 47 * src/WebViewImpl.h: 48 (WebKit::WebViewImpl::pageOverlay): 49 1 50 2011-06-10 David Levin <levin@chromium.org> 2 51 -
trunk/Source/WebKit/chromium/WebKit.gyp
r88523 r88582 394 394 'src/NotificationPresenterImpl.cpp', 395 395 'src/painting/GraphicsContextBuilder.h', 396 'src/PageOverlay.cpp', 397 'src/PageOverlay.h', 396 398 'src/PlatformBridge.cpp', 397 399 'src/PlatformMessagePortChannel.cpp', -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r88288 r88582 837 837 void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer) 838 838 { 839 m_webView->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->platformLayer() : 0);839 m_webView->setRootGraphicsLayer(graphicsLayer); 840 840 } 841 841 -
trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r88010 r88582 35 35 #include "DebuggerAgentManager.h" 36 36 #include "ExceptionCode.h" 37 #include "GraphicsContext.h" 37 38 #include "InjectedScriptHost.h" 38 39 #include "InspectorBackendDispatcher.h" … … 41 42 #include "Page.h" 42 43 #include "PageGroup.h" 44 #include "PageOverlay.h" 43 45 #include "PageScriptDebugServer.h" 44 46 #include "PlatformString.h" … … 272 274 } 273 275 276 // PageOverlayClient 277 void WebDevToolsAgentImpl::paintPageOverlay(GraphicsContext& gc) 278 { 279 InspectorController* ic = inspectorController(); 280 if (ic) 281 ic->drawNodeHighlight(gc); 282 } 283 274 284 void WebDevToolsAgentImpl::highlight(Node* node) 275 285 { 276 // InspectorController does the actuall tracking of the highlighted node 277 // and the drawing of the highlight. Here we just make sure to invalidate 278 // the rects of the old and new nodes. 279 hideHighlight(); 286 m_webViewImpl->setPageOverlayClient(this); 280 287 } 281 288 282 289 void WebDevToolsAgentImpl::hideHighlight() 283 290 { 284 // FIXME: able to invalidate a smaller rect. 285 // FIXME: Is it important to just invalidate the rect of the node region 286 // given that this is not on a critical codepath? In order to do so, we'd 287 // have to take scrolling into account. 288 const WebSize& size = m_webViewImpl->size(); 289 WebRect damagedRect(0, 0, size.width, size.height); 290 if (m_webViewImpl->client()) 291 m_webViewImpl->client()->didInvalidateRect(damagedRect); 291 m_webViewImpl->setPageOverlayClient(0); 292 292 } 293 293 -
trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
r88010 r88582 34 34 #include "InspectorClient.h" 35 35 36 #include "PageOverlay.h" 36 37 #include "WebDevToolsAgentPrivate.h" 37 38 … … 42 43 class Document; 43 44 class Frame; 45 class GraphicsContext; 44 46 class InspectorClient; 45 47 class InspectorController; … … 61 63 62 64 class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate, 63 public WebCore::InspectorClient { 65 public WebCore::InspectorClient, 66 public PageOverlay::PageOverlayClient { 64 67 public: 65 68 WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client); … … 91 94 int hostId() { return m_hostId; } 92 95 96 // PageOverlayClient 97 virtual void paintPageOverlay(WebCore::GraphicsContext&); 98 93 99 private: 94 100 WebCore::InspectorController* inspectorController(); -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r88109 r88582 105 105 #include "InspectorController.h" 106 106 #include "Page.h" 107 #include "PageOverlay.h" 107 108 #include "painting/GraphicsContextBuilder.h" 108 109 #include "Performance.h" … … 2022 2023 gc.clip(dirtyRect); 2023 2024 frameView()->paint(&gc, dirtyRect); 2024 m_frame->page()->inspectorController()->drawNodeHighlight(gc); 2025 if (viewImpl()->pageOverlay()) 2026 viewImpl()->pageOverlay()->paintWebFrame(gc); 2025 2027 } else 2026 2028 gc.fillRect(dirtyRect, Color::white, ColorSpaceDeviceRGB); -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r88288 r88582 330 330 #if USE(ACCELERATED_COMPOSITING) 331 331 , m_layerRenderer(0) 332 , m_rootGraphicsLayer(0) 332 333 , m_isAcceleratedCompositingActive(false) 333 334 , m_compositorCreationFailed(false) … … 2291 2292 } 2292 2293 2294 void WebViewImpl::setPageOverlayClient(PageOverlay::PageOverlayClient* pageOverlayClient) 2295 { 2296 if (pageOverlayClient) { 2297 if (!m_pageOverlay) 2298 m_pageOverlay = PageOverlay::create(this, pageOverlayClient); 2299 else 2300 m_pageOverlay->setClient(pageOverlayClient); 2301 m_pageOverlay->update(); 2302 setRootLayerNeedsDisplay(); 2303 } else { 2304 if (m_pageOverlay) { 2305 m_pageOverlay->clear(); 2306 m_pageOverlay = nullptr; 2307 setRootLayerNeedsDisplay(); 2308 } 2309 } 2310 } 2311 2312 void WebViewImpl::setOverlayLayer(WebCore::GraphicsLayer* layer) 2313 { 2314 if (m_rootGraphicsLayer) { 2315 if (layer->parent() != m_rootGraphicsLayer) 2316 m_rootGraphicsLayer->addChild(layer); 2317 } 2318 } 2319 2293 2320 #if ENABLE(NOTIFICATIONS) 2294 2321 NotificationPresenterImpl* WebViewImpl::notificationPresenterImpl() … … 2373 2400 } 2374 2401 2375 void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) 2402 void WebViewImpl::setRootGraphicsLayer(WebCore::GraphicsLayer* layer) 2403 { 2404 m_rootGraphicsLayer = layer; 2405 setRootPlatformLayer(layer ? layer->platformLayer() : 0); 2406 } 2407 2408 void WebViewImpl::setRootPlatformLayer(WebCore::PlatformLayer* layer) 2376 2409 { 2377 2410 setIsAcceleratedCompositingActive(layer); … … 2478 2511 m_isAcceleratedCompositingActive = true; 2479 2512 m_compositorCreationFailed = false; 2513 if (m_pageOverlay) 2514 m_pageOverlay->update(); 2480 2515 } else { 2481 2516 m_isAcceleratedCompositingActive = false; … … 2505 2540 hud->setShowFPSCounter(settings()->showFPSCounter()); 2506 2541 hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree()); 2542 2543 if (m_pageOverlay) 2544 m_pageOverlay->update(); 2507 2545 2508 2546 m_layerRenderer->updateAndDrawLayers(); … … 2529 2567 // function properly until its reshape method is called. 2530 2568 newContext->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); 2531 setRoot GraphicsLayer(m_layerRenderer->rootLayer());2569 setRootPlatformLayer(m_layerRenderer->rootLayer()); 2532 2570 // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so 2533 2571 // that the browser process can reacquire surfaces. 2534 2572 m_client->didActivateAcceleratedCompositing(true); 2573 if (m_pageOverlay) 2574 m_pageOverlay->update(); 2535 2575 } else 2536 setRoot GraphicsLayer(0);2576 setRootPlatformLayer(0); 2537 2577 } 2538 2578 #endif -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r88203 r88582 49 49 #include "LayerRendererChromium.h" 50 50 #include "NotificationPresenterImpl.h" 51 #include "PageOverlay.h" 51 52 #include <wtf/OwnPtr.h> 52 53 #include <wtf/RefCounted.h> … … 207 208 WebDevToolsAgentPrivate* devToolsAgentPrivate() { return m_devToolsAgent.get(); } 208 209 210 PageOverlay* pageOverlay() const { return m_pageOverlay.get(); } 211 void setPageOverlayClient(PageOverlay::PageOverlayClient*); 212 213 void setOverlayLayer(WebCore::GraphicsLayer*); 214 209 215 const WebPoint& lastMouseDownPoint() const 210 216 { … … 346 352 bool allowsAcceleratedCompositing(); 347 353 bool pageHasRTLStyle() const; 348 void setRootGraphicsLayer(WebCore::PlatformLayer*); 354 void setRootGraphicsLayer(WebCore::GraphicsLayer*); 355 void setRootPlatformLayer(WebCore::PlatformLayer*); 349 356 void setRootLayerNeedsDisplay(); 350 357 void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect); … … 509 516 510 517 OwnPtr<WebDevToolsAgentPrivate> m_devToolsAgent; 518 OwnPtr<PageOverlay> m_pageOverlay; 511 519 512 520 // Whether the webview is rendering transparently. … … 534 542 WebCore::IntRect m_rootLayerScrollDamage; 535 543 RefPtr<WebCore::LayerRendererChromium> m_layerRenderer; 544 WebCore::GraphicsLayer* m_rootGraphicsLayer; 536 545 bool m_isAcceleratedCompositingActive; 537 546 bool m_compositorCreationFailed;
Note: See TracChangeset
for help on using the changeset viewer.