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 #include "app/gfx/gl/gl_mock.h" |
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 6 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
8 #include "gpu/command_buffer/common/id_allocator.h" | 9 #include "gpu/command_buffer/common/id_allocator.h" |
9 #include "gpu/command_buffer/service/gl_mock.h" | |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
12 #include "gpu/command_buffer/service/context_group.h" | 12 #include "gpu/command_buffer/service/context_group.h" |
13 #include "gpu/command_buffer/service/program_manager.h" | 13 #include "gpu/command_buffer/service/program_manager.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using ::gles2::MockGLInterface; | 16 using ::gfx::MockGLInterface; |
17 using ::testing::_; | 17 using ::testing::_; |
18 using ::testing::DoAll; | 18 using ::testing::DoAll; |
19 using ::testing::InSequence; | 19 using ::testing::InSequence; |
20 using ::testing::Invoke; | 20 using ::testing::Invoke; |
21 using ::testing::MatcherCast; | 21 using ::testing::MatcherCast; |
22 using ::testing::Pointee; | 22 using ::testing::Pointee; |
23 using ::testing::Return; | 23 using ::testing::Return; |
24 using ::testing::SetArrayArgument; | 24 using ::testing::SetArrayArgument; |
25 using ::testing::SetArgumentPointee; | 25 using ::testing::SetArgumentPointee; |
26 using ::testing::StrEq; | 26 using ::testing::StrEq; |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 const GLsizei kWidth = 5; | 1459 const GLsizei kWidth = 5; |
1460 const GLsizei kHeight = 3; | 1460 const GLsizei kHeight = 3; |
1461 const GLint kBytesPerPixel = 3; | 1461 const GLint kBytesPerPixel = 3; |
1462 const GLint kPackAlignment = 4; | 1462 const GLint kPackAlignment = 4; |
1463 static const int8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = { | 1463 static const int8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = { |
1464 12, 13, 14, 18, 19, 18, 19, 12, 13, 14, 18, 19, 18, 19, 13, | 1464 12, 13, 14, 18, 19, 18, 19, 12, 13, 14, 18, 19, 18, 19, 13, |
1465 29, 28, 23, 22, 21, 22, 21, 29, 28, 23, 22, 21, 22, 21, 28, | 1465 29, 28, 23, 22, 21, 22, 21, 29, 28, 23, 22, 21, 22, 21, 28, |
1466 31, 34, 39, 37, 32, 37, 32, 31, 34, 39, 37, 32, 37, 32, 34, | 1466 31, 34, 39, 37, 32, 37, 32, 31, 34, 39, 37, 32, 37, 32, 34, |
1467 }; | 1467 }; |
1468 | 1468 |
| 1469 context_->SetSize(gfx::Size(INT_MAX, INT_MAX)); |
| 1470 |
1469 ReadPixelsEmulator emu( | 1471 ReadPixelsEmulator emu( |
1470 kWidth, kHeight, kBytesPerPixel, kSrcPixels, kPackAlignment); | 1472 kWidth, kHeight, kBytesPerPixel, kSrcPixels, kPackAlignment); |
1471 typedef ReadPixels::Result Result; | 1473 typedef ReadPixels::Result Result; |
1472 Result* result = GetSharedMemoryAs<Result*>(); | 1474 Result* result = GetSharedMemoryAs<Result*>(); |
1473 uint32 result_shm_id = kSharedMemoryId; | 1475 uint32 result_shm_id = kSharedMemoryId; |
1474 uint32 result_shm_offset = kSharedMemoryOffset; | 1476 uint32 result_shm_offset = kSharedMemoryOffset; |
1475 uint32 pixels_shm_id = kSharedMemoryId; | 1477 uint32 pixels_shm_id = kSharedMemoryId; |
1476 uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(*result); | 1478 uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(*result); |
1477 void* dest = &result[1]; | 1479 void* dest = &result[1]; |
1478 EXPECT_CALL(*gl_, GetError()) | 1480 EXPECT_CALL(*gl_, GetError()) |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 // TODO(gman): UseProgram | 2187 // TODO(gman): UseProgram |
2186 | 2188 |
2187 // TODO(gman): SwapBuffers | 2189 // TODO(gman): SwapBuffers |
2188 | 2190 |
2189 // TODO(gman): VertexAttribPointer | 2191 // TODO(gman): VertexAttribPointer |
2190 | 2192 |
2191 } // namespace gles2 | 2193 } // namespace gles2 |
2192 } // namespace gpu | 2194 } // namespace gpu |
2193 | 2195 |
2194 | 2196 |
OLD | NEW |