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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2348 uint32 unpadded_row_size; | 2348 uint32 unpadded_row_size; |
2349 uint32 padded_row_size; | 2349 uint32 padded_row_size; |
2350 ASSERT_TRUE(GLES2Util::ComputeImageDataSizes( | 2350 ASSERT_TRUE(GLES2Util::ComputeImageDataSizes( |
2351 kSrcSubImageWidth, kSrcSubImageHeight, kFormat, kType, alignment, | 2351 kSrcSubImageWidth, kSrcSubImageHeight, kFormat, kType, alignment, |
2352 &size, &unpadded_row_size, &padded_row_size)); | 2352 &size, &unpadded_row_size, &padded_row_size)); |
2353 ASSERT_TRUE(size <= MaxTransferBufferSize()); | 2353 ASSERT_TRUE(size <= MaxTransferBufferSize()); |
2354 ExpectedMemoryInfo mem = GetExpectedMemory(size); | 2354 ExpectedMemoryInfo mem = GetExpectedMemory(size); |
2355 | 2355 |
2356 const void* commands = GetPut(); | 2356 const void* commands = GetPut(); |
2357 gl_->PixelStorei(GL_UNPACK_ALIGNMENT, alignment); | 2357 gl_->PixelStorei(GL_UNPACK_ALIGNMENT, alignment); |
2358 gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, kSrcWidth); | 2358 gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, kSrcWidth); |
2359 gl_->PixelStorei(GL_UNPACK_SKIP_PIXELS, kSrcSubImageX0); | 2359 gl_->PixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, kSrcSubImageX0); |
2360 gl_->PixelStorei(GL_UNPACK_SKIP_ROWS, kSrcSubImageY0); | 2360 gl_->PixelStorei(GL_UNPACK_SKIP_ROWS_EXT, kSrcSubImageY0); |
2361 gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, flip_y); | 2361 gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, flip_y); |
2362 if (sub) { | 2362 if (sub) { |
2363 gl_->TexImage2D( | 2363 gl_->TexImage2D( |
2364 GL_TEXTURE_2D, kLevel, kFormat, kTexWidth, kTexHeight, kBorder, | 2364 GL_TEXTURE_2D, kLevel, kFormat, kTexWidth, kTexHeight, kBorder, |
2365 kFormat, kType, NULL); | 2365 kFormat, kType, NULL); |
2366 gl_->TexSubImage2D( | 2366 gl_->TexSubImage2D( |
2367 GL_TEXTURE_2D, kLevel, kTexSubXOffset, kTexSubYOffset, | 2367 GL_TEXTURE_2D, kLevel, kTexSubXOffset, kTexSubYOffset, |
2368 kSrcSubImageWidth, kSrcSubImageHeight, kFormat, kType, | 2368 kSrcSubImageWidth, kSrcSubImageHeight, kFormat, kType, |
2369 src_pixels.get()); | 2369 src_pixels.get()); |
2370 texSubImageExpected.pixel_store_i.Init( | 2370 texSubImageExpected.pixel_store_i.Init( |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 ClearCommands(); | 2871 ClearCommands(); |
2872 gl_->Enable(GL_BLEND); | 2872 gl_->Enable(GL_BLEND); |
2873 EXPECT_TRUE(NoCommandsWritten()); | 2873 EXPECT_TRUE(NoCommandsWritten()); |
2874 } | 2874 } |
2875 | 2875 |
2876 | 2876 |
2877 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 2877 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
2878 | 2878 |
2879 } // namespace gles2 | 2879 } // namespace gles2 |
2880 } // namespace gpu | 2880 } // namespace gpu |
OLD | NEW |