Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 13454036: Rewrite scoped_array<T> to scoped_ptr<T[]> in gpu/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yikes Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698