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

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

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none Created 4 years 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 side-by-side diff with in-line comments
Download patch
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 90b33c04bc75a1046b050b0e99c88bc8ce4e684f..b29aafa80640a28fdcf60d4082c8b543b95d271a 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -703,8 +703,10 @@ TEST_P(PaintControllerTest, UpdateClip) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(first, clipType);
PaintChunkProperties properties = defaultPaintChunkProperties();
- properties.clip = ClipPaintPropertyNode::create(
- nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));
+ properties.propertyTreeState.setClip(
+ ClipPaintPropertyNode::create(nullptr, nullptr,
+ FloatRoundedRect(1, 1, 2, 2))
+ .get());
getPaintController().updateCurrentPaintChunkProperties(&id, properties);
}
ClipRecorder clipRecorder(context, first, clipType, IntRect(1, 1, 2, 2));
@@ -763,8 +765,10 @@ TEST_P(PaintControllerTest, UpdateClip) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(second, clipType);
PaintChunkProperties properties = defaultPaintChunkProperties();
- properties.clip = ClipPaintPropertyNode::create(
- nullptr, nullptr, FloatRoundedRect(1, 1, 2, 2));
+ properties.propertyTreeState.setClip(
+ ClipPaintPropertyNode::create(nullptr, nullptr,
+ FloatRoundedRect(1, 1, 2, 2))
+ .get());
getPaintController().updateCurrentPaintChunkProperties(&id, properties);
}
ClipRecorder clipRecorder(context, second, clipType, IntRect(1, 1, 2, 2));
@@ -1049,8 +1053,8 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
- container1Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container1Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1Properties);
}
@@ -1067,8 +1071,8 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
- container2Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container2Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2Properties);
}
@@ -1219,8 +1223,8 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
- container1Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container1Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1Properties);
}
@@ -1232,8 +1236,8 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
- container2Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container2Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2Properties);
}
@@ -1367,8 +1371,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
- container1BackgroundProperties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container1BackgroundProperties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1BackgroundProperties);
}
@@ -1378,8 +1382,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(content1, backgroundDrawingType);
- content1Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.6);
+ content1Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.6)
+ .get());
getPaintController().updateCurrentPaintChunkProperties(
&id, content1Properties);
}
@@ -1391,8 +1396,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
}
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, foregroundDrawingType);
- container1ForegroundProperties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);
+ container1ForegroundProperties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1ForegroundProperties);
}
@@ -1402,8 +1407,8 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
- container2BackgroundProperties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.7);
+ container2BackgroundProperties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.7).get());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2BackgroundProperties);
}
@@ -1413,8 +1418,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
{
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(content2, backgroundDrawingType);
- content2Properties.effect =
- createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.8);
+ content2Properties.propertyTreeState.setEffect(
+ createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.8)
+ .get());
getPaintController().updateCurrentPaintChunkProperties(
&id, content2Properties);
}

Powered by Google App Engine
This is Rietveld 408576698