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 <memory> | 7 #include <memory> |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "platform/graphics/paint/DisplayItemClient.h" | 9 #include "platform/graphics/paint/DisplayItemClient.h" |
10 #include "platform/graphics/paint/DrawingDisplayItem.h" | 10 #include "platform/graphics/paint/DrawingDisplayItem.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 chunk.properties = properties; | 66 chunk.properties = properties; |
67 paint_chunks_.push_back(chunk); | 67 paint_chunks_.push_back(chunk); |
68 return *this; | 68 return *this; |
69 } | 69 } |
70 | 70 |
71 TestPaintArtifact& TestPaintArtifact::RectDrawing(const FloatRect& bounds, | 71 TestPaintArtifact& TestPaintArtifact::RectDrawing(const FloatRect& bounds, |
72 Color color) { | 72 Color color) { |
73 std::unique_ptr<DummyRectClient> client = | 73 std::unique_ptr<DummyRectClient> client = |
74 WTF::MakeUnique<DummyRectClient>(bounds, color); | 74 WTF::MakeUnique<DummyRectClient>(bounds, color); |
75 display_item_list_.AllocateAndConstruct<DrawingDisplayItem>( | 75 display_item_list_.AllocateAndConstruct<DrawingDisplayItem>( |
76 *client, DisplayItem::kDrawingFirst, client->MakeRecord()); | 76 *client, DisplayItem::kDrawingFirst, client->MakeRecord(), bounds); |
77 dummy_clients_.push_back(std::move(client)); | 77 dummy_clients_.push_back(std::move(client)); |
78 return *this; | 78 return *this; |
79 } | 79 } |
80 | 80 |
81 TestPaintArtifact& TestPaintArtifact::ForeignLayer( | 81 TestPaintArtifact& TestPaintArtifact::ForeignLayer( |
82 const FloatPoint& location, | 82 const FloatPoint& location, |
83 const IntSize& size, | 83 const IntSize& size, |
84 scoped_refptr<cc::Layer> layer) { | 84 scoped_refptr<cc::Layer> layer) { |
85 FloatRect float_bounds(location, FloatSize(size)); | 85 FloatRect float_bounds(location, FloatSize(size)); |
86 std::unique_ptr<DummyRectClient> client = | 86 std::unique_ptr<DummyRectClient> client = |
(...skipping 11 matching lines...) Expand all Loading... |
98 | 98 |
99 if (!paint_chunks_.IsEmpty()) | 99 if (!paint_chunks_.IsEmpty()) |
100 paint_chunks_.back().end_index = display_item_list_.size(); | 100 paint_chunks_.back().end_index = display_item_list_.size(); |
101 paint_artifact_ = PaintArtifact(std::move(display_item_list_), | 101 paint_artifact_ = PaintArtifact(std::move(display_item_list_), |
102 std::move(paint_chunks_), true); | 102 std::move(paint_chunks_), true); |
103 built_ = true; | 103 built_ = true; |
104 return paint_artifact_; | 104 return paint_artifact_; |
105 } | 105 } |
106 | 106 |
107 } // namespace blink | 107 } // namespace blink |
OLD | NEW |