OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/aligned_memory.h" | 9 #include "base/memory/aligned_memory.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 command_buffer_->SetGetBufferChangeCallback(base::Bind( | 64 command_buffer_->SetGetBufferChangeCallback(base::Bind( |
65 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get()))); | 65 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get()))); |
66 | 66 |
67 api_mock_->set_engine(gpu_scheduler_.get()); | 67 api_mock_->set_engine(gpu_scheduler_.get()); |
68 | 68 |
69 helper_.reset(new CommandBufferHelper(command_buffer_.get())); | 69 helper_.reset(new CommandBufferHelper(command_buffer_.get())); |
70 helper_->Initialize(kBufferSize); | 70 helper_->Initialize(kBufferSize); |
71 } | 71 } |
72 | 72 |
73 int32 GetToken() { | 73 int32 GetToken() { |
74 return command_buffer_->GetState().token; | 74 return command_buffer_->GetLastState().token; |
75 } | 75 } |
76 | 76 |
77 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
78 base::mac::ScopedNSAutoreleasePool autorelease_pool_; | 78 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
79 #endif | 79 #endif |
80 base::MessageLoop message_loop_; | 80 base::MessageLoop message_loop_; |
81 scoped_ptr<AsyncAPIMock> api_mock_; | 81 scoped_ptr<AsyncAPIMock> api_mock_; |
82 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 82 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
83 scoped_ptr<CommandBufferService> command_buffer_; | 83 scoped_ptr<CommandBufferService> command_buffer_; |
84 scoped_ptr<GpuScheduler> gpu_scheduler_; | 84 scoped_ptr<GpuScheduler> gpu_scheduler_; |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 EXPECT_LE(token, GetToken()); | 636 EXPECT_LE(token, GetToken()); |
637 | 637 |
638 // Free up everything. | 638 // Free up everything. |
639 for (unsigned int i = 0; i < kAllocCount; ++i) { | 639 for (unsigned int i = 0; i < kAllocCount; ++i) { |
640 allocator_->Free(pointers[i]); | 640 allocator_->Free(pointers[i]); |
641 EXPECT_TRUE(allocator_->CheckConsistency()); | 641 EXPECT_TRUE(allocator_->CheckConsistency()); |
642 } | 642 } |
643 } | 643 } |
644 | 644 |
645 } // namespace gpu | 645 } // namespace gpu |
OLD | NEW |