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

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

Issue 1203343002: WIP for display item list backed by ListContainer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/DisplayItemList.h" 6 #include "platform/graphics/paint/DisplayItemList.h"
7 7
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/paint/ClipPathRecorder.h" 10 #include "platform/graphics/paint/ClipPathRecorder.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 51 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
52 String debugName() const { return m_name; } 52 String debugName() const { return m_name; }
53 53
54 private: 54 private:
55 String m_name; 55 String m_name;
56 }; 56 };
57 57
58 class TestDisplayItem : public DisplayItem { 58 class TestDisplayItem : public DisplayItem {
59 public: 59 public:
60 TestDisplayItem(const DisplayItemClientWrapper& client, Type type) : Display Item(client, type) { } 60 TestDisplayItem(TestDisplayItemClient& client, Type type)
61 {
62 DisplayItemClientWrapper clientWrapper(client);
63 setClientAndType(clientWrapper, type);
64 }
61 65
62 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED(); } 66 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED(); }
63 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { ASSERT_NOT_REACHED(); } 67 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { ASSERT_NOT_REACHED(); }
64 }; 68 };
65 69
66 #ifndef NDEBUG 70 #ifndef NDEBUG
67 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \ 71 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \
68 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \ 72 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \
69 SCOPED_TRACE(trace.utf8().data()); 73 SCOPED_TRACE(trace.utf8().data());
70 #else 74 #else
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100)); 699 drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
696 displayItemList().commitNewDisplayItems(); 700 displayItemList().commitNewDisplayItems();
697 701
698 // Empty clips should have been optimized out. 702 // Empty clips should have been optimized out.
699 EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2, 703 EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
700 TestDisplayItem(first, backgroundDrawingType), 704 TestDisplayItem(first, backgroundDrawingType),
701 TestDisplayItem(third, backgroundDrawingType)); 705 TestDisplayItem(third, backgroundDrawingType));
702 } 706 }
703 707
704 } // namespace blink 708 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698