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

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

Issue 10876025: Free the command buffer on destruction. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Tests for the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include "gpu/command_buffer/client/transfer_buffer.h" 7 #include "gpu/command_buffer/client/transfer_buffer.h"
8 8
9 #include "gpu/command_buffer/client/client_test_helper.h" 9 #include "gpu/command_buffer/client/client_test_helper.h"
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 transfer_buffer_.reset(new TransferBuffer(helper_.get())); 69 transfer_buffer_.reset(new TransferBuffer(helper_.get()));
70 } 70 }
71 71
72 void TransferBufferTest::TearDown() { 72 void TransferBufferTest::TearDown() {
73 if (transfer_buffer_->HaveBuffer()) { 73 if (transfer_buffer_->HaveBuffer()) {
74 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) 74 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
75 .Times(1) 75 .Times(1)
76 .RetiresOnSaturation(); 76 .RetiresOnSaturation();
77 } 77 }
78 // For command buffer.
79 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
80 .Times(1)
81 .RetiresOnSaturation();
78 transfer_buffer_.reset(); 82 transfer_buffer_.reset();
79 } 83 }
80 84
81 // GCC requires these declarations, but MSVC requires they not be present 85 // GCC requires these declarations, but MSVC requires they not be present
82 #ifndef _MSC_VER 86 #ifndef _MSC_VER
83 const int32 TransferBufferTest::kNumCommandEntries; 87 const int32 TransferBufferTest::kNumCommandEntries;
84 const int32 TransferBufferTest::kCommandBufferSizeBytes; 88 const int32 TransferBufferTest::kCommandBufferSizeBytes;
85 const unsigned int TransferBufferTest::kStartingOffset; 89 const unsigned int TransferBufferTest::kStartingOffset;
86 const unsigned int TransferBufferTest::kAlignment; 90 const unsigned int TransferBufferTest::kAlignment;
87 const size_t TransferBufferTest::kTransferBufferSize; 91 const size_t TransferBufferTest::kTransferBufferSize;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 kAlignment, 278 kAlignment,
275 0)); 279 0));
276 } 280 }
277 281
278 void TransferBufferExpandContractTest::TearDown() { 282 void TransferBufferExpandContractTest::TearDown() {
279 if (transfer_buffer_->HaveBuffer()) { 283 if (transfer_buffer_->HaveBuffer()) {
280 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) 284 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
281 .Times(1) 285 .Times(1)
282 .RetiresOnSaturation(); 286 .RetiresOnSaturation();
283 } 287 }
288 // For command buffer.
289 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
290 .Times(1)
291 .RetiresOnSaturation();
284 transfer_buffer_.reset(); 292 transfer_buffer_.reset();
285 } 293 }
286 294
287 // GCC requires these declarations, but MSVC requires they not be present 295 // GCC requires these declarations, but MSVC requires they not be present
288 #ifndef _MSC_VER 296 #ifndef _MSC_VER
289 const int32 TransferBufferExpandContractTest::kNumCommandEntries; 297 const int32 TransferBufferExpandContractTest::kNumCommandEntries;
290 const int32 TransferBufferExpandContractTest::kCommandBufferSizeBytes; 298 const int32 TransferBufferExpandContractTest::kCommandBufferSizeBytes;
291 const unsigned int TransferBufferExpandContractTest::kStartingOffset; 299 const unsigned int TransferBufferExpandContractTest::kStartingOffset;
292 const unsigned int TransferBufferExpandContractTest::kAlignment; 300 const unsigned int TransferBufferExpandContractTest::kAlignment;
293 const size_t TransferBufferExpandContractTest::kStartTransferBufferSize; 301 const size_t TransferBufferExpandContractTest::kStartTransferBufferSize;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 457
450 // Check it's the default size. 458 // Check it's the default size.
451 EXPECT_EQ( 459 EXPECT_EQ(
452 kStartTransferBufferSize - kStartingOffset, 460 kStartTransferBufferSize - kStartingOffset,
453 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc()); 461 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc());
454 } 462 }
455 463
456 } // namespace gpu 464 } // namespace gpu
457 465
458 466
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698