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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
10 #include "gpu/command_buffer/common/id_allocator.h" | 10 #include "gpu/command_buffer/common/id_allocator.h" |
(...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 } | 2334 } |
2335 } | 2335 } |
2336 ReadPixels cmd; | 2336 ReadPixels cmd; |
2337 cmd.Init(in_read_x, in_read_y, in_read_width, in_read_height, | 2337 cmd.Init(in_read_x, in_read_y, in_read_width, in_read_height, |
2338 kFormat, GL_UNSIGNED_BYTE, | 2338 kFormat, GL_UNSIGNED_BYTE, |
2339 pixels_shm_id, pixels_shm_offset, | 2339 pixels_shm_id, pixels_shm_offset, |
2340 result_shm_id, result_shm_offset); | 2340 result_shm_id, result_shm_offset); |
2341 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2341 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
2342 | 2342 |
2343 GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1); | 2343 GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1); |
2344 scoped_array<int8> zero(new int8[unpadded_row_size]); | 2344 scoped_ptr<int8[]> zero(new int8[unpadded_row_size]); |
2345 scoped_array<int8> pack(new int8[kPackAlignment]); | 2345 scoped_ptr<int8[]> pack(new int8[kPackAlignment]); |
2346 memset(zero.get(), 0, unpadded_row_size); | 2346 memset(zero.get(), 0, unpadded_row_size); |
2347 memset(pack.get(), kInitialMemoryValue, kPackAlignment); | 2347 memset(pack.get(), kInitialMemoryValue, kPackAlignment); |
2348 for (GLint yy = 0; yy < in_read_height; ++yy) { | 2348 for (GLint yy = 0; yy < in_read_height; ++yy) { |
2349 const int8* row = static_cast<const int8*>( | 2349 const int8* row = static_cast<const int8*>( |
2350 emu.ComputePackAlignmentAddress(0, yy, in_read_width, dest)); | 2350 emu.ComputePackAlignmentAddress(0, yy, in_read_width, dest)); |
2351 GLint y = in_read_y + yy; | 2351 GLint y = in_read_y + yy; |
2352 if (y < 0 || y >= kHeight) { | 2352 if (y < 0 || y >= kHeight) { |
2353 EXPECT_EQ(0, memcmp(zero.get(), row, unpadded_row_size)); | 2353 EXPECT_EQ(0, memcmp(zero.get(), row, unpadded_row_size)); |
2354 } else { | 2354 } else { |
2355 // check off left. | 2355 // check off left. |
(...skipping 6157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8513 // TODO(gman): TexImage2DImmediate | 8513 // TODO(gman): TexImage2DImmediate |
8514 | 8514 |
8515 // TODO(gman): TexSubImage2DImmediate | 8515 // TODO(gman): TexSubImage2DImmediate |
8516 | 8516 |
8517 // TODO(gman): UseProgram | 8517 // TODO(gman): UseProgram |
8518 | 8518 |
8519 // TODO(gman): SwapBuffers | 8519 // TODO(gman): SwapBuffers |
8520 | 8520 |
8521 } // namespace gles2 | 8521 } // namespace gles2 |
8522 } // namespace gpu | 8522 } // namespace gpu |
OLD | NEW |