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

Side by Side Diff: Source/platform/graphics/paint/DisplayItemTransformTreeBuilderTest.cpp

Issue 1011703005: [Slimming Paint] Allow 3D transforms of different types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: debug strings Created 5 years, 9 months 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 | Annotate | Revision Log
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h" 6 #include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h"
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "platform/graphics/paint/DisplayItemClient.h" 9 #include "platform/graphics/paint/DisplayItemClient.h"
10 #include "platform/graphics/paint/DisplayItemTransformTree.h" 10 #include "platform/graphics/paint/DisplayItemTransformTree.h"
(...skipping 18 matching lines...) Expand all
29 class DisplayItemTransformTreeBuilderTest : public ::testing::Test { 29 class DisplayItemTransformTreeBuilderTest : public ::testing::Test {
30 protected: 30 protected:
31 DisplayItemTransformTreeBuilder& builder() { return m_builder; } 31 DisplayItemTransformTreeBuilder& builder() { return m_builder; }
32 32
33 void processDisplayItem(const DisplayItem& displayItem) { m_builder.processD isplayItem(displayItem); } 33 void processDisplayItem(const DisplayItem& displayItem) { m_builder.processD isplayItem(displayItem); }
34 void processDisplayItem(PassOwnPtr<DisplayItem> displayItem) { processDispla yItem(*displayItem); } 34 void processDisplayItem(PassOwnPtr<DisplayItem> displayItem) { processDispla yItem(*displayItem); }
35 void processDummyDisplayItem() { processDisplayItem(DummyDisplayItem::create (newDummyClient())); } 35 void processDummyDisplayItem() { processDisplayItem(DummyDisplayItem::create (newDummyClient())); }
36 DisplayItemClient processBeginTransform3D(const TransformationMatrix& transf orm) 36 DisplayItemClient processBeginTransform3D(const TransformationMatrix& transf orm)
37 { 37 {
38 DisplayItemClient client = newDummyClient(); 38 DisplayItemClient client = newDummyClient();
39 processDisplayItem(BeginTransform3DDisplayItem::create(client, transform )); 39 processDisplayItem(BeginTransform3DDisplayItem::create(client, DisplayIt em::Transform3DElementTransform, transform));
40 return client; 40 return client;
41 } 41 }
42 void processEndTransform3D(DisplayItemClient client) { processDisplayItem(En dTransform3DDisplayItem::create(client)); } 42 void processEndTransform3D(DisplayItemClient client)
43 {
44 processDisplayItem(EndTransform3DDisplayItem::create(client, DisplayItem ::transform3DTypeToEndTransform3DType(DisplayItem::Transform3DElementTransform)) );
45 }
43 46
44 private: 47 private:
45 struct DummyClient { }; 48 struct DummyClient { };
46 49
47 // This makes empty objects which can be used as display item clients. 50 // This makes empty objects which can be used as display item clients.
48 DisplayItemClient newDummyClient() 51 DisplayItemClient newDummyClient()
49 { 52 {
50 m_dummyClients.append(adoptPtr(new DummyClient)); 53 m_dummyClients.append(adoptPtr(new DummyClient));
51 return toDisplayItemClient(m_dummyClients.last().get()); 54 return toDisplayItemClient(m_dummyClients.last().get());
52 } 55 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 WebDisplayItemTransformTree tree(builder().releaseTransformTree()); 282 WebDisplayItemTransformTree tree(builder().releaseTransformTree());
280 283
281 const auto& transformNode = tree.nodeAt(tree.rangeRecordAt(0).transformNodeI ndex); 284 const auto& transformNode = tree.nodeAt(tree.rangeRecordAt(0).transformNodeI ndex);
282 ASSERT_FALSE(transformNode.isRoot()); 285 ASSERT_FALSE(transformNode.isRoot());
283 EXPECT_TRANSFORMS_ALMOST_EQ(matrix2, transformNode.matrix); 286 EXPECT_TRANSFORMS_ALMOST_EQ(matrix2, transformNode.matrix);
284 EXPECT_TRANSFORMS_ALMOST_EQ(matrix1, tree.parentNode(transformNode).matrix); 287 EXPECT_TRANSFORMS_ALMOST_EQ(matrix1, tree.parentNode(transformNode).matrix);
285 } 288 }
286 289
287 } // namespace 290 } // namespace
288 } // namespace blink 291 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698