OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains the tests for the FencedAllocator class. | 5 // This file contains the tests for the FencedAllocator class. |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/mac/scoped_nsautorelease_pool.h" | 9 #include "base/mac/scoped_nsautorelease_pool.h" |
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 command_buffer_->Initialize(kBufferSize); | 44 command_buffer_->Initialize(kBufferSize); |
45 Buffer ring_buffer = command_buffer_->GetRingBuffer(); | 45 Buffer ring_buffer = command_buffer_->GetRingBuffer(); |
46 | 46 |
47 parser_ = new CommandParser(ring_buffer.ptr, | 47 parser_ = new CommandParser(ring_buffer.ptr, |
48 ring_buffer.size, | 48 ring_buffer.size, |
49 0, | 49 0, |
50 ring_buffer.size, | 50 ring_buffer.size, |
51 0, | 51 0, |
52 api_mock_.get()); | 52 api_mock_.get()); |
53 | 53 |
54 gpu_scheduler_.reset(GpuScheduler::CreateForTests( | 54 gpu_scheduler_.reset(new GpuScheduler( |
55 command_buffer_.get(), NULL, parser_)); | 55 command_buffer_.get(), NULL, parser_, INT_MAX)); |
56 command_buffer_->SetPutOffsetChangeCallback(NewCallback( | 56 command_buffer_->SetPutOffsetChangeCallback(NewCallback( |
57 gpu_scheduler_.get(), &GpuScheduler::PutChanged)); | 57 gpu_scheduler_.get(), &GpuScheduler::PutChanged)); |
58 | 58 |
59 api_mock_->set_engine(gpu_scheduler_.get()); | 59 api_mock_->set_engine(gpu_scheduler_.get()); |
60 | 60 |
61 helper_.reset(new CommandBufferHelper(command_buffer_.get())); | 61 helper_.reset(new CommandBufferHelper(command_buffer_.get())); |
62 helper_->Initialize(kBufferSize); | 62 helper_->Initialize(kBufferSize); |
63 } | 63 } |
64 | 64 |
65 int32 GetToken() { | 65 int32 GetToken() { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 EXPECT_LE(token, GetToken()); | 513 EXPECT_LE(token, GetToken()); |
514 | 514 |
515 // Free up everything. | 515 // Free up everything. |
516 for (unsigned int i = 0; i < kAllocCount; ++i) { | 516 for (unsigned int i = 0; i < kAllocCount; ++i) { |
517 allocator_->Free(pointers[i]); | 517 allocator_->Free(pointers[i]); |
518 EXPECT_TRUE(allocator_->CheckConsistency()); | 518 EXPECT_TRUE(allocator_->CheckConsistency()); |
519 } | 519 } |
520 } | 520 } |
521 | 521 |
522 } // namespace gpu | 522 } // namespace gpu |
OLD | NEW |