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

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

Issue 659003002: annotatedInvalidationRects should be in format x,y,w,h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 void GraphicsLayerDebugInfo::appendLayoutRects(JSONObject* jsonObject) const 60 void GraphicsLayerDebugInfo::appendLayoutRects(JSONObject* jsonObject) const
61 { 61 {
62 RefPtr<JSONArray> jsonArray = JSONArray::create(); 62 RefPtr<JSONArray> jsonArray = JSONArray::create();
63 for (size_t i = 0; i < m_currentLayoutRects.size(); i++) { 63 for (size_t i = 0; i < m_currentLayoutRects.size(); i++) {
64 const LayoutRect& rect = m_currentLayoutRects[i]; 64 const LayoutRect& rect = m_currentLayoutRects[i];
65 RefPtr<JSONObject> rectContainer = JSONObject::create(); 65 RefPtr<JSONObject> rectContainer = JSONObject::create();
66 RefPtr<JSONArray> rectArray = JSONArray::create(); 66 RefPtr<JSONArray> rectArray = JSONArray::create();
67 rectArray->pushNumber(rect.x().toFloat()); 67 rectArray->pushNumber(rect.x().toFloat());
68 rectArray->pushNumber(rect.y().toFloat()); 68 rectArray->pushNumber(rect.y().toFloat());
69 rectArray->pushNumber(rect.maxX().toFloat()); 69 rectArray->pushNumber(rect.width().toFloat());
70 rectArray->pushNumber(rect.maxY().toFloat()); 70 rectArray->pushNumber(rect.height().toFloat());
71 rectContainer->setArray("geometry_rect", rectArray); 71 rectContainer->setArray("geometry_rect", rectArray);
72 jsonArray->pushObject(rectContainer); 72 jsonArray->pushObject(rectContainer);
73 } 73 }
74 jsonObject->setArray("layout_rects", jsonArray); 74 jsonObject->setArray("layout_rects", jsonArray);
75 } 75 }
76 76
77 void GraphicsLayerDebugInfo::appendAnnotatedInvalidateRects(JSONObject* jsonObje ct) const 77 void GraphicsLayerDebugInfo::appendAnnotatedInvalidateRects(JSONObject* jsonObje ct) const
78 { 78 {
79 RefPtr<JSONArray> jsonArray = JSONArray::create(); 79 RefPtr<JSONArray> jsonArray = JSONArray::create();
80 for (const auto& annotatedRect : m_previousInvalidations) { 80 for (const auto& annotatedRect : m_previousInvalidations) {
81 RefPtr<JSONObject> rectContainer = JSONObject::create(); 81 RefPtr<JSONObject> rectContainer = JSONObject::create();
82 RefPtr<JSONArray> rectArray = JSONArray::create(); 82 RefPtr<JSONArray> rectArray = JSONArray::create();
83 const FloatRect& rect = annotatedRect.rect; 83 const FloatRect& rect = annotatedRect.rect;
84 rectArray->pushNumber(rect.x()); 84 rectArray->pushNumber(rect.x());
85 rectArray->pushNumber(rect.y()); 85 rectArray->pushNumber(rect.y());
86 rectArray->pushNumber(rect.maxX()); 86 rectArray->pushNumber(rect.maxX());
87 rectArray->pushNumber(rect.maxY()); 87 rectArray->pushNumber(rect.maxY());
Xianzhu 2014/10/16 15:48:51 Should these be also width and height? What will
88 rectContainer->setArray("geometry_rect", rectArray); 88 rectContainer->setArray("geometry_rect", rectArray);
89 rectContainer->setString("reason", paintInvalidationReasonToString(annot atedRect.reason)); 89 rectContainer->setString("reason", paintInvalidationReasonToString(annot atedRect.reason));
90 jsonArray->pushObject(rectContainer); 90 jsonArray->pushObject(rectContainer);
91 } 91 }
92 jsonObject->setArray("annotated_invalidation_rects", jsonArray); 92 jsonObject->setArray("annotated_invalidation_rects", jsonArray);
93 } 93 }
94 94
95 void GraphicsLayerDebugInfo::appendCompositingReasons(JSONObject* jsonObject) co nst 95 void GraphicsLayerDebugInfo::appendCompositingReasons(JSONObject* jsonObject) co nst
96 { 96 {
97 RefPtr<JSONArray> jsonArray = JSONArray::create(); 97 RefPtr<JSONArray> jsonArray = JSONArray::create();
(...skipping 30 matching lines...) Expand all
128 m_invalidations.append(annotatedRect); 128 m_invalidations.append(annotatedRect);
129 } 129 }
130 130
131 void GraphicsLayerDebugInfo::clearAnnotatedInvalidateRects() 131 void GraphicsLayerDebugInfo::clearAnnotatedInvalidateRects()
132 { 132 {
133 m_previousInvalidations.clear(); 133 m_previousInvalidations.clear();
134 m_previousInvalidations.swap(m_invalidations); 134 m_previousInvalidations.swap(m_invalidations);
135 } 135 }
136 136
137 } // namespace blink 137 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698