OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
no sievers
2016/04/05 19:02:41
#include <memory>
Mostyn Bramley-Moore
2016/04/05 21:35:31
Done.
| |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 13 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
14 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 14 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
15 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 15 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
16 #include "gpu/command_buffer/service/context_group.h" | 16 #include "gpu/command_buffer/service/context_group.h" |
17 #include "gpu/command_buffer/service/context_state.h" | 17 #include "gpu/command_buffer/service/context_state.h" |
18 #include "gpu/command_buffer/service/gl_surface_mock.h" | 18 #include "gpu/command_buffer/service/gl_surface_mock.h" |
19 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" |
20 | 20 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 GL_UNSIGNED_BYTE, | 565 GL_UNSIGNED_BYTE, |
566 pixels_shm_id, | 566 pixels_shm_id, |
567 pixels_shm_offset, | 567 pixels_shm_offset, |
568 result_shm_id, | 568 result_shm_id, |
569 result_shm_offset, | 569 result_shm_offset, |
570 false); | 570 false); |
571 result->success = 0; | 571 result->success = 0; |
572 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 572 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
573 | 573 |
574 GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1); | 574 GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1); |
575 scoped_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]); | 575 std::unique_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]); |
576 scoped_ptr<int8_t[]> pack(new int8_t[kPackAlignment]); | 576 std::unique_ptr<int8_t[]> pack(new int8_t[kPackAlignment]); |
577 memset(zero.get(), kInitialMemoryValue, unpadded_row_size); | 577 memset(zero.get(), kInitialMemoryValue, unpadded_row_size); |
578 memset(pack.get(), kInitialMemoryValue, kPackAlignment); | 578 memset(pack.get(), kInitialMemoryValue, kPackAlignment); |
579 for (GLint yy = 0; yy < in_read_height; ++yy) { | 579 for (GLint yy = 0; yy < in_read_height; ++yy) { |
580 const int8_t* row = static_cast<const int8_t*>( | 580 const int8_t* row = static_cast<const int8_t*>( |
581 emu.ComputePackAlignmentAddress(0, yy, in_read_width, dest)); | 581 emu.ComputePackAlignmentAddress(0, yy, in_read_width, dest)); |
582 GLint y = in_read_y + yy; | 582 GLint y = in_read_y + yy; |
583 if (y < 0 || y >= kHeight) { | 583 if (y < 0 || y >= kHeight) { |
584 EXPECT_EQ(0, memcmp(zero.get(), row, unpadded_row_size)); | 584 EXPECT_EQ(0, memcmp(zero.get(), row, unpadded_row_size)); |
585 } else { | 585 } else { |
586 // check off left. | 586 // check off left. |
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3311 EXPECT_EQ(1, result->GetNumResults()); | 3311 EXPECT_EQ(1, result->GetNumResults()); |
3312 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3312 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
3313 } | 3313 } |
3314 | 3314 |
3315 // TODO(gman): PixelStorei | 3315 // TODO(gman): PixelStorei |
3316 | 3316 |
3317 // TODO(gman): SwapBuffers | 3317 // TODO(gman): SwapBuffers |
3318 | 3318 |
3319 } // namespace gles2 | 3319 } // namespace gles2 |
3320 } // namespace gpu | 3320 } // namespace gpu |
OLD | NEW |