| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "cc/output/compositor_frame.h" | 6 #include "cc/output/compositor_frame.h" |
| 7 #include "cc/quads/texture_draw_quad.h" | 7 #include "cc/quads/texture_draw_quad.h" |
| 8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "components/exo/buffer.h" | 10 #include "components/exo/buffer.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // Callback should not run synchronously. | 92 // Callback should not run synchronously. |
| 93 EXPECT_TRUE(frame_time.is_null()); | 93 EXPECT_TRUE(frame_time.is_null()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 const cc::CompositorFrame& GetFrameFromSurface(Surface* surface) { | 96 const cc::CompositorFrame& GetFrameFromSurface(Surface* surface) { |
| 97 cc::SurfaceId surface_id = surface->GetSurfaceId(); | 97 cc::SurfaceId surface_id = surface->GetSurfaceId(); |
| 98 cc::SurfaceManager* surface_manager = | 98 cc::SurfaceManager* surface_manager = |
| 99 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(); | 99 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(); |
| 100 const cc::CompositorFrame& frame = | 100 const cc::CompositorFrame& frame = |
| 101 surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); | 101 surface_manager->GetSurfaceForId(surface_id)->GetActiveFrame(); |
| 102 return frame; | 102 return frame; |
| 103 } | 103 } |
| 104 | 104 |
| 105 TEST_F(SurfaceTest, SetOpaqueRegion) { | 105 TEST_F(SurfaceTest, SetOpaqueRegion) { |
| 106 gfx::Size buffer_size(1, 1); | 106 gfx::Size buffer_size(1, 1); |
| 107 std::unique_ptr<Buffer> buffer( | 107 std::unique_ptr<Buffer> buffer( |
| 108 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 108 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 109 std::unique_ptr<Surface> surface(new Surface); | 109 std::unique_ptr<Surface> surface(new Surface); |
| 110 | 110 |
| 111 // Attaching a buffer with alpha channel. | 111 // Attaching a buffer with alpha channel. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 TEST_F(SurfaceTest, Commit) { | 303 TEST_F(SurfaceTest, Commit) { |
| 304 std::unique_ptr<Surface> surface(new Surface); | 304 std::unique_ptr<Surface> surface(new Surface); |
| 305 | 305 |
| 306 // Calling commit without a buffer should succeed. | 306 // Calling commit without a buffer should succeed. |
| 307 surface->Commit(); | 307 surface->Commit(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace | 310 } // namespace |
| 311 } // namespace exo | 311 } // namespace exo |
| OLD | NEW |