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 #include "gpu/command_buffer/client/mapped_memory.h" | 5 #include "gpu/command_buffer/client/mapped_memory.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 command_buffer_->Initialize(kBufferSize); | 42 command_buffer_->Initialize(kBufferSize); |
43 Buffer ring_buffer = command_buffer_->GetRingBuffer(); | 43 Buffer ring_buffer = command_buffer_->GetRingBuffer(); |
44 | 44 |
45 parser_ = new CommandParser(ring_buffer.ptr, | 45 parser_ = new CommandParser(ring_buffer.ptr, |
46 ring_buffer.size, | 46 ring_buffer.size, |
47 0, | 47 0, |
48 ring_buffer.size, | 48 ring_buffer.size, |
49 0, | 49 0, |
50 api_mock_.get()); | 50 api_mock_.get()); |
51 | 51 |
52 gpu_scheduler_.reset(new GpuScheduler( | 52 gpu_scheduler_.reset(GpuScheduler::CreateForTests( |
53 command_buffer_.get(), NULL, parser_, INT_MAX)); | 53 command_buffer_.get(), NULL, parser_)); |
54 command_buffer_->SetPutOffsetChangeCallback(NewCallback( | 54 command_buffer_->SetPutOffsetChangeCallback(NewCallback( |
55 gpu_scheduler_.get(), &GpuScheduler::PutChanged)); | 55 gpu_scheduler_.get(), &GpuScheduler::PutChanged)); |
56 | 56 |
57 api_mock_->set_engine(gpu_scheduler_.get()); | 57 api_mock_->set_engine(gpu_scheduler_.get()); |
58 | 58 |
59 helper_.reset(new CommandBufferHelper(command_buffer_.get())); | 59 helper_.reset(new CommandBufferHelper(command_buffer_.get())); |
60 helper_->Initialize(kBufferSize); | 60 helper_->Initialize(kBufferSize); |
61 } | 61 } |
62 | 62 |
63 int32 GetToken() { | 63 int32 GetToken() { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // Check we can alloc. | 249 // Check we can alloc. |
250 int32 id1 = -1; | 250 int32 id1 = -1; |
251 unsigned int offset1 = 0xFFFFFFFFU; | 251 unsigned int offset1 = 0xFFFFFFFFU; |
252 void* mem1 = manager_->Alloc(kSize, &id1, &offset1); | 252 void* mem1 = manager_->Alloc(kSize, &id1, &offset1); |
253 ASSERT_TRUE(mem1); | 253 ASSERT_TRUE(mem1); |
254 } | 254 } |
255 | 255 |
256 } // namespace gpu | 256 } // namespace gpu |
257 | 257 |
258 | 258 |
OLD | NEW |