| 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/output/delegated_frame_data.h" | 7 #include "cc/output/delegated_frame_data.h" |
| 8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
| 9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 10 #include "cc/surfaces/surface_manager.h" |
| 11 #include "components/exo/buffer.h" | 11 #include "components/exo/buffer.h" |
| 12 #include "components/exo/surface.h" | 12 #include "components/exo/surface.h" |
| 13 #include "components/exo/test/exo_test_base.h" | 13 #include "components/exo/test/exo_test_base.h" |
| 14 #include "components/exo/test/exo_test_helper.h" | 14 #include "components/exo/test/exo_test_helper.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
| 17 #include "ui/compositor/layer_tree_owner.h" | 17 #include "ui/compositor/layer_tree_owner.h" |
| 18 #include "ui/gfx/gpu_memory_buffer.h" | 18 #include "ui/gfx/gpu_memory_buffer.h" |
| 19 #include "ui/wm/core/window_util.h" | 19 #include "ui/wm/core/window_util.h" |
| 20 | 20 |
| 21 namespace exo { | 21 namespace exo { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 using SurfaceTest = test::ExoTestBase; | 24 using SurfaceTest = test::ExoTestBase; |
| 25 | 25 |
| 26 void ReleaseBuffer(int* release_buffer_call_count) { | 26 void ReleaseBuffer(int* release_buffer_call_count) { |
| 27 (*release_buffer_call_count)++; | 27 (*release_buffer_call_count)++; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // SurafaceTest.Attach is failing |
| 30 TEST_F(SurfaceTest, Attach) { | 31 TEST_F(SurfaceTest, Attach) { |
| 31 gfx::Size buffer_size(256, 256); | 32 gfx::Size buffer_size(256, 256); |
| 32 std::unique_ptr<Buffer> buffer( | 33 std::unique_ptr<Buffer> buffer( |
| 33 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 34 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 34 | 35 |
| 35 // Set the release callback that will be run when buffer is no longer in use. | 36 // Set the release callback that will be run when buffer is no longer in use. |
| 36 int release_buffer_call_count = 0; | 37 int release_buffer_call_count = 0; |
| 37 buffer->set_release_callback( | 38 buffer->set_release_callback( |
| 38 base::Bind(&ReleaseBuffer, base::Unretained(&release_buffer_call_count))); | 39 base::Bind(&ReleaseBuffer, base::Unretained(&release_buffer_call_count))); |
| 39 | 40 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 250 |
| 250 TEST_F(SurfaceTest, Commit) { | 251 TEST_F(SurfaceTest, Commit) { |
| 251 std::unique_ptr<Surface> surface(new Surface); | 252 std::unique_ptr<Surface> surface(new Surface); |
| 252 | 253 |
| 253 // Calling commit without a buffer should succeed. | 254 // Calling commit without a buffer should succeed. |
| 254 surface->Commit(); | 255 surface->Commit(); |
| 255 } | 256 } |
| 256 | 257 |
| 257 } // namespace | 258 } // namespace |
| 258 } // namespace exo | 259 } // namespace exo |
| OLD | NEW |