Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(976)

Side by Side Diff: third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 TestPaintArtifact::TestPaintArtifact() : m_displayItemList(0), m_built(false) {} 46 TestPaintArtifact::TestPaintArtifact() : m_displayItemList(0), m_built(false) {}
47 47
48 TestPaintArtifact::~TestPaintArtifact() {} 48 TestPaintArtifact::~TestPaintArtifact() {}
49 49
50 TestPaintArtifact& TestPaintArtifact::chunk( 50 TestPaintArtifact& TestPaintArtifact::chunk(
51 PassRefPtr<TransformPaintPropertyNode> transform, 51 PassRefPtr<TransformPaintPropertyNode> transform,
52 PassRefPtr<ClipPaintPropertyNode> clip, 52 PassRefPtr<ClipPaintPropertyNode> clip,
53 PassRefPtr<EffectPaintPropertyNode> effect, 53 PassRefPtr<EffectPaintPropertyNode> effect,
54 PassRefPtr<ScrollPaintPropertyNode> scroll) { 54 PassRefPtr<ScrollPaintPropertyNode> scroll) {
55 PaintChunkProperties properties; 55 PropertyTreeState propertyTreeState(transform.get(), clip.get(), effect.get(),
56 properties.transform = transform; 56 scroll.get());
57 properties.clip = clip; 57 PaintChunkProperties properties(propertyTreeState);
58 properties.effect = effect;
59 properties.scroll = scroll;
60 return chunk(properties); 58 return chunk(properties);
61 } 59 }
62 60
63 TestPaintArtifact& TestPaintArtifact::chunk( 61 TestPaintArtifact& TestPaintArtifact::chunk(
64 const PaintChunkProperties& properties) { 62 const PaintChunkProperties& properties) {
65 if (!m_paintChunks.isEmpty()) 63 if (!m_paintChunks.isEmpty())
66 m_paintChunks.back().endIndex = m_displayItemList.size(); 64 m_paintChunks.back().endIndex = m_displayItemList.size();
67 PaintChunk chunk; 65 PaintChunk chunk;
68 chunk.beginIndex = m_displayItemList.size(); 66 chunk.beginIndex = m_displayItemList.size();
69 chunk.properties = properties; 67 chunk.properties = properties;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 99
102 if (!m_paintChunks.isEmpty()) 100 if (!m_paintChunks.isEmpty())
103 m_paintChunks.back().endIndex = m_displayItemList.size(); 101 m_paintChunks.back().endIndex = m_displayItemList.size();
104 m_paintArtifact = PaintArtifact(std::move(m_displayItemList), 102 m_paintArtifact = PaintArtifact(std::move(m_displayItemList),
105 std::move(m_paintChunks), true); 103 std::move(m_paintChunks), true);
106 m_built = true; 104 m_built = true;
107 return m_paintArtifact; 105 return m_paintArtifact;
108 } 106 }
109 107
110 } // namespace blink 108 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698