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

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

Issue 2480863002: DCHECK that paint properties are never null (Closed)
Patch Set: dcheckmate Created 4 years, 1 month 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/PaintChunkerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
index ff3e5c1aa02a8435866d67117f38d3fb6d723f81..d36cfceb8ec5d5f92d52d426651112476856aed4 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
@@ -18,7 +18,12 @@ namespace {
#if defined(NDEBUG) || !OS(WIN)
PaintChunkProperties rootPaintChunkProperties() {
- return PaintChunkProperties();
+ PaintChunkProperties rootProperties;
+ rootProperties.transform = TransformPaintPropertyNode::root();
+ rootProperties.clip = ClipPaintPropertyNode::root();
+ rootProperties.effect = EffectPaintPropertyNode::root();
+ rootProperties.scroll = ScrollPaintPropertyNode::root();
+ return rootProperties;
}
class PaintChunkerTest : public testing::Test {
@@ -111,14 +116,14 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithSinglePropertyChanging) {
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransform;
+ PaintChunkProperties simpleTransform = rootPaintChunkProperties();
simpleTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(nullptr, simpleTransform);
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties anotherTransform;
+ PaintChunkProperties anotherTransform = rootPaintChunkProperties();
anotherTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(nullptr, anotherTransform);
@@ -138,14 +143,14 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithDifferentPropertyChanges) {
rootPaintChunkProperties());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransform;
+ PaintChunkProperties simpleTransform = rootPaintChunkProperties();
simpleTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 0, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(nullptr, simpleTransform);
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransformAndEffect;
+ PaintChunkProperties simpleTransformAndEffect = rootPaintChunkProperties();
simpleTransformAndEffect.transform = simpleTransform.transform;
simpleTransformAndEffect.effect = EffectPaintPropertyNode::create(
EffectPaintPropertyNode::root(), TransformPaintPropertyNode::root(),
@@ -154,7 +159,8 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithDifferentPropertyChanges) {
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransformAndEffectWithUpdatedTransform;
+ PaintChunkProperties simpleTransformAndEffectWithUpdatedTransform =
+ rootPaintChunkProperties();
simpleTransformAndEffectWithUpdatedTransform.transform =
TransformPaintPropertyNode::create(nullptr,
TransformationMatrix(1, 1, 0, 0, 0, 0),
@@ -197,7 +203,7 @@ TEST_F(PaintChunkerTest, BuildChunksFromNestedTransforms) {
rootPaintChunkProperties());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransform;
+ PaintChunkProperties simpleTransform = rootPaintChunkProperties();
simpleTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(nullptr, simpleTransform);
@@ -224,12 +230,12 @@ TEST_F(PaintChunkerTest, ChangingPropertiesWithoutItems) {
rootPaintChunkProperties());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties firstTransform;
+ PaintChunkProperties firstTransform = rootPaintChunkProperties();
firstTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(nullptr, firstTransform);
- PaintChunkProperties secondTransform;
+ PaintChunkProperties secondTransform = rootPaintChunkProperties();
secondTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(9, 8, 7, 6, 5, 4), FloatPoint3D(3, 2, 1));
chunker.updateCurrentPaintChunkProperties(nullptr, secondTransform);
@@ -284,10 +290,12 @@ TEST_F(PaintChunkerTest, ChunkIds) {
TestDisplayItemRequiringSeparateChunk i2;
DisplayItem::Id id2 = i2.getId();
+ chunker.updateCurrentPaintChunkProperties(nullptr,
+ rootPaintChunkProperties());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransform;
+ PaintChunkProperties simpleTransform = rootPaintChunkProperties();
simpleTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(&id1, simpleTransform);
@@ -319,10 +327,12 @@ TEST_F(PaintChunkerTest, ChunkIdsSkippingCache) {
TestDisplayItemRequiringSeparateChunk i2;
i2.setSkippedCache();
+ chunker.updateCurrentPaintChunkProperties(nullptr,
+ rootPaintChunkProperties());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
chunker.incrementDisplayItemIndex(NormalTestDisplayItem());
- PaintChunkProperties simpleTransform;
+ PaintChunkProperties simpleTransform = rootPaintChunkProperties();
simpleTransform.transform = TransformPaintPropertyNode::create(
nullptr, TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(&id1, simpleTransform);

Powered by Google App Engine
This is Rietveld 408576698