| OLD | NEW |
| 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 "platform/testing/PaintPrinters.h" | 5 #include "platform/testing/PaintPrinters.h" |
| 6 | 6 |
| 7 #include "platform/graphics/paint/PaintChunk.h" | 7 #include "platform/graphics/paint/PaintChunk.h" |
| 8 #include "platform/graphics/paint/PaintChunkProperties.h" | 8 #include "platform/graphics/paint/PaintChunkProperties.h" |
| 9 #include <iomanip> // NOLINT | 9 #include <iomanip> // NOLINT |
| 10 #include <ostream> // NOLINT | 10 #include <ostream> // NOLINT |
| 11 | 11 |
| 12 namespace { | |
| 13 class StreamStateSaver : private std::ios { | |
| 14 WTF_MAKE_NONCOPYABLE(StreamStateSaver); | |
| 15 | |
| 16 public: | |
| 17 StreamStateSaver(std::ios& other) : std::ios(nullptr), m_other(other) { | |
| 18 copyfmt(other); | |
| 19 } | |
| 20 ~StreamStateSaver() { m_other.copyfmt(*this); } | |
| 21 | |
| 22 private: | |
| 23 std::ios& m_other; | |
| 24 }; | |
| 25 } // unnamed namespace | |
| 26 | |
| 27 namespace blink { | 12 namespace blink { |
| 28 | 13 |
| 29 void PrintTo(const PaintChunk& chunk, std::ostream* os) { | 14 void PrintTo(const PaintChunk& chunk, std::ostream* os) { |
| 30 *os << "PaintChunk(begin=" << chunk.begin_index << ", end=" << chunk.end_index | 15 *os << "PaintChunk(begin=" << chunk.begin_index << ", end=" << chunk.end_index |
| 31 << ", id="; | 16 << ", id="; |
| 32 if (!chunk.id) { | 17 if (!chunk.id) { |
| 33 *os << "null"; | 18 *os << "null"; |
| 34 } else { | 19 } else { |
| 35 *os << "(" << &chunk.id->client << ", "; | 20 *os << "(" << &chunk.id->client << ", "; |
| 36 #ifndef NDEBUG | 21 #ifndef NDEBUG |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 84 |
| 100 void PrintTo(const EffectPaintPropertyNode& node, std::ostream* os) { | 85 void PrintTo(const EffectPaintPropertyNode& node, std::ostream* os) { |
| 101 *os << "EffectPaintPropertyNode(" << node.ToString().Ascii().data() << ")"; | 86 *os << "EffectPaintPropertyNode(" << node.ToString().Ascii().data() << ")"; |
| 102 } | 87 } |
| 103 | 88 |
| 104 void PrintTo(const ScrollPaintPropertyNode& node, std::ostream* os) { | 89 void PrintTo(const ScrollPaintPropertyNode& node, std::ostream* os) { |
| 105 *os << "ScrollPaintPropertyNode(" << node.ToString().Ascii().data() << ")"; | 90 *os << "ScrollPaintPropertyNode(" << node.ToString().Ascii().data() << ")"; |
| 106 } | 91 } |
| 107 | 92 |
| 108 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |