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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 2118993002: Detemplatize cc property nodes (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
index dd6fb3d7cbd3be85d005d049e12fb21615e761f7..4640c2775ee800661feec79171a07a6b2c3096f1 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -8,6 +8,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "cc/layers/layer.h"
#include "cc/test/fake_output_surface.h"
+#include "cc/trees/clip_node.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_settings.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -535,9 +536,9 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, OneClip)
EXPECT_EQ(translation(220, 80), layer->screen_space_transform());
const cc::ClipNode* clipNode = propertyTrees().clip_tree.Node(layer->clip_tree_index());
- EXPECT_TRUE(clipNode->data.applies_local_clip);
- EXPECT_TRUE(clipNode->data.layers_are_clipped);
- EXPECT_EQ(gfx::RectF(100, 100, 300, 200), clipNode->data.clip);
+ EXPECT_TRUE(clipNode->applies_local_clip);
+ EXPECT_TRUE(clipNode->layers_are_clipped);
+ EXPECT_EQ(gfx::RectF(100, 100, 300, 200), clipNode->clip);
}
TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedClips)
@@ -582,15 +583,15 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedClips)
EXPECT_EQ(whiteLayer->clip_tree_index(), darkGrayLayer->clip_tree_index());
const cc::ClipNode* outerClip = propertyTrees().clip_tree.Node(whiteLayer->clip_tree_index());
- EXPECT_TRUE(outerClip->data.applies_local_clip);
- EXPECT_TRUE(outerClip->data.layers_are_clipped);
- EXPECT_EQ(gfx::RectF(100, 100, 700, 700), outerClip->data.clip);
+ EXPECT_TRUE(outerClip->applies_local_clip);
+ EXPECT_TRUE(outerClip->layers_are_clipped);
+ EXPECT_EQ(gfx::RectF(100, 100, 700, 700), outerClip->clip);
EXPECT_EQ(lightGrayLayer->clip_tree_index(), blackLayer->clip_tree_index());
const cc::ClipNode* innerClip = propertyTrees().clip_tree.Node(blackLayer->clip_tree_index());
- EXPECT_TRUE(innerClip->data.applies_local_clip);
- EXPECT_TRUE(innerClip->data.layers_are_clipped);
- EXPECT_EQ(gfx::RectF(200, 200, 700, 100), innerClip->data.clip);
+ EXPECT_TRUE(innerClip->applies_local_clip);
+ EXPECT_TRUE(innerClip->layers_are_clipped);
+ EXPECT_EQ(gfx::RectF(200, 200, 700, 100), innerClip->clip);
EXPECT_EQ(outerClip->id, innerClip->parent_id);
}
@@ -619,9 +620,9 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, DeeplyNestedClips)
const cc::ClipNode* clipNode = propertyTrees().clip_tree.Node(drawingLayer->clip_tree_index());
for (auto it = clips.rbegin(); it != clips.rend(); ++it) {
const ClipPaintPropertyNode* paintClipNode = it->get();
- EXPECT_TRUE(clipNode->data.applies_local_clip);
- EXPECT_TRUE(clipNode->data.layers_are_clipped);
- EXPECT_EQ(paintClipNode->clipRect().rect(), clipNode->data.clip);
+ EXPECT_TRUE(clipNode->applies_local_clip);
+ EXPECT_TRUE(clipNode->layers_are_clipped);
+ EXPECT_EQ(paintClipNode->clipRect().rect(), clipNode->clip);
clipNode = propertyTrees().clip_tree.Node(clipNode->parent_id);
}
}
@@ -649,24 +650,24 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, SiblingClips)
Pointee(drawsRectangle(FloatRect(0, 0, 640, 480), Color::white)));
EXPECT_EQ(gfx::Transform(), whiteLayer->screen_space_transform());
const cc::ClipNode* whiteClip = propertyTrees().clip_tree.Node(whiteLayer->clip_tree_index());
- EXPECT_TRUE(whiteClip->data.applies_local_clip);
- EXPECT_TRUE(whiteClip->data.layers_are_clipped);
- ASSERT_EQ(gfx::RectF(0, 0, 400, 600), whiteClip->data.clip);
+ EXPECT_TRUE(whiteClip->applies_local_clip);
+ EXPECT_TRUE(whiteClip->layers_are_clipped);
+ ASSERT_EQ(gfx::RectF(0, 0, 400, 600), whiteClip->clip);
const cc::Layer* blackLayer = contentLayerAt(1);
EXPECT_THAT(blackLayer->GetPicture(),
Pointee(drawsRectangle(FloatRect(0, 0, 640, 480), Color::black)));
EXPECT_EQ(gfx::Transform(), blackLayer->screen_space_transform());
const cc::ClipNode* blackClip = propertyTrees().clip_tree.Node(blackLayer->clip_tree_index());
- EXPECT_TRUE(blackClip->data.applies_local_clip);
- EXPECT_TRUE(blackClip->data.layers_are_clipped);
- ASSERT_EQ(gfx::RectF(400, 0, 400, 600), blackClip->data.clip);
+ EXPECT_TRUE(blackClip->applies_local_clip);
+ EXPECT_TRUE(blackClip->layers_are_clipped);
+ ASSERT_EQ(gfx::RectF(400, 0, 400, 600), blackClip->clip);
EXPECT_EQ(whiteClip->parent_id, blackClip->parent_id);
const cc::ClipNode* commonClipNode = propertyTrees().clip_tree.Node(whiteClip->parent_id);
- EXPECT_TRUE(commonClipNode->data.applies_local_clip);
- EXPECT_TRUE(commonClipNode->data.layers_are_clipped);
- ASSERT_EQ(gfx::RectF(0, 0, 800, 600), commonClipNode->data.clip);
+ EXPECT_TRUE(commonClipNode->applies_local_clip);
+ EXPECT_TRUE(commonClipNode->layers_are_clipped);
+ ASSERT_EQ(gfx::RectF(0, 0, 800, 600), commonClipNode->clip);
}
TEST_F(PaintArtifactCompositorTestWithPropertyTrees, ForeignLayerPassesThrough)
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | ui/gfx/transform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698