| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/test/null_task_runner.h" | 9 #include "base/test/null_task_runner.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 std::unique_ptr<Display> display_; | 157 std::unique_ptr<Display> display_; |
| 158 TestSoftwareOutputDevice* software_output_device_ = nullptr; | 158 TestSoftwareOutputDevice* software_output_device_ = nullptr; |
| 159 FakeOutputSurface* output_surface_ = nullptr; | 159 FakeOutputSurface* output_surface_ = nullptr; |
| 160 TestDisplayScheduler* scheduler_ = nullptr; | 160 TestDisplayScheduler* scheduler_ = nullptr; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 class StubDisplayClient : public DisplayClient { | 163 class StubDisplayClient : public DisplayClient { |
| 164 public: | 164 public: |
| 165 void DisplayOutputSurfaceLost() override {} | 165 void DisplayOutputSurfaceLost() override {} |
| 166 void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} | 166 void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} |
| 167 void DisplayWillDrawAndSwap(bool will_draw_and_swap, | |
| 168 const RenderPassList& render_passes) override {} | |
| 169 void DisplayDidDrawAndSwap() override {} | |
| 170 }; | 167 }; |
| 171 | 168 |
| 172 void CopyCallback(bool* called, std::unique_ptr<CopyOutputResult> result) { | 169 void CopyCallback(bool* called, std::unique_ptr<CopyOutputResult> result) { |
| 173 *called = true; | 170 *called = true; |
| 174 } | 171 } |
| 175 | 172 |
| 176 // Check that frame is damaged and swapped only under correct conditions. | 173 // Check that frame is damaged and swapped only under correct conditions. |
| 177 TEST_F(DisplayTest, DisplayDamaged) { | 174 TEST_F(DisplayTest, DisplayDamaged) { |
| 178 RendererSettings settings; | 175 RendererSettings settings; |
| 179 settings.partial_swap_enabled = true; | 176 settings.partial_swap_enabled = true; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 491 |
| 495 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); | 492 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); |
| 496 display_->Resize(gfx::Size(250, 250)); | 493 display_->Resize(gfx::Size(250, 250)); |
| 497 testing::Mock::VerifyAndClearExpectations(context_ptr); | 494 testing::Mock::VerifyAndClearExpectations(context_ptr); |
| 498 | 495 |
| 499 factory_.Destroy(surface_id); | 496 factory_.Destroy(surface_id); |
| 500 } | 497 } |
| 501 | 498 |
| 502 } // namespace | 499 } // namespace |
| 503 } // namespace cc | 500 } // namespace cc |
| OLD | NEW |