Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: gpu/command_buffer/client/ring_buffer_test.cc

Issue 1345813002: Added a unique command buffer ID for command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed copyright Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 RingBuffer class. 5 // This file contains the tests for the RingBuffer class.
6 6
7 #include "gpu/command_buffer/client/ring_buffer.h" 7 #include "gpu/command_buffer/client/ring_buffer.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _)) 64 EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _))
65 .WillRepeatedly(DoAll(Invoke(this, &BaseRingBufferTest::SetToken), 65 .WillRepeatedly(DoAll(Invoke(this, &BaseRingBufferTest::SetToken),
66 Return(error::kNoError))); 66 Return(error::kNoError)));
67 67
68 { 68 {
69 TransferBufferManager* manager = new TransferBufferManager(nullptr); 69 TransferBufferManager* manager = new TransferBufferManager(nullptr);
70 transfer_buffer_manager_ = manager; 70 transfer_buffer_manager_ = manager;
71 EXPECT_TRUE(manager->Initialize()); 71 EXPECT_TRUE(manager->Initialize());
72 } 72 }
73 command_buffer_.reset( 73 command_buffer_.reset(
74 new CommandBufferService(transfer_buffer_manager_.get())); 74 new CommandBufferService(transfer_buffer_manager_.get(),
75 kCommandBufferNamespace_InProcess,
76 0));
75 EXPECT_TRUE(command_buffer_->Initialize()); 77 EXPECT_TRUE(command_buffer_->Initialize());
76 78
77 gpu_scheduler_.reset(new GpuScheduler( 79 gpu_scheduler_.reset(new GpuScheduler(
78 command_buffer_.get(), api_mock_.get(), NULL)); 80 command_buffer_.get(), api_mock_.get(), NULL));
79 command_buffer_->SetPutOffsetChangeCallback(base::Bind( 81 command_buffer_->SetPutOffsetChangeCallback(base::Bind(
80 &GpuScheduler::PutChanged, base::Unretained(gpu_scheduler_.get()))); 82 &GpuScheduler::PutChanged, base::Unretained(gpu_scheduler_.get())));
81 command_buffer_->SetGetBufferChangeCallback(base::Bind( 83 command_buffer_->SetGetBufferChangeCallback(base::Bind(
82 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get()))); 84 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get())));
83 85
84 api_mock_->set_engine(gpu_scheduler_.get()); 86 api_mock_->set_engine(gpu_scheduler_.get());
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Discarding the middle allocation should turn it into padding. 425 // Discarding the middle allocation should turn it into padding.
424 allocator_->DiscardBlock(ptr2); 426 allocator_->DiscardBlock(ptr2);
425 EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting()); 427 EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting());
426 428
427 // Discarding the first allocation should discard the middle padding as well. 429 // Discarding the first allocation should discard the middle padding as well.
428 allocator_->DiscardBlock(ptr1); 430 allocator_->DiscardBlock(ptr1);
429 EXPECT_EQ(kAlloc1 + kAlloc2, allocator_->GetLargestFreeSizeNoWaiting()); 431 EXPECT_EQ(kAlloc1 + kAlloc2, allocator_->GetLargestFreeSizeNoWaiting());
430 } 432 }
431 433
432 } // namespace gpu 434 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698