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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 return 0; | 479 return 0; |
480 } | 480 } |
481 | 481 |
482 LocalFrame* WebDevToolsAgentImpl::mainFrame() | 482 LocalFrame* WebDevToolsAgentImpl::mainFrame() |
483 { | 483 { |
484 if (Page* page = m_webViewImpl->page()) | 484 if (Page* page = m_webViewImpl->page()) |
485 return page->deprecatedLocalMainFrame(); | 485 return page->deprecatedLocalMainFrame(); |
486 return 0; | 486 return 0; |
487 } | 487 } |
488 | 488 |
489 // WebPageOverlay | 489 // PageOverlay::Painter |
490 void WebDevToolsAgentImpl::paintPageOverlay(WebCanvas* canvas) | 490 void WebDevToolsAgentImpl::paintPageOverlay(GraphicsContext& context) |
491 { | 491 { |
492 InspectorController* ic = inspectorController(); | 492 if (InspectorController* ic = inspectorController()) |
493 if (ic) { | 493 ic->drawHighlight(context); |
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 } | 494 } |
512 | 495 |
513 void WebDevToolsAgentImpl::highlight() | 496 void WebDevToolsAgentImpl::highlight() |
514 { | 497 { |
515 m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); | 498 m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); |
516 } | 499 } |
517 | 500 |
518 void WebDevToolsAgentImpl::hideHighlight() | 501 void WebDevToolsAgentImpl::hideHighlight() |
519 { | 502 { |
520 m_webViewImpl->removePageOverlay(this); | 503 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) | 596 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
614 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 597 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
615 } | 598 } |
616 | 599 |
617 void WebDevToolsAgent::processPendingMessages() | 600 void WebDevToolsAgent::processPendingMessages() |
618 { | 601 { |
619 PageScriptDebugServer::shared().runPendingTasks(); | 602 PageScriptDebugServer::shared().runPendingTasks(); |
620 } | 603 } |
621 | 604 |
622 } // namespace blink | 605 } // namespace blink |
OLD | NEW |