| Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| index 870d85020dfa3b34a77ff175a81c864b62efc20d..90b33c04bc75a1046b050b0e99c88bc8ce4e684f 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| @@ -14,15 +14,18 @@
|
| #include "platform/graphics/paint/DrawingRecorder.h"
|
| #include "platform/graphics/paint/SubsequenceRecorder.h"
|
| #include "platform/testing/FakeDisplayItemClient.h"
|
| +#include "platform/testing/PaintPropertyTestHelpers.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include <memory>
|
|
|
| +using blink::testing::createOpacityOnlyEffect;
|
| +using blink::testing::defaultPaintChunkProperties;
|
| using testing::UnorderedElementsAre;
|
|
|
| namespace blink {
|
|
|
| -class PaintControllerTestBase : public testing::Test {
|
| +class PaintControllerTestBase : public ::testing::Test {
|
| public:
|
| PaintControllerTestBase() : m_paintController(PaintController::create()) {}
|
|
|
| @@ -54,15 +57,6 @@ class PaintControllerTestBase : public testing::Test {
|
| RuntimeEnabledFeatures::Backup m_featuresBackup;
|
| };
|
|
|
| -PaintChunkProperties rootPaintChunkProperties() {
|
| - PaintChunkProperties rootProperties;
|
| - rootProperties.transform = TransformPaintPropertyNode::root();
|
| - rootProperties.clip = ClipPaintPropertyNode::root();
|
| - rootProperties.effect = EffectPaintPropertyNode::root();
|
| - rootProperties.scroll = ScrollPaintPropertyNode::root();
|
| - return rootProperties;
|
| -}
|
| -
|
| const DisplayItem::Type foregroundDrawingType =
|
| static_cast<DisplayItem::Type>(DisplayItem::kDrawingPaintPhaseFirst + 4);
|
| const DisplayItem::Type backgroundDrawingType =
|
| @@ -136,7 +130,7 @@ enum TestConfigurations {
|
| // enabled and disabled.
|
| class PaintControllerTest
|
| : public PaintControllerTestBase,
|
| - public testing::WithParamInterface<TestConfigurations> {
|
| + public ::testing::WithParamInterface<TestConfigurations> {
|
| public:
|
| PaintControllerTest()
|
| : m_rootPaintPropertyClient("root"),
|
| @@ -177,7 +171,7 @@ TEST_P(PaintControllerTest, NestedRecorders) {
|
| FakeDisplayItemClient client("client", LayoutRect(100, 100, 200, 200));
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawClippedRect(context, client, clipType, backgroundDrawingType,
|
| @@ -203,7 +197,7 @@ TEST_P(PaintControllerTest, UpdateBasic) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -228,7 +222,7 @@ TEST_P(PaintControllerTest, UpdateBasic) {
|
| UnorderedElementsAre(FloatRect(LayoutRect::infiniteIntRect())));
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -265,7 +259,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrder) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -292,7 +286,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrder) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| drawRect(context, second, backgroundDrawingType,
|
| FloatRect(100, 100, 50, 200));
|
| @@ -339,7 +333,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithInvalidation) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -366,7 +360,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithInvalidation) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| first.setDisplayItemsUncached();
|
| @@ -418,7 +412,7 @@ TEST_P(PaintControllerTest, UpdateNewItemInMiddle) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -433,7 +427,7 @@ TEST_P(PaintControllerTest, UpdateNewItemInMiddle) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -472,7 +466,7 @@ TEST_P(PaintControllerTest, UpdateInvalidationWithPhases) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -497,7 +491,7 @@ TEST_P(PaintControllerTest, UpdateInvalidationWithPhases) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| second.setDisplayItemsUncached();
|
| @@ -544,7 +538,7 @@ TEST_P(PaintControllerTest, UpdateAddFirstOverlap) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
|
| @@ -557,7 +551,7 @@ TEST_P(PaintControllerTest, UpdateAddFirstOverlap) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| first.setDisplayItemsUncached();
|
| @@ -590,7 +584,7 @@ TEST_P(PaintControllerTest, UpdateAddFirstOverlap) {
|
| FloatRect(150, 150, 100, 100))); // New bounds of |second|.
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, second, backgroundDrawingType,
|
| @@ -626,7 +620,7 @@ TEST_P(PaintControllerTest, UpdateAddLastOverlap) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -641,7 +635,7 @@ TEST_P(PaintControllerTest, UpdateAddLastOverlap) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| first.setDisplayItemsUncached();
|
| @@ -672,7 +666,7 @@ TEST_P(PaintControllerTest, UpdateAddLastOverlap) {
|
| 50))); // |second| newly appeared in the chunk.
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| first.setDisplayItemsUncached();
|
| @@ -708,7 +702,7 @@ TEST_P(PaintControllerTest, UpdateClip) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(first, clipType);
|
| - PaintChunkProperties properties = rootPaintChunkProperties();
|
| + PaintChunkProperties properties = defaultPaintChunkProperties();
|
| properties.clip = ClipPaintPropertyNode::create(
|
| nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));
|
| getPaintController().updateCurrentPaintChunkProperties(&id, properties);
|
| @@ -730,7 +724,7 @@ TEST_P(PaintControllerTest, UpdateClip) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| first.setDisplayItemsUncached();
|
| @@ -759,7 +753,7 @@ TEST_P(PaintControllerTest, UpdateClip) {
|
| LayoutRect::infiniteIntRect()))); // This is a new chunk.
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| second.setDisplayItemsUncached();
|
| @@ -768,7 +762,7 @@ TEST_P(PaintControllerTest, UpdateClip) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(second, clipType);
|
| - PaintChunkProperties properties = rootPaintChunkProperties();
|
| + PaintChunkProperties properties = defaultPaintChunkProperties();
|
| properties.clip = ClipPaintPropertyNode::create(
|
| nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));
|
| getPaintController().updateCurrentPaintChunkProperties(&id, properties);
|
| @@ -804,7 +798,7 @@ TEST_P(PaintControllerTest, CachedDisplayItems) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, first, backgroundDrawingType,
|
| @@ -833,7 +827,7 @@ TEST_P(PaintControllerTest, CachedDisplayItems) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| drawRect(context, first, backgroundDrawingType,
|
| FloatRect(100, 100, 150, 150));
|
| @@ -871,7 +865,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithChildren) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, container1, backgroundDrawingType,
|
| @@ -904,7 +898,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithChildren) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| // Simulate the situation when |container1| gets a z-index that is greater
|
| @@ -959,7 +953,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithChildrenAndInvalidation) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| drawRect(context, container1, backgroundDrawingType,
|
| @@ -992,7 +986,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderWithChildrenAndInvalidation) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| // Simulate the situation when |container1| gets a z-index that is greater
|
| @@ -1049,15 +1043,14 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
|
| FakeDisplayItemClient content2("content2", LayoutRect(100, 200, 50, 200));
|
| GraphicsContext context(getPaintController());
|
|
|
| - PaintChunkProperties container1Properties = rootPaintChunkProperties();
|
| - PaintChunkProperties container2Properties = rootPaintChunkProperties();
|
| + PaintChunkProperties container1Properties = defaultPaintChunkProperties();
|
| + PaintChunkProperties container2Properties = defaultPaintChunkProperties();
|
|
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container1, backgroundDrawingType);
|
| - container1Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container1Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container1Properties);
|
| }
|
| @@ -1074,9 +1067,8 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container2, backgroundDrawingType);
|
| - container2Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container2Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container2Properties);
|
| }
|
| @@ -1221,15 +1213,14 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
|
| FakeDisplayItemClient content2("content2", LayoutRect(100, 200, 50, 200));
|
| GraphicsContext context(getPaintController());
|
|
|
| - PaintChunkProperties container1Properties = rootPaintChunkProperties();
|
| - PaintChunkProperties container2Properties = rootPaintChunkProperties();
|
| + PaintChunkProperties container1Properties = defaultPaintChunkProperties();
|
| + PaintChunkProperties container2Properties = defaultPaintChunkProperties();
|
|
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container1, backgroundDrawingType);
|
| - container1Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container1Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container1Properties);
|
| }
|
| @@ -1241,9 +1232,8 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container2, backgroundDrawingType);
|
| - container2Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container2Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container2Properties);
|
| }
|
| @@ -1335,7 +1325,7 @@ TEST_P(PaintControllerTest, OutOfOrderNoCrash) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| drawRect(context, client, type1, FloatRect(100, 100, 100, 100));
|
| drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
|
| @@ -1346,7 +1336,7 @@ TEST_P(PaintControllerTest, OutOfOrderNoCrash) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
|
| drawRect(context, client, type3, FloatRect(100, 100, 50, 200));
|
| @@ -1366,20 +1356,19 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
|
| GraphicsContext context(getPaintController());
|
|
|
| PaintChunkProperties container1BackgroundProperties =
|
| - rootPaintChunkProperties();
|
| - PaintChunkProperties content1Properties = rootPaintChunkProperties();
|
| + defaultPaintChunkProperties();
|
| + PaintChunkProperties content1Properties = defaultPaintChunkProperties();
|
| PaintChunkProperties container1ForegroundProperties =
|
| - rootPaintChunkProperties();
|
| + defaultPaintChunkProperties();
|
| PaintChunkProperties container2BackgroundProperties =
|
| - rootPaintChunkProperties();
|
| - PaintChunkProperties content2Properties = rootPaintChunkProperties();
|
| + defaultPaintChunkProperties();
|
| + PaintChunkProperties content2Properties = defaultPaintChunkProperties();
|
|
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container1, backgroundDrawingType);
|
| - container1BackgroundProperties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container1BackgroundProperties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container1BackgroundProperties);
|
| }
|
| @@ -1389,9 +1378,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(content1, backgroundDrawingType);
|
| - content1Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.6);
|
| + content1Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.6);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, content1Properties);
|
| }
|
| @@ -1403,9 +1391,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
|
| }
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container1, foregroundDrawingType);
|
| - container1ForegroundProperties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.5);
|
| + container1ForegroundProperties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container1ForegroundProperties);
|
| }
|
| @@ -1415,9 +1402,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(container2, backgroundDrawingType);
|
| - container2BackgroundProperties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.7);
|
| + container2BackgroundProperties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.7);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, container2BackgroundProperties);
|
| }
|
| @@ -1427,9 +1413,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
|
| {
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| PaintChunk::Id id(content2, backgroundDrawingType);
|
| - content2Properties.effect = EffectPaintPropertyNode::create(
|
| - EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
|
| - ClipPaintPropertyNode::root(), CompositorFilterOperations(), 0.8);
|
| + content2Properties.effect =
|
| + createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.8);
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| &id, content2Properties);
|
| }
|
| @@ -1596,7 +1581,7 @@ TEST_P(PaintControllerTest, SkipCache) {
|
| GraphicsContext context(getPaintController());
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| FloatRect rect1(100, 100, 50, 50);
|
| @@ -1633,7 +1618,7 @@ TEST_P(PaintControllerTest, SkipCache) {
|
| UnorderedElementsAre(FloatRect(LayoutRect::infiniteIntRect())));
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| // Draw again with nothing invalidated.
|
| @@ -1675,7 +1660,7 @@ TEST_P(PaintControllerTest, SkipCache) {
|
| FloatRect(100, 100, 100, 100))); // New bounds of |content|.
|
|
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
|
|
| // Now the multicol becomes 3 columns and repaints.
|
| @@ -1726,7 +1711,7 @@ TEST_P(PaintControllerTest, PartialSkipCache) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| drawRect(context, content, backgroundDrawingType, rect1);
|
| getPaintController().beginSkippingCache();
|
| @@ -1760,7 +1745,7 @@ TEST_P(PaintControllerTest, PartialSkipCache) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - &m_rootPaintChunkId, rootPaintChunkProperties());
|
| + &m_rootPaintChunkId, defaultPaintChunkProperties());
|
| }
|
| // Draw again with nothing invalidated.
|
| drawRect(context, content, backgroundDrawingType, rect1);
|
| @@ -1851,7 +1836,7 @@ TEST_F(PaintControllerTestBase, SmallPaintControllerHasOnePaintChunk) {
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| getPaintController().updateCurrentPaintChunkProperties(
|
| - nullptr, rootPaintChunkProperties());
|
| + nullptr, defaultPaintChunkProperties());
|
| }
|
| GraphicsContext context(getPaintController());
|
| drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
|
|
|