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

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

Issue 2122983002: [SPv2] Add unit test for foreign layers in layer list path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "platform/graphics/compositing/PaintArtifactCompositor.h" 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 Pointee(drawsRectangle(FloatRect(0, 0, 300, 200), Color::black))); 511 Pointee(drawsRectangle(FloatRect(0, 0, 300, 200), Color::black)));
512 gfx::RectF mappedRect(0, 0, 300, 200); 512 gfx::RectF mappedRect(0, 0, 300, 200);
513 layer->screen_space_transform().TransformRect(&mappedRect); 513 layer->screen_space_transform().TransformRect(&mappedRect);
514 EXPECT_EQ(gfx::RectF(0, 0, 600, 400), mappedRect); 514 EXPECT_EQ(gfx::RectF(0, 0, 600, 400), mappedRect);
515 } 515 }
516 EXPECT_NE( 516 EXPECT_NE(
517 contentLayerAt(0)->transform_tree_index(), 517 contentLayerAt(0)->transform_tree_index(),
518 contentLayerAt(1)->transform_tree_index()); 518 contentLayerAt(1)->transform_tree_index());
519 } 519 }
520 520
521 TEST_F(PaintArtifactCompositorTestWithPropertyTrees, ForeignLayerPassesThrough)
pdr. 2016/07/06 23:23:23 WDYT about extracting this out so PaintArtifactCom
jbroman 2016/07/07 00:18:45 It's rough, because this one isn't that long, and
522 {
523 scoped_refptr<cc::Layer> layer = cc::Layer::Create();
524
525 TestPaintArtifact artifact;
526 artifact.chunk(PaintChunkProperties())
527 .foreignLayer(FloatPoint(50, 100), IntSize(400, 300), layer);
528 update(artifact.build());
529
530 ASSERT_EQ(1u, contentLayerCount());
531 EXPECT_EQ(layer, contentLayerAt(0));
532 EXPECT_EQ(gfx::Size(400, 300), layer->bounds());
533 EXPECT_EQ(translation(50, 100), layer->screen_space_transform());
534 }
521 535
522 } // namespace 536 } // namespace
523 } // namespace blink 537 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698