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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h

Issue 1755853002: Remove old paint offset caching code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
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 #ifndef PaintControllerPaintTest_h 5 #ifndef PaintControllerPaintTest_h
6 #define PaintControllerPaintTest_h 6 #define PaintControllerPaintTest_h
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/layout/LayoutTestHelper.h" 9 #include "core/layout/LayoutTestHelper.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
11 #include "core/paint/PaintLayer.h" 11 #include "core/paint/PaintLayer.h"
12 #include "platform/graphics/GraphicsContext.h" 12 #include "platform/graphics/GraphicsContext.h"
13 #include "platform/graphics/GraphicsLayer.h" 13 #include "platform/graphics/GraphicsLayer.h"
14 #include <gtest/gtest.h> 14 #include <gtest/gtest.h>
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class PaintControllerPaintTestBase : public RenderingTest { 18 class PaintControllerPaintTestBase : public RenderingTest {
19 public: 19 public:
20 PaintControllerPaintTestBase(bool enableSlimmingPaintV2) 20 PaintControllerPaintTestBase(bool enableSlimmingPaintV2)
21 : m_originalSlimmingPaintOffsetCachingEnabled(RuntimeEnabledFeatures::sl immingPaintOffsetCachingEnabled()) 21 : m_originalSlimmingPaintInvalidationEnabled(RuntimeEnabledFeatures::sli mmingPaintInvalidationEnabled())
22 , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint V2Enabled()) 22 , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint V2Enabled())
23 , m_enableSlimmingPaintV2(enableSlimmingPaintV2) 23 , m_enableSlimmingPaintV2(enableSlimmingPaintV2)
24 { } 24 { }
25 25
26 protected: 26 protected:
27 LayoutView& layoutView() { return *document().layoutView(); } 27 LayoutView& layoutView() { return *document().layoutView(); }
28 PaintController& rootPaintController() { return layoutView().layer()->graphi csLayerBacking()->paintController(); } 28 PaintController& rootPaintController() { return layoutView().layer()->graphi csLayerBacking()->paintController(); }
29 29
30 void SetUp() override 30 void SetUp() override
31 { 31 {
32 RenderingTest::SetUp(); 32 RenderingTest::SetUp();
33 enableCompositing(); 33 enableCompositing();
34 GraphicsLayer::setDrawDebugRedFillForTesting(false); 34 GraphicsLayer::setDrawDebugRedFillForTesting(false);
35 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_enableSlimmingPaintV 2); 35 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_enableSlimmingPaintV 2);
36 } 36 }
37 void TearDown() override 37 void TearDown() override
38 { 38 {
39 RuntimeEnabledFeatures::setSlimmingPaintOffsetCachingEnabled(m_originalS limmingPaintOffsetCachingEnabled); 39 RuntimeEnabledFeatures::setSlimmingPaintInvalidationEnabled(m_originalSl immingPaintInvalidationEnabled);
40 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPain tV2Enabled); 40 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPain tV2Enabled);
41 GraphicsLayer::setDrawDebugRedFillForTesting(true); 41 GraphicsLayer::setDrawDebugRedFillForTesting(true);
42 } 42 }
43 43
44 // Expose some document lifecycle steps for checking new display items befor e commiting. 44 // Expose some document lifecycle steps for checking new display items befor e commiting.
45 void updateLifecyclePhasesBeforePaint() 45 void updateLifecyclePhasesBeforePaint()
46 { 46 {
47 // This doesn't do all steps that FrameView does, but is enough for curr ent tests. 47 // This doesn't do all steps that FrameView does, but is enough for curr ent tests.
48 FrameView* frameView = document().view(); 48 FrameView* frameView = document().view();
49 frameView->updateLifecyclePhasesInternal(FrameView::OnlyUpToCompositingC leanPlusScrolling); 49 frameView->updateLifecyclePhasesInternal(FrameView::OnlyUpToCompositingC leanPlusScrolling);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool displayItemListContains(const DisplayItemList& displayItemList, Display ItemClient& client, DisplayItem::Type type) 86 bool displayItemListContains(const DisplayItemList& displayItemList, Display ItemClient& client, DisplayItem::Type type)
87 { 87 {
88 for (auto& item : displayItemList) { 88 for (auto& item : displayItemList) {
89 if (item.client() == client && item.getType() == type) 89 if (item.client() == client && item.getType() == type)
90 return true; 90 return true;
91 } 91 }
92 return false; 92 return false;
93 } 93 }
94 94
95 private: 95 private:
96 bool m_originalSlimmingPaintOffsetCachingEnabled; 96 bool m_originalSlimmingPaintInvalidationEnabled;
97 bool m_originalSlimmingPaintV2Enabled; 97 bool m_originalSlimmingPaintV2Enabled;
98 bool m_enableSlimmingPaintV2; 98 bool m_enableSlimmingPaintV2;
99 }; 99 };
100 100
101 class PaintControllerPaintTest : public PaintControllerPaintTestBase { 101 class PaintControllerPaintTest : public PaintControllerPaintTestBase {
102 public: 102 public:
103 PaintControllerPaintTest() : PaintControllerPaintTestBase(false) { } 103 PaintControllerPaintTest() : PaintControllerPaintTestBase(false) { }
104 }; 104 };
105 105
106 class PaintControllerPaintTestForSlimmingPaintV2 : public PaintControllerPaintTe stBase { 106 class PaintControllerPaintTestForSlimmingPaintV2 : public PaintControllerPaintTe stBase {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground; 148 const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground;
149 const DisplayItem::Type cachedBackgroundType = DisplayItem::drawingTypeToCachedD rawingType(backgroundType); 149 const DisplayItem::Type cachedBackgroundType = DisplayItem::drawingTypeToCachedD rawingType(backgroundType);
150 const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground); 150 const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground);
151 const DisplayItem::Type cachedForegroundType = DisplayItem::drawingTypeToCachedD rawingType(foregroundType); 151 const DisplayItem::Type cachedForegroundType = DisplayItem::drawingTypeToCachedD rawingType(foregroundType);
152 const DisplayItem::Type documentBackgroundType = DisplayItem::DocumentBackground ; 152 const DisplayItem::Type documentBackgroundType = DisplayItem::DocumentBackground ;
153 const DisplayItem::Type cachedDocumentBackgroundType = DisplayItem::drawingTypeT oCachedDrawingType(DisplayItem::DocumentBackground); 153 const DisplayItem::Type cachedDocumentBackgroundType = DisplayItem::drawingTypeT oCachedDrawingType(DisplayItem::DocumentBackground);
154 154
155 } // namespace blink 155 } // namespace blink
156 156
157 #endif // PaintControllerPaintTest_h 157 #endif // PaintControllerPaintTest_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698