OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
8 #include "base/test/test_message_loop.h" | 8 #include "base/test/test_message_loop.h" |
9 #include "gpu/ipc/common/gpu_messages.h" | 9 #include "gpu/ipc/common/gpu_messages.h" |
10 #include "gpu/ipc/service/gpu_channel.h" | 10 #include "gpu/ipc/service/gpu_channel.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // We need GL bindings to actually initialize command buffers. | 28 // We need GL bindings to actually initialize command buffers. |
29 gl::GLSurfaceTestSupport::InitializeOneOffWithMockBindings(); | 29 gl::GLSurfaceTestSupport::InitializeOneOffWithMockBindings(); |
30 gl::SetStubGLApi(&api_); | 30 gl::SetStubGLApi(&api_); |
31 | 31 |
32 GpuChannelTestCommon::SetUp(); | 32 GpuChannelTestCommon::SetUp(); |
33 } | 33 } |
34 | 34 |
35 void TearDown() override { | 35 void TearDown() override { |
36 GpuChannelTestCommon::TearDown(); | 36 GpuChannelTestCommon::TearDown(); |
37 | 37 |
38 gl::init::ClearGLBindings(); | 38 gl::init::ShutdownGL(); |
39 } | 39 } |
40 | 40 |
41 GpuChannel* CreateChannel(int32_t client_id, | 41 GpuChannel* CreateChannel(int32_t client_id, |
42 bool allow_view_command_buffers, | 42 bool allow_view_command_buffers, |
43 bool allow_real_time_streams) { | 43 bool allow_real_time_streams) { |
44 DCHECK(channel_manager()); | 44 DCHECK(channel_manager()); |
45 uint64_t kClientTracingId = 1; | 45 uint64_t kClientTracingId = 1; |
46 channel_manager()->EstablishChannel( | 46 channel_manager()->EstablishChannel( |
47 client_id, kClientTracingId, false /* preempts */, | 47 client_id, kClientTracingId, false /* preempts */, |
48 allow_view_command_buffers, allow_real_time_streams); | 48 allow_view_command_buffers, allow_real_time_streams); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); | 402 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); |
403 | 403 |
404 // Destroy the command buffers we initialized before destoying GL. | 404 // Destroy the command buffers we initialized before destoying GL. |
405 HandleMessage(channel, | 405 HandleMessage(channel, |
406 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); | 406 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); |
407 HandleMessage(channel, | 407 HandleMessage(channel, |
408 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); | 408 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); |
409 } | 409 } |
410 | 410 |
411 } // namespace gpu | 411 } // namespace gpu |
OLD | NEW |