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

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

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: Implement buckets Created 3 years, 11 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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 int GetResultOffset() override; 142 int GetResultOffset() override;
143 void Free() override; 143 void Free() override;
144 bool HaveBuffer() const override; 144 bool HaveBuffer() const override;
145 void* AllocUpTo(unsigned int size, unsigned int* size_allocated) override; 145 void* AllocUpTo(unsigned int size, unsigned int* size_allocated) override;
146 void* Alloc(unsigned int size) override; 146 void* Alloc(unsigned int size) override;
147 RingBuffer::Offset GetOffset(void* pointer) const override; 147 RingBuffer::Offset GetOffset(void* pointer) const override;
148 void DiscardBlock(void* p) override; 148 void DiscardBlock(void* p) override;
149 void FreePendingToken(void* p, unsigned int /* token */) override; 149 void FreePendingToken(void* p, unsigned int /* token */) override;
150 unsigned int GetSize() const override; 150 unsigned int GetSize() const override;
151 unsigned int GetFreeSize() const override; 151 unsigned int GetFreeSize() const override;
152 base::SharedMemory* GetSharedMemory() const override;
152 153
153 size_t MaxTransferBufferSize() { 154 size_t MaxTransferBufferSize() {
154 return size_ - result_size_; 155 return size_ - result_size_;
155 } 156 }
156 157
157 unsigned int RoundToAlignment(unsigned int size) { 158 unsigned int RoundToAlignment(unsigned int size) {
158 return (size + alignment_ - 1) & ~(alignment_ - 1); 159 return (size + alignment_ - 1) & ~(alignment_ - 1);
159 } 160 }
160 161
161 bool InSync() { 162 bool InSync() {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 323 }
323 324
324 unsigned int MockTransferBuffer::GetSize() const { 325 unsigned int MockTransferBuffer::GetSize() const {
325 return 0; 326 return 0;
326 } 327 }
327 328
328 unsigned int MockTransferBuffer::GetFreeSize() const { 329 unsigned int MockTransferBuffer::GetFreeSize() const {
329 return 0; 330 return 0;
330 } 331 }
331 332
333 base::SharedMemory* MockTransferBuffer::GetSharedMemory() const {
334 return nullptr;
335 }
336
332 // API wrapper for Buffers. 337 // API wrapper for Buffers.
333 class GenBuffersAPI { 338 class GenBuffersAPI {
334 public: 339 public:
335 static void Gen(GLES2Implementation* gl_impl, GLsizei n, GLuint* ids) { 340 static void Gen(GLES2Implementation* gl_impl, GLsizei n, GLuint* ids) {
336 gl_impl->GenBuffers(n, ids); 341 gl_impl->GenBuffers(n, ids);
337 } 342 }
338 343
339 static void Delete(GLES2Implementation* gl_impl, 344 static void Delete(GLES2Implementation* gl_impl,
340 GLsizei n, 345 GLsizei n,
341 const GLuint* ids) { 346 const GLuint* ids) {
(...skipping 4322 matching lines...) Expand 10 before | Expand all | Expand 10 after
4664 ContextInitOptions init_options; 4669 ContextInitOptions init_options;
4665 init_options.transfer_buffer_initialize_fail = true; 4670 init_options.transfer_buffer_initialize_fail = true;
4666 EXPECT_FALSE(Initialize(init_options)); 4671 EXPECT_FALSE(Initialize(init_options));
4667 } 4672 }
4668 4673
4669 #include "base/macros.h" 4674 #include "base/macros.h"
4670 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 4675 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
4671 4676
4672 } // namespace gles2 4677 } // namespace gles2
4673 } // namespace gpu 4678 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698