| 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 "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "cc/layers/layer_settings.h" | 8 #include "cc/layers/layer_settings.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/graphics/paint/PaintArtifact.h" | 10 #include "platform/graphics/paint/PaintArtifact.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Delay constructing the compositor until after the feature is set. | 34 // Delay constructing the compositor until after the feature is set. |
| 35 m_paintArtifactCompositor = adoptPtr(new PaintArtifactCompositor); | 35 m_paintArtifactCompositor = adoptPtr(new PaintArtifactCompositor); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TearDown() override | 38 void TearDown() override |
| 39 { | 39 { |
| 40 m_featuresBackup.restore(); | 40 m_featuresBackup.restore(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 PaintArtifactCompositor& paintArtifactCompositor() { return *m_paintArtifact
Compositor; } | 43 PaintArtifactCompositor& getPaintArtifactCompositor() { return *m_paintArtif
actCompositor; } |
| 44 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); } | 44 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); } |
| 45 void update(const PaintArtifact& artifact) { m_paintArtifactCompositor->upda
te(artifact); } | 45 void update(const PaintArtifact& artifact) { m_paintArtifactCompositor->upda
te(artifact); } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 RuntimeEnabledFeatures::Backup m_featuresBackup; | 48 RuntimeEnabledFeatures::Backup m_featuresBackup; |
| 49 OwnPtr<PaintArtifactCompositor> m_paintArtifactCompositor; | 49 OwnPtr<PaintArtifactCompositor> m_paintArtifactCompositor; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 TEST_F(PaintArtifactCompositorTest, EmptyPaintArtifact) | 52 TEST_F(PaintArtifactCompositorTest, EmptyPaintArtifact) |
| 53 { | 53 { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 update(artifact.build()); | 317 update(artifact.build()); |
| 318 | 318 |
| 319 ASSERT_EQ(1u, rootLayer()->children().size()); | 319 ASSERT_EQ(1u, rootLayer()->children().size()); |
| 320 EXPECT_EQ(layer, rootLayer()->child_at(0)); | 320 EXPECT_EQ(layer, rootLayer()->child_at(0)); |
| 321 EXPECT_EQ(gfx::Size(400, 300), layer->bounds()); | 321 EXPECT_EQ(gfx::Size(400, 300), layer->bounds()); |
| 322 EXPECT_EQ(translation(50, 100), layer->transform()); | 322 EXPECT_EQ(translation(50, 100), layer->transform()); |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace | 325 } // namespace |
| 326 } // namespace blink | 326 } // namespace blink |
| OLD | NEW |