| 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 #ifndef TestPaintArtifact_h | 5 #ifndef TestPaintArtifact_h |
| 6 #define TestPaintArtifact_h | 6 #define TestPaintArtifact_h |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "platform/graphics/Color.h" | 9 #include "platform/graphics/Color.h" |
| 10 #include "platform/graphics/paint/DisplayItemList.h" | 10 #include "platform/graphics/paint/DisplayItemList.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // .rectDrawing(bounds3, color3); | 40 // .rectDrawing(bounds3, color3); |
| 41 // doSomethingWithArtifact(artifact); | 41 // doSomethingWithArtifact(artifact); |
| 42 class TestPaintArtifact { | 42 class TestPaintArtifact { |
| 43 STACK_ALLOCATED(); | 43 STACK_ALLOCATED(); |
| 44 | 44 |
| 45 public: | 45 public: |
| 46 TestPaintArtifact(); | 46 TestPaintArtifact(); |
| 47 ~TestPaintArtifact(); | 47 ~TestPaintArtifact(); |
| 48 | 48 |
| 49 // Add to the artifact. | 49 // Add to the artifact. |
| 50 TestPaintArtifact& chunk( | 50 TestPaintArtifact& chunk(PassRefPtr<const TransformPaintPropertyNode>, |
| 51 PassRefPtr<TransformPaintPropertyNode>, | 51 PassRefPtr<const ClipPaintPropertyNode>, |
| 52 PassRefPtr<ClipPaintPropertyNode>, | 52 PassRefPtr<const EffectPaintPropertyNode>); |
| 53 PassRefPtr<EffectPaintPropertyNode>, | |
| 54 PassRefPtr<ScrollPaintPropertyNode> = ScrollPaintPropertyNode::root()); | |
| 55 TestPaintArtifact& chunk(const PaintChunkProperties&); | 53 TestPaintArtifact& chunk(const PaintChunkProperties&); |
| 56 TestPaintArtifact& rectDrawing(const FloatRect& bounds, Color); | 54 TestPaintArtifact& rectDrawing(const FloatRect& bounds, Color); |
| 57 TestPaintArtifact& foreignLayer(const FloatPoint&, | 55 TestPaintArtifact& foreignLayer(const FloatPoint&, |
| 58 const IntSize&, | 56 const IntSize&, |
| 59 scoped_refptr<cc::Layer>); | 57 scoped_refptr<cc::Layer>); |
| 60 | 58 |
| 61 // Can't add more things once this is called. | 59 // Can't add more things once this is called. |
| 62 const PaintArtifact& build(); | 60 const PaintArtifact& build(); |
| 63 | 61 |
| 64 private: | 62 private: |
| 65 class DummyRectClient; | 63 class DummyRectClient; |
| 66 Vector<std::unique_ptr<DummyRectClient>> m_dummyClients; | 64 Vector<std::unique_ptr<DummyRectClient>> m_dummyClients; |
| 67 | 65 |
| 68 // Exists if m_built is false. | 66 // Exists if m_built is false. |
| 69 DisplayItemList m_displayItemList; | 67 DisplayItemList m_displayItemList; |
| 70 Vector<PaintChunk> m_paintChunks; | 68 Vector<PaintChunk> m_paintChunks; |
| 71 | 69 |
| 72 // Exists if m_built is true. | 70 // Exists if m_built is true. |
| 73 PaintArtifact m_paintArtifact; | 71 PaintArtifact m_paintArtifact; |
| 74 | 72 |
| 75 bool m_built; | 73 bool m_built; |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 } // namespace blink | 76 } // namespace blink |
| 79 | 77 |
| 80 #endif // TestPaintArtifact_h | 78 #endif // TestPaintArtifact_h |
| OLD | NEW |