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

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

Issue 1288623004: Devtools: Remove continuous repainting feature (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 4 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/web/InspectorRenderingAgent.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "web/InspectorRenderingAgent.h" 6 #include "web/InspectorRenderingAgent.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/inspector/InspectorState.h" 10 #include "core/inspector/InspectorState.h"
11 #include "core/page/Page.h" 11 #include "core/page/Page.h"
12 #include "web/WebLocalFrameImpl.h" 12 #include "web/WebLocalFrameImpl.h"
13 #include "web/WebViewImpl.h" 13 #include "web/WebViewImpl.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 namespace RenderingAgentState { 17 namespace RenderingAgentState {
18 static const char continuousPaintingEnabled[] = "continuousPaintingEnabled";
19 static const char showDebugBorders[] = "showDebugBorders"; 18 static const char showDebugBorders[] = "showDebugBorders";
20 static const char showFPSCounter[] = "showFPSCounter"; 19 static const char showFPSCounter[] = "showFPSCounter";
21 static const char showPaintRects[] = "showPaintRects"; 20 static const char showPaintRects[] = "showPaintRects";
22 static const char showScrollBottleneckRects[] = "showScrollBottleneckRects"; 21 static const char showScrollBottleneckRects[] = "showScrollBottleneckRects";
23 } 22 }
24 23
25 PassOwnPtrWillBeRawPtr<InspectorRenderingAgent> InspectorRenderingAgent::create( WebViewImpl* webViewImpl) 24 PassOwnPtrWillBeRawPtr<InspectorRenderingAgent> InspectorRenderingAgent::create( WebViewImpl* webViewImpl)
26 { 25 {
27 return adoptPtrWillBeNoop(new InspectorRenderingAgent(webViewImpl)); 26 return adoptPtrWillBeNoop(new InspectorRenderingAgent(webViewImpl));
28 } 27 }
29 28
30 InspectorRenderingAgent::InspectorRenderingAgent(WebViewImpl* webViewImpl) 29 InspectorRenderingAgent::InspectorRenderingAgent(WebViewImpl* webViewImpl)
31 : InspectorBaseAgent<InspectorRenderingAgent, InspectorFrontend::Rendering>( "Rendering") 30 : InspectorBaseAgent<InspectorRenderingAgent, InspectorFrontend::Rendering>( "Rendering")
32 , m_webViewImpl(webViewImpl) 31 , m_webViewImpl(webViewImpl)
33 { 32 {
34 } 33 }
35 34
36 void InspectorRenderingAgent::restore() 35 void InspectorRenderingAgent::restore()
37 { 36 {
38 ErrorString error; 37 ErrorString error;
39 setContinuousPaintingEnabled(&error, m_state->getBoolean(RenderingAgentState ::continuousPaintingEnabled));
40 setShowDebugBorders(&error, m_state->getBoolean(RenderingAgentState::showDeb ugBorders)); 38 setShowDebugBorders(&error, m_state->getBoolean(RenderingAgentState::showDeb ugBorders));
41 setShowFPSCounter(&error, m_state->getBoolean(RenderingAgentState::showFPSCo unter)); 39 setShowFPSCounter(&error, m_state->getBoolean(RenderingAgentState::showFPSCo unter));
42 setShowPaintRects(&error, m_state->getBoolean(RenderingAgentState::showPaint Rects)); 40 setShowPaintRects(&error, m_state->getBoolean(RenderingAgentState::showPaint Rects));
43 setShowScrollBottleneckRects(&error, m_state->getBoolean(RenderingAgentState ::showScrollBottleneckRects)); 41 setShowScrollBottleneckRects(&error, m_state->getBoolean(RenderingAgentState ::showScrollBottleneckRects));
44 } 42 }
45 43
46 void InspectorRenderingAgent::disable(ErrorString*) 44 void InspectorRenderingAgent::disable(ErrorString*)
47 { 45 {
48 ErrorString error; 46 ErrorString error;
49 if (m_state->getBoolean(RenderingAgentState::continuousPaintingEnabled))
50 setContinuousPaintingEnabled(&error, false);
51 setShowDebugBorders(&error, false); 47 setShowDebugBorders(&error, false);
52 setShowFPSCounter(&error, false); 48 setShowFPSCounter(&error, false);
53 setShowPaintRects(&error, false); 49 setShowPaintRects(&error, false);
54 setShowScrollBottleneckRects(&error, false); 50 setShowScrollBottleneckRects(&error, false);
55 } 51 }
56 52
57 void InspectorRenderingAgent::setContinuousPaintingEnabled(ErrorString* errorStr ing, bool enabled)
58 {
59 m_state->setBoolean(RenderingAgentState::continuousPaintingEnabled, enabled) ;
60 if (enabled && !compositingEnabled(errorString))
61 return;
62 m_webViewImpl->setContinuousPaintingEnabled(enabled);
63 }
64
65 void InspectorRenderingAgent::setShowDebugBorders(ErrorString* errorString, bool show) 53 void InspectorRenderingAgent::setShowDebugBorders(ErrorString* errorString, bool show)
66 { 54 {
67 m_state->setBoolean(RenderingAgentState::showDebugBorders, show); 55 m_state->setBoolean(RenderingAgentState::showDebugBorders, show);
68 if (show && !compositingEnabled(errorString)) 56 if (show && !compositingEnabled(errorString))
69 return; 57 return;
70 m_webViewImpl->setShowDebugBorders(show); 58 m_webViewImpl->setShowDebugBorders(show);
71 } 59 }
72 60
73 void InspectorRenderingAgent::setShowFPSCounter(ErrorString* errorString, bool s how) 61 void InspectorRenderingAgent::setShowFPSCounter(ErrorString* errorString, bool s how)
74 { 62 {
(...skipping 28 matching lines...) Expand all
103 } 91 }
104 return true; 92 return true;
105 } 93 }
106 94
107 DEFINE_TRACE(InspectorRenderingAgent) 95 DEFINE_TRACE(InspectorRenderingAgent)
108 { 96 {
109 InspectorBaseAgent::trace(visitor); 97 InspectorBaseAgent::trace(visitor);
110 } 98 }
111 99
112 } // namespace blink 100 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/InspectorRenderingAgent.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698