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

Side by Side Diff: Source/platform/graphics/GraphicsLayerDebugInfo.cpp

Issue 135473002: Include debug name in GraphicsLayerDebugInfo. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 11 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/platform/graphics/GraphicsLayerDebugInfo.h ('k') | public/platform/WebLayerClient.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 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 19 matching lines...) Expand all
30 { 30 {
31 } 31 }
32 32
33 GraphicsLayerDebugInfo::~GraphicsLayerDebugInfo() { } 33 GraphicsLayerDebugInfo::~GraphicsLayerDebugInfo() { }
34 34
35 void GraphicsLayerDebugInfo::appendAsTraceFormat(blink::WebString* out) const 35 void GraphicsLayerDebugInfo::appendAsTraceFormat(blink::WebString* out) const
36 { 36 {
37 RefPtr<JSONObject> jsonObject = JSONObject::create(); 37 RefPtr<JSONObject> jsonObject = JSONObject::create();
38 appendLayoutRects(jsonObject.get()); 38 appendLayoutRects(jsonObject.get());
39 appendCompositingReasons(jsonObject.get()); 39 appendCompositingReasons(jsonObject.get());
40 appendDebugName(jsonObject.get());
40 *out = jsonObject->toJSONString(); 41 *out = jsonObject->toJSONString();
41 } 42 }
42 43
43 GraphicsLayerDebugInfo* GraphicsLayerDebugInfo::clone() const 44 GraphicsLayerDebugInfo* GraphicsLayerDebugInfo::clone() const
44 { 45 {
45 GraphicsLayerDebugInfo* toReturn = new GraphicsLayerDebugInfo(); 46 GraphicsLayerDebugInfo* toReturn = new GraphicsLayerDebugInfo();
46 for (size_t i = 0; i < m_currentLayoutRects.size(); ++i) 47 for (size_t i = 0; i < m_currentLayoutRects.size(); ++i)
47 toReturn->currentLayoutRects().append(m_currentLayoutRects[i]); 48 toReturn->currentLayoutRects().append(m_currentLayoutRects[i]);
48 toReturn->setCompositingReasons(m_compositingReasons); 49 toReturn->setCompositingReasons(m_compositingReasons);
49 return toReturn; 50 return toReturn;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 174
174 if (m_compositingReasons & CompositingReasonOutOfFlowClipping) 175 if (m_compositingReasons & CompositingReasonOutOfFlowClipping)
175 jsonArray->pushString("Has clipping ancestor"); 176 jsonArray->pushString("Has clipping ancestor");
176 177
177 if (m_compositingReasons & CompositingReasonIsolateCompositedDescendants) 178 if (m_compositingReasons & CompositingReasonIsolateCompositedDescendants)
178 jsonArray->pushString("Should isolate composited descendants"); 179 jsonArray->pushString("Should isolate composited descendants");
179 180
180 jsonObject->setArray("compositing_reasons", jsonArray); 181 jsonObject->setArray("compositing_reasons", jsonArray);
181 } 182 }
182 183
184 void GraphicsLayerDebugInfo::appendDebugName(JSONObject* jsonObject) const
185 {
186 if (m_debugName.isEmpty())
187 return;
188
189 jsonObject->setString("layer_name", m_debugName);
190 }
191
183 } // namespace WebCore 192 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsLayerDebugInfo.h ('k') | public/platform/WebLayerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698