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

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

Issue 1186393004: gpu: Remove async texture uploads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 // Tests for the BufferTracker. 5 // Tests for the BufferTracker.
6 6
7 #include "gpu/command_buffer/client/buffer_tracker.h" 7 #include "gpu/command_buffer/client/buffer_tracker.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 void set_context_lost(bool context_lost) { 38 void set_context_lost(bool context_lost) {
39 context_lost_ = context_lost; 39 context_lost_ = context_lost;
40 } 40 }
41 41
42 private: 42 private:
43 bool context_lost_; 43 bool context_lost_;
44 }; 44 };
45 45
46 namespace {
47 void EmptyPoll() {
48 }
49 }
50
51 class BufferTrackerTest : public testing::Test { 46 class BufferTrackerTest : public testing::Test {
52 protected: 47 protected:
53 static const int32 kNumCommandEntries = 400; 48 static const int32 kNumCommandEntries = 400;
54 static const int32 kCommandBufferSizeBytes = 49 static const int32 kCommandBufferSizeBytes =
55 kNumCommandEntries * sizeof(CommandBufferEntry); 50 kNumCommandEntries * sizeof(CommandBufferEntry);
56 51
57 void SetUp() override { 52 void SetUp() override {
58 command_buffer_.reset(new MockClientCommandBufferImpl()); 53 command_buffer_.reset(new MockClientCommandBufferImpl());
59 helper_.reset(new GLES2CmdHelper(command_buffer_.get())); 54 helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
60 helper_->Initialize(kCommandBufferSizeBytes); 55 helper_->Initialize(kCommandBufferSizeBytes);
61 mapped_memory_.reset(new MappedMemoryManager( 56 mapped_memory_.reset(
62 helper_.get(), base::Bind(&EmptyPoll), MappedMemoryManager::kNoLimit)); 57 new MappedMemoryManager(helper_.get(), MappedMemoryManager::kNoLimit));
63 buffer_tracker_.reset(new BufferTracker(mapped_memory_.get())); 58 buffer_tracker_.reset(new BufferTracker(mapped_memory_.get()));
64 } 59 }
65 60
66 void TearDown() override { 61 void TearDown() override {
67 buffer_tracker_.reset(); 62 buffer_tracker_.reset();
68 mapped_memory_.reset(); 63 mapped_memory_.reset();
69 helper_.reset(); 64 helper_.reset();
70 command_buffer_.reset(); 65 command_buffer_.reset();
71 } 66 }
72 67
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 buffer_tracker_->Unmanage(buffer); 140 buffer_tracker_->Unmanage(buffer);
146 buffer_tracker_->RemoveBuffer(kId); 141 buffer_tracker_->RemoveBuffer(kId);
147 EXPECT_EQ(mapped_memory_->bytes_in_use(), static_cast<size_t>(size)); 142 EXPECT_EQ(mapped_memory_->bytes_in_use(), static_cast<size_t>(size));
148 143
149 mapped_memory_->Free(mem); 144 mapped_memory_->Free(mem);
150 EXPECT_EQ(mapped_memory_->bytes_in_use(), static_cast<size_t>(0)); 145 EXPECT_EQ(mapped_memory_->bytes_in_use(), static_cast<size_t>(0));
151 } 146 }
152 147
153 } // namespace gles2 148 } // namespace gles2
154 } // namespace gpu 149 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/fenced_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698