| OLD | NEW |
| 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 <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // we need to know their address before GLES2Implementation::Initialize | 107 // we need to know their address before GLES2Implementation::Initialize |
| 108 // is called. | 108 // is called. |
| 109 for (int ii = 0; ii < kNumBuffers; ++ii) { | 109 for (int ii = 0; ii < kNumBuffers; ++ii) { |
| 110 buffers_[ii] = command_buffer_->CreateTransferBuffer( | 110 buffers_[ii] = command_buffer_->CreateTransferBuffer( |
| 111 size_ + ii * alignment_, | 111 size_ + ii * alignment_, |
| 112 &buffer_ids_[ii]); | 112 &buffer_ids_[ii]); |
| 113 EXPECT_NE(-1, buffer_ids_[ii]); | 113 EXPECT_NE(-1, buffer_ids_[ii]); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 virtual ~MockTransferBuffer() { } | 117 ~MockTransferBuffer() override {} |
| 118 | 118 |
| 119 virtual bool Initialize( | 119 bool Initialize(unsigned int starting_buffer_size, |
| 120 unsigned int starting_buffer_size, | 120 unsigned int result_size, |
| 121 unsigned int result_size, | 121 unsigned int /* min_buffer_size */, |
| 122 unsigned int /* min_buffer_size */, | 122 unsigned int /* max_buffer_size */, |
| 123 unsigned int /* max_buffer_size */, | 123 unsigned int alignment, |
| 124 unsigned int alignment, | 124 unsigned int size_to_flush) override; |
| 125 unsigned int size_to_flush) override; | 125 int GetShmId() override; |
| 126 virtual int GetShmId() override; | 126 void* GetResultBuffer() override; |
| 127 virtual void* GetResultBuffer() override; | 127 int GetResultOffset() override; |
| 128 virtual int GetResultOffset() override; | 128 void Free() override; |
| 129 virtual void Free() override; | 129 bool HaveBuffer() const override; |
| 130 virtual bool HaveBuffer() const override; | 130 void* AllocUpTo(unsigned int size, unsigned int* size_allocated) override; |
| 131 virtual void* AllocUpTo( | 131 void* Alloc(unsigned int size) override; |
| 132 unsigned int size, unsigned int* size_allocated) override; | 132 RingBuffer::Offset GetOffset(void* pointer) const override; |
| 133 virtual void* Alloc(unsigned int size) override; | 133 void FreePendingToken(void* p, unsigned int /* token */) override; |
| 134 virtual RingBuffer::Offset GetOffset(void* pointer) const override; | |
| 135 virtual void FreePendingToken(void* p, unsigned int /* token */) override; | |
| 136 | 134 |
| 137 size_t MaxTransferBufferSize() { | 135 size_t MaxTransferBufferSize() { |
| 138 return size_ - result_size_; | 136 return size_ - result_size_; |
| 139 } | 137 } |
| 140 | 138 |
| 141 unsigned int RoundToAlignment(unsigned int size) { | 139 unsigned int RoundToAlignment(unsigned int size) { |
| 142 return (size + alignment_ - 1) & ~(alignment_ - 1); | 140 return (size + alignment_ - 1) & ~(alignment_ - 1); |
| 143 } | 141 } |
| 144 | 142 |
| 145 bool InSync() { | 143 bool InSync() { |
| (...skipping 3259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3405 ContextInitOptions init_options; | 3403 ContextInitOptions init_options; |
| 3406 init_options.bind_generates_resource_client = true; | 3404 init_options.bind_generates_resource_client = true; |
| 3407 init_options.bind_generates_resource_service = false; | 3405 init_options.bind_generates_resource_service = false; |
| 3408 EXPECT_FALSE(Initialize(init_options)); | 3406 EXPECT_FALSE(Initialize(init_options)); |
| 3409 } | 3407 } |
| 3410 | 3408 |
| 3411 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 3409 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 3412 | 3410 |
| 3413 } // namespace gles2 | 3411 } // namespace gles2 |
| 3414 } // namespace gpu | 3412 } // namespace gpu |
| OLD | NEW |