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

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

Issue 2910093004: Add TransferBufferInterface::shared_memory_handle() (Closed)
Patch Set: (rebase) Created 3 years, 6 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 | « no previous file | gpu/command_buffer/client/transfer_buffer.h » ('j') | 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 GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 for (int ii = 0; ii < kNumBuffers; ++ii) { 124 for (int ii = 0; ii < kNumBuffers; ++ii) {
125 buffers_[ii] = command_buffer_->CreateTransferBuffer( 125 buffers_[ii] = command_buffer_->CreateTransferBuffer(
126 size_ + ii * alignment_, 126 size_ + ii * alignment_,
127 &buffer_ids_[ii]); 127 &buffer_ids_[ii]);
128 EXPECT_NE(-1, buffer_ids_[ii]); 128 EXPECT_NE(-1, buffer_ids_[ii]);
129 } 129 }
130 } 130 }
131 131
132 ~MockTransferBuffer() override {} 132 ~MockTransferBuffer() override {}
133 133
134 base::SharedMemoryHandle shared_memory_handle() const override;
134 bool Initialize(unsigned int starting_buffer_size, 135 bool Initialize(unsigned int starting_buffer_size,
135 unsigned int result_size, 136 unsigned int result_size,
136 unsigned int /* min_buffer_size */, 137 unsigned int /* min_buffer_size */,
137 unsigned int /* max_buffer_size */, 138 unsigned int /* max_buffer_size */,
138 unsigned int alignment, 139 unsigned int alignment,
139 unsigned int size_to_flush) override; 140 unsigned int size_to_flush) override;
140 int GetShmId() override; 141 int GetShmId() override;
141 void* GetResultBuffer() override; 142 void* GetResultBuffer() override;
142 int GetResultOffset() override; 143 int GetResultOffset() override;
143 void Free() override; 144 void Free() override;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 int actual_buffer_index_; 237 int actual_buffer_index_;
237 int expected_buffer_index_; 238 int expected_buffer_index_;
238 void* last_alloc_; 239 void* last_alloc_;
239 uint32_t expected_offset_; 240 uint32_t expected_offset_;
240 uint32_t actual_offset_; 241 uint32_t actual_offset_;
241 bool initialize_fail_; 242 bool initialize_fail_;
242 243
243 DISALLOW_COPY_AND_ASSIGN(MockTransferBuffer); 244 DISALLOW_COPY_AND_ASSIGN(MockTransferBuffer);
244 }; 245 };
245 246
247 base::SharedMemoryHandle MockTransferBuffer::shared_memory_handle() const {
248 return base::SharedMemoryHandle();
249 }
250
246 bool MockTransferBuffer::Initialize( 251 bool MockTransferBuffer::Initialize(
247 unsigned int starting_buffer_size, 252 unsigned int starting_buffer_size,
248 unsigned int result_size, 253 unsigned int result_size,
249 unsigned int /* min_buffer_size */, 254 unsigned int /* min_buffer_size */,
250 unsigned int /* max_buffer_size */, 255 unsigned int /* max_buffer_size */,
251 unsigned int alignment, 256 unsigned int alignment,
252 unsigned int /* size_to_flush */) { 257 unsigned int /* size_to_flush */) {
253 // Just check they match. 258 // Just check they match.
254 return size_ == starting_buffer_size && 259 return size_ == starting_buffer_size &&
255 result_size_ == result_size && 260 result_size_ == result_size &&
(...skipping 4387 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 const GLuint texture_id = 1; 4648 const GLuint texture_id = 1;
4644 EXPECT_FALSE(gl_->LockDiscardableTextureCHROMIUM(texture_id)); 4649 EXPECT_FALSE(gl_->LockDiscardableTextureCHROMIUM(texture_id));
4645 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); 4650 EXPECT_EQ(GL_INVALID_VALUE, CheckError());
4646 } 4651 }
4647 4652
4648 #include "base/macros.h" 4653 #include "base/macros.h"
4649 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 4654 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
4650 4655
4651 } // namespace gles2 4656 } // namespace gles2
4652 } // namespace gpu 4657 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/transfer_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698