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

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

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
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
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 4301 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 | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/client/mapped_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698