Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |