OLD | NEW |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.width()); |
87 rectArray->pushNumber(rect.maxY()); | 87 rectArray->pushNumber(rect.height()); |
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 Loading... |
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 |
OLD | NEW |