| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-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 * * 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "public/platform/WebURL.h" | 60 #include "public/platform/WebURL.h" |
| 61 #include "public/platform/WebURLError.h" | 61 #include "public/platform/WebURLError.h" |
| 62 #include "public/platform/WebURLRequest.h" | 62 #include "public/platform/WebURLRequest.h" |
| 63 #include "public/platform/WebURLResponse.h" | 63 #include "public/platform/WebURLResponse.h" |
| 64 #include "public/web/WebDataSource.h" | 64 #include "public/web/WebDataSource.h" |
| 65 #include "public/web/WebDevToolsAgentClient.h" | 65 #include "public/web/WebDevToolsAgentClient.h" |
| 66 #include "public/web/WebDeviceEmulationParams.h" | 66 #include "public/web/WebDeviceEmulationParams.h" |
| 67 #include "public/web/WebMemoryUsageInfo.h" | 67 #include "public/web/WebMemoryUsageInfo.h" |
| 68 #include "public/web/WebSettings.h" | 68 #include "public/web/WebSettings.h" |
| 69 #include "public/web/WebViewClient.h" | 69 #include "public/web/WebViewClient.h" |
| 70 #include "web/WebGraphicsContextImpl.h" |
| 70 #include "web/WebInputEventConversion.h" | 71 #include "web/WebInputEventConversion.h" |
| 71 #include "web/WebLocalFrameImpl.h" | 72 #include "web/WebLocalFrameImpl.h" |
| 72 #include "web/WebViewImpl.h" | 73 #include "web/WebViewImpl.h" |
| 73 #include "wtf/CurrentTime.h" | 74 #include "wtf/CurrentTime.h" |
| 74 #include "wtf/MathExtras.h" | 75 #include "wtf/MathExtras.h" |
| 75 #include "wtf/Noncopyable.h" | 76 #include "wtf/Noncopyable.h" |
| 76 #include "wtf/ProcessID.h" | 77 #include "wtf/ProcessID.h" |
| 77 #include "wtf/text/WTFString.h" | 78 #include "wtf/text/WTFString.h" |
| 78 | 79 |
| 79 namespace OverlayZOrders { | 80 namespace OverlayZOrders { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 } | 481 } |
| 481 | 482 |
| 482 LocalFrame* WebDevToolsAgentImpl::mainFrame() | 483 LocalFrame* WebDevToolsAgentImpl::mainFrame() |
| 483 { | 484 { |
| 484 if (Page* page = m_webViewImpl->page()) | 485 if (Page* page = m_webViewImpl->page()) |
| 485 return page->deprecatedLocalMainFrame(); | 486 return page->deprecatedLocalMainFrame(); |
| 486 return 0; | 487 return 0; |
| 487 } | 488 } |
| 488 | 489 |
| 489 // WebPageOverlay | 490 // WebPageOverlay |
| 490 void WebDevToolsAgentImpl::paintPageOverlay(WebCanvas* canvas) | 491 void WebDevToolsAgentImpl::paintPageOverlay(WebGraphicsContext* context, const W
ebSize& webViewSize) |
| 491 { | 492 { |
| 492 InspectorController* ic = inspectorController(); | 493 if (InspectorController* ic = inspectorController()) |
| 493 if (ic) { | 494 ic->drawHighlight(toWebGraphicsContextImpl(context)->graphicsContext()); |
| 494 OwnPtr<GraphicsContext> graphicsContext; | |
| 495 OwnPtr<DisplayItemList> displayItemList; | |
| 496 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | |
| 497 displayItemList = DisplayItemList::create(); | |
| 498 graphicsContext = adoptPtr(new GraphicsContext(nullptr, displayItemL
ist.get())); | |
| 499 } else { | |
| 500 graphicsContext = adoptPtr(new GraphicsContext(canvas, nullptr)); | |
| 501 } | |
| 502 | |
| 503 graphicsContext->setCertainlyOpaque(false); | |
| 504 ic->drawHighlight(*graphicsContext); | |
| 505 | |
| 506 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | |
| 507 GraphicsContext context(canvas, nullptr); | |
| 508 displayItemList->replay(&context); | |
| 509 } | |
| 510 } | |
| 511 } | 495 } |
| 512 | 496 |
| 513 void WebDevToolsAgentImpl::highlight() | 497 void WebDevToolsAgentImpl::highlight() |
| 514 { | 498 { |
| 515 m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); | 499 m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); |
| 516 } | 500 } |
| 517 | 501 |
| 518 void WebDevToolsAgentImpl::hideHighlight() | 502 void WebDevToolsAgentImpl::hideHighlight() |
| 519 { | 503 { |
| 520 m_webViewImpl->removePageOverlay(this); | 504 m_webViewImpl->removePageOverlay(this); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 597 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
| 614 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 598 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
| 615 } | 599 } |
| 616 | 600 |
| 617 void WebDevToolsAgent::processPendingMessages() | 601 void WebDevToolsAgent::processPendingMessages() |
| 618 { | 602 { |
| 619 PageScriptDebugServer::shared().runPendingTasks(); | 603 PageScriptDebugServer::shared().runPendingTasks(); |
| 620 } | 604 } |
| 621 | 605 |
| 622 } // namespace blink | 606 } // namespace blink |
| OLD | NEW |