| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 Command Buffer Helper. | 5 // Tests for the Command Buffer Helper. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 #include "gpu/command_buffer/common/command_buffer.h" | 8 #include "gpu/command_buffer/common/command_buffer.h" |
| 9 #include "gpu/GLES2/gles2_command_buffer.h" | 9 #include "gpu/GLES2/gles2_command_buffer.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // CommandBuffer implementation: | 26 // CommandBuffer implementation: |
| 27 virtual bool Initialize(int32 size) { | 27 virtual bool Initialize(int32 size) { |
| 28 ring_buffer_.reset(new CommandBufferEntry[size]); | 28 ring_buffer_.reset(new CommandBufferEntry[size]); |
| 29 ring_buffer_buffer_.ptr = ring_buffer_.get(); | 29 ring_buffer_buffer_.ptr = ring_buffer_.get(); |
| 30 ring_buffer_buffer_.size = size; | 30 ring_buffer_buffer_.size = size; |
| 31 state_.num_entries = size / sizeof(ring_buffer_[0]); | 31 state_.num_entries = size / sizeof(ring_buffer_[0]); |
| 32 state_.token = 10000; // All token checks in the tests should pass. | 32 state_.token = 10000; // All token checks in the tests should pass. |
| 33 return true; | 33 return true; |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual bool Initialize(base::SharedMemory* buffer, int32 size) { |
| 37 GPU_NOTREACHED(); |
| 38 return false; |
| 39 } |
| 40 |
| 36 virtual Buffer GetRingBuffer() { | 41 virtual Buffer GetRingBuffer() { |
| 37 return ring_buffer_buffer_; | 42 return ring_buffer_buffer_; |
| 38 } | 43 } |
| 39 | 44 |
| 40 virtual State GetState() { | 45 virtual State GetState() { |
| 41 return state_; | 46 return state_; |
| 42 } | 47 } |
| 43 | 48 |
| 44 virtual void Flush(int32 put_offset) { | 49 virtual void Flush(int32 put_offset) { |
| 45 state_.put_offset = put_offset; | 50 state_.put_offset = put_offset; |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), gl_->GetError()); | 972 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), gl_->GetError()); |
| 968 const char* kPtr = "something"; | 973 const char* kPtr = "something"; |
| 969 gl_->UnmapTexSubImage2DCHROMIUM(kPtr); | 974 gl_->UnmapTexSubImage2DCHROMIUM(kPtr); |
| 970 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError()); | 975 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError()); |
| 971 } | 976 } |
| 972 | 977 |
| 973 } // namespace gles2 | 978 } // namespace gles2 |
| 974 } // namespace gpu | 979 } // namespace gpu |
| 975 | 980 |
| 976 | 981 |
| OLD | NEW |