| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/TestPaintArtifact.h" | 5 #include "platform/testing/TestPaintArtifact.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "platform/graphics/paint/DisplayItemClient.h" | 8 #include "platform/graphics/paint/DisplayItemClient.h" |
| 9 #include "platform/graphics/paint/DrawingDisplayItem.h" | 9 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 10 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" | 10 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 properties.transform = transform; | 56 properties.transform = transform; |
| 57 properties.clip = clip; | 57 properties.clip = clip; |
| 58 properties.effect = effect; | 58 properties.effect = effect; |
| 59 properties.scroll = scroll; | 59 properties.scroll = scroll; |
| 60 return chunk(properties); | 60 return chunk(properties); |
| 61 } | 61 } |
| 62 | 62 |
| 63 TestPaintArtifact& TestPaintArtifact::chunk( | 63 TestPaintArtifact& TestPaintArtifact::chunk( |
| 64 const PaintChunkProperties& properties) { | 64 const PaintChunkProperties& properties) { |
| 65 if (!m_paintChunks.isEmpty()) | 65 if (!m_paintChunks.isEmpty()) |
| 66 m_paintChunks.last().endIndex = m_displayItemList.size(); | 66 m_paintChunks.back().endIndex = m_displayItemList.size(); |
| 67 PaintChunk chunk; | 67 PaintChunk chunk; |
| 68 chunk.beginIndex = m_displayItemList.size(); | 68 chunk.beginIndex = m_displayItemList.size(); |
| 69 chunk.properties = properties; | 69 chunk.properties = properties; |
| 70 m_paintChunks.append(chunk); | 70 m_paintChunks.append(chunk); |
| 71 return *this; | 71 return *this; |
| 72 } | 72 } |
| 73 | 73 |
| 74 TestPaintArtifact& TestPaintArtifact::rectDrawing(const FloatRect& bounds, | 74 TestPaintArtifact& TestPaintArtifact::rectDrawing(const FloatRect& bounds, |
| 75 Color color) { | 75 Color color) { |
| 76 std::unique_ptr<DummyRectClient> client = | 76 std::unique_ptr<DummyRectClient> client = |
| (...skipping 16 matching lines...) Expand all Loading... |
| 93 size); | 93 size); |
| 94 m_dummyClients.append(std::move(client)); | 94 m_dummyClients.append(std::move(client)); |
| 95 return *this; | 95 return *this; |
| 96 } | 96 } |
| 97 | 97 |
| 98 const PaintArtifact& TestPaintArtifact::build() { | 98 const PaintArtifact& TestPaintArtifact::build() { |
| 99 if (m_built) | 99 if (m_built) |
| 100 return m_paintArtifact; | 100 return m_paintArtifact; |
| 101 | 101 |
| 102 if (!m_paintChunks.isEmpty()) | 102 if (!m_paintChunks.isEmpty()) |
| 103 m_paintChunks.last().endIndex = m_displayItemList.size(); | 103 m_paintChunks.back().endIndex = m_displayItemList.size(); |
| 104 m_paintArtifact = PaintArtifact(std::move(m_displayItemList), | 104 m_paintArtifact = PaintArtifact(std::move(m_displayItemList), |
| 105 std::move(m_paintChunks), true); | 105 std::move(m_paintChunks), true); |
| 106 m_built = true; | 106 m_built = true; |
| 107 return m_paintArtifact; | 107 return m_paintArtifact; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |