| OLD | NEW |
| 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_originalSlimmingPaintInvalidationEnabled(RuntimeEnabledFeatures::sli
mmingPaintInvalidationEnabled()) | 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()->getPaintController(); } |
| 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 { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |