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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 2154153002: Implement WebGL2 PixelStorei params constraints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test expectations Created 4 years, 5 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
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 static const GLenum kType = GL_UNSIGNED_BYTE; 2673 static const GLenum kType = GL_UNSIGNED_BYTE;
2674 static const GLint kLevel = 0; 2674 static const GLint kLevel = 0;
2675 static const GLint kBorder = 0; 2675 static const GLint kBorder = 0;
2676 // We're testing using the unpack params to pull a subimage out of a larger 2676 // We're testing using the unpack params to pull a subimage out of a larger
2677 // source of pixels. Here we specify the subimage by its border rows / 2677 // source of pixels. Here we specify the subimage by its border rows /
2678 // columns. 2678 // columns.
2679 static const GLint kSrcWidth = 23; 2679 static const GLint kSrcWidth = 23;
2680 static const GLint kSrcHeight = 7; 2680 static const GLint kSrcHeight = 7;
2681 static const GLint kSrcSubImageX0 = 11; 2681 static const GLint kSrcSubImageX0 = 11;
2682 static const GLint kSrcSubImageX1 = 16; 2682 static const GLint kSrcSubImageX1 = 16;
2683 static const GLint kSrcSubImageY0 = 20; 2683 static const GLint kSrcSubImageY0 = 1;
2684 static const GLint kSrcSubImageY1 = 23; 2684 static const GLint kSrcSubImageY1 = 4;
2685 static const GLint kSrcSubImageZ0 = 2; 2685 static const GLint kSrcSubImageZ0 = 2;
2686 static const GLint kSrcSubImageZ1 = 5; 2686 static const GLint kSrcSubImageZ1 = 5;
2687 static const GLint kSrcSubImageWidth = kSrcSubImageX1 - kSrcSubImageX0; 2687 static const GLint kSrcSubImageWidth = kSrcSubImageX1 - kSrcSubImageX0;
2688 static const GLint kSrcSubImageHeight = kSrcSubImageY1 - kSrcSubImageY0; 2688 static const GLint kSrcSubImageHeight = kSrcSubImageY1 - kSrcSubImageY0;
2689 static const GLint kSrcSubImageDepth = kSrcSubImageZ1 - kSrcSubImageZ0; 2689 static const GLint kSrcSubImageDepth = kSrcSubImageZ1 - kSrcSubImageZ0;
2690 2690
2691 // these are only used in the texsubimage tests 2691 // these are only used in the texsubimage tests
2692 static const GLint kTexWidth = 255; 2692 static const GLint kTexWidth = 255;
2693 static const GLint kTexHeight = 127; 2693 static const GLint kTexHeight = 127;
2694 static const GLint kTexDepth = 11; 2694 static const GLint kTexDepth = 11;
(...skipping 10 matching lines...) Expand all
2705 cmds::PixelStorei pixel_store_i[3]; 2705 cmds::PixelStorei pixel_store_i[3];
2706 cmds::TexImage3D tex_image_3d; 2706 cmds::TexImage3D tex_image_3d;
2707 cmds::TexSubImage3D tex_sub_image_3d; 2707 cmds::TexSubImage3D tex_sub_image_3d;
2708 } texSubImageExpected; 2708 } texSubImageExpected;
2709 2709
2710 uint32_t pixel_size; 2710 uint32_t pixel_size;
2711 PixelStoreParams pixel_params; 2711 PixelStoreParams pixel_params;
2712 // Makes sure the pixels size is large enough for all tests. 2712 // Makes sure the pixels size is large enough for all tests.
2713 pixel_params.alignment = 8; 2713 pixel_params.alignment = 8;
2714 ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3( 2714 ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3(
2715 kSrcWidth, kSrcSubImageY1, kSrcSubImageZ1, kFormat, kType, 2715 kSrcWidth, kSrcHeight, kSrcSubImageZ1, kFormat, kType,
2716 pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr)); 2716 pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr));
2717 std::unique_ptr<uint8_t[]> src_pixels; 2717 std::unique_ptr<uint8_t[]> src_pixels;
2718 src_pixels.reset(new uint8_t[pixel_size]); 2718 src_pixels.reset(new uint8_t[pixel_size]);
2719 for (size_t i = 0; i < pixel_size; ++i) { 2719 for (size_t i = 0; i < pixel_size; ++i) {
2720 src_pixels[i] = static_cast<uint8_t>(i % 255); 2720 src_pixels[i] = static_cast<uint8_t>(i % 255);
2721 } 2721 }
2722 2722
2723 for (int sub = 0; sub < 2; ++sub) { 2723 for (int sub = 0; sub < 2; ++sub) {
2724 for (size_t a = 0; a < arraysize(unpack_alignments); ++a) { 2724 for (size_t a = 0; a < arraysize(unpack_alignments); ++a) {
2725 const void* commands = GetPut(); 2725 const void* commands = GetPut();
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
4605 ContextInitOptions init_options; 4605 ContextInitOptions init_options;
4606 init_options.transfer_buffer_initialize_fail = true; 4606 init_options.transfer_buffer_initialize_fail = true;
4607 EXPECT_FALSE(Initialize(init_options)); 4607 EXPECT_FALSE(Initialize(init_options));
4608 } 4608 }
4609 4609
4610 #include "base/macros.h" 4610 #include "base/macros.h"
4611 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 4611 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
4612 4612
4613 } // namespace gles2 4613 } // namespace gles2
4614 } // namespace gpu 4614 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698