| 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/surface_display_output_surface.h" | 5 #include "cc/surfaces/surface_display_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/onscreen_display_client.h" | 7 #include "cc/surfaces/onscreen_display_client.h" |
| 8 #include "cc/surfaces/surface_id_allocator.h" | 8 #include "cc/surfaces/surface_id_allocator.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 : OnscreenDisplayClient(FakeOutputSurface::Create3d(), | 29 : OnscreenDisplayClient(FakeOutputSurface::Create3d(), |
| 30 manager, | 30 manager, |
| 31 bitmap_manager, | 31 bitmap_manager, |
| 32 gpu_memory_buffer_manager, | 32 gpu_memory_buffer_manager, |
| 33 settings, | 33 settings, |
| 34 task_runner) { | 34 task_runner) { |
| 35 // Ownership is passed to another object later, store a pointer | 35 // Ownership is passed to another object later, store a pointer |
| 36 // to it now for future reference. | 36 // to it now for future reference. |
| 37 fake_output_surface_ = | 37 fake_output_surface_ = |
| 38 static_cast<FakeOutputSurface*>(output_surface_.get()); | 38 static_cast<FakeOutputSurface*>(output_surface_.get()); |
| 39 fake_output_surface_->set_max_frames_pending(2); |
| 39 } | 40 } |
| 40 | 41 |
| 41 FakeOutputSurface* output_surface() { return fake_output_surface_; } | 42 FakeOutputSurface* output_surface() { return fake_output_surface_; } |
| 42 | 43 |
| 43 protected: | 44 protected: |
| 44 FakeOutputSurface* fake_output_surface_; | 45 FakeOutputSurface* fake_output_surface_; |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 class SurfaceDisplayOutputSurfaceTest : public testing::Test { | 48 class SurfaceDisplayOutputSurfaceTest : public testing::Test { |
| 48 public: | 49 public: |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 157 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 157 | 158 |
| 158 SwapBuffersWithDamage(gfx::Rect()); | 159 SwapBuffersWithDamage(gfx::Rect()); |
| 159 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 160 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 160 task_runner_->RunUntilIdle(); | 161 task_runner_->RunUntilIdle(); |
| 161 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 162 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace | 165 } // namespace |
| 165 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |