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

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

Issue 1025523005: gl_tests: Use zero size gl surface for offscreen rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make gpu_unittests pass as well Created 5 years, 9 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 helper_->Initialize(kBufferSize); 92 helper_->Initialize(kBufferSize);
93 } 93 }
94 94
95 int32 GetToken() { 95 int32 GetToken() {
96 return command_buffer_->GetLastState().token; 96 return command_buffer_->GetLastState().token;
97 } 97 }
98 98
99 #if defined(OS_MACOSX) 99 #if defined(OS_MACOSX)
100 base::mac::ScopedNSAutoreleasePool autorelease_pool_; 100 base::mac::ScopedNSAutoreleasePool autorelease_pool_;
101 #endif 101 #endif
102 #if !defined(USE_OZONE)
102 base::MessageLoop message_loop_; 103 base::MessageLoop message_loop_;
104 #endif
103 scoped_ptr<AsyncAPIMock> api_mock_; 105 scoped_ptr<AsyncAPIMock> api_mock_;
104 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; 106 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_;
105 scoped_ptr<CommandBufferService> command_buffer_; 107 scoped_ptr<CommandBufferService> command_buffer_;
106 scoped_ptr<GpuScheduler> gpu_scheduler_; 108 scoped_ptr<GpuScheduler> gpu_scheduler_;
107 scoped_ptr<CommandBufferHelper> helper_; 109 scoped_ptr<CommandBufferHelper> helper_;
108 std::vector<const void*> set_token_arguments_; 110 std::vector<const void*> set_token_arguments_;
109 bool delay_set_token_; 111 bool delay_set_token_;
110 112
111 scoped_ptr<int8[]> buffer_; 113 scoped_ptr<int8[]> buffer_;
112 int8* buffer_start_; 114 int8* buffer_start_;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 pointer = allocator_->Alloc(kAlloc2); 209 pointer = allocator_->Alloc(kAlloc2);
208 EXPECT_EQ(kBufferSize - kAlloc1 - kAlloc2, 210 EXPECT_EQ(kBufferSize - kAlloc1 - kAlloc2,
209 allocator_->GetLargestFreeSizeNoWaiting()); 211 allocator_->GetLargestFreeSizeNoWaiting());
210 allocator_->FreePendingToken(pointer, helper_.get()->InsertToken()); 212 allocator_->FreePendingToken(pointer, helper_.get()->InsertToken());
211 pointer = allocator_->Alloc(kBufferSize); 213 pointer = allocator_->Alloc(kBufferSize);
212 EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting()); 214 EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting());
213 allocator_->FreePendingToken(pointer, helper_.get()->InsertToken()); 215 allocator_->FreePendingToken(pointer, helper_.get()->InsertToken());
214 } 216 }
215 217
216 } // namespace gpu 218 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698