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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Issue 2119033003: Fix alignment issue of ContiguousContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 "platform/graphics/paint/PaintController.h" 5 #include "platform/graphics/paint/PaintController.h"
6 6
7 #include "platform/RuntimeEnabledFeatures.h" 7 #include "platform/RuntimeEnabledFeatures.h"
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/paint/CachedDisplayItem.h" 9 #include "platform/graphics/paint/CachedDisplayItem.h"
10 #include "platform/graphics/paint/ClipPathDisplayItem.h" 10 #include "platform/graphics/paint/ClipPathDisplayItem.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 std::unique_ptr<PaintController> m_paintController; 42 std::unique_ptr<PaintController> m_paintController;
43 bool m_originalSlimmingPaintV2Enabled; 43 bool m_originalSlimmingPaintV2Enabled;
44 }; 44 };
45 45
46 const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(D isplayItem::DrawingPaintPhaseFirst + 4); 46 const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(D isplayItem::DrawingPaintPhaseFirst + 4);
47 const DisplayItem::Type backgroundDrawingType = DisplayItem::DrawingPaintPhaseFi rst; 47 const DisplayItem::Type backgroundDrawingType = DisplayItem::DrawingPaintPhaseFi rst;
48 const DisplayItem::Type clipType = DisplayItem::ClipFirst; 48 const DisplayItem::Type clipType = DisplayItem::ClipFirst;
49 49
50 class TestDisplayItem final : public DisplayItem { 50 class TestDisplayItem final : public DisplayItemBase<TestDisplayItem> {
51 public: 51 public:
52 TestDisplayItem(const FakeDisplayItemClient& client, Type type) : DisplayIte m(client, type, sizeof(*this)) { } 52 TestDisplayItem(const FakeDisplayItemClient& client, Type type)
53 : DisplayItemBase(client, type) { }
53 54
54 void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); } 55 void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
55 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const f inal { ASSERT_NOT_REACHED(); } 56 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const f inal { ASSERT_NOT_REACHED(); }
56 }; 57 };
57 58
58 #ifndef NDEBUG 59 #ifndef NDEBUG
59 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \ 60 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \
60 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \ 61 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \
61 SCOPED_TRACE(trace.utf8().data()); 62 SCOPED_TRACE(trace.utf8().data());
62 #else 63 #else
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 getPaintController().createAndAppend<BeginClipPathDisplayItem>(clien t, path); 927 getPaintController().createAndAppend<BeginClipPathDisplayItem>(clien t, path);
927 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 10 0)); 928 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 10 0));
928 for (int j = 0; j < 50; ++j) 929 for (int j = 0; j < 50; ++j)
929 getPaintController().createAndAppend<EndClipPathDisplayItem>(client) ; 930 getPaintController().createAndAppend<EndClipPathDisplayItem>(client) ;
930 getPaintController().commitNewDisplayItems(LayoutSize()); 931 getPaintController().commitNewDisplayItems(LayoutSize());
931 EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRaster ization()); 932 EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRaster ization());
932 } 933 }
933 } 934 }
934 935
935 } // namespace blink 936 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698