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

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

Issue 7358006: Cache OpenGL program info on the client side of the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc ('k') | gpu/gpu.gyp » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/program_manager.h" 5 #include "gpu/command_buffer/service/program_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 ASSERT_TRUE(program_info != NULL); 850 ASSERT_TRUE(program_info != NULL);
851 program_info->GetProgramInfo(&bucket); 851 program_info->GetProgramInfo(&bucket);
852 ProgramInfoHeader* header = 852 ProgramInfoHeader* header =
853 bucket.GetDataAs<ProgramInfoHeader*>(0, sizeof(ProgramInfoHeader)); 853 bucket.GetDataAs<ProgramInfoHeader*>(0, sizeof(ProgramInfoHeader));
854 ASSERT_TRUE(header != NULL); 854 ASSERT_TRUE(header != NULL);
855 EXPECT_EQ(1u, header->link_status); 855 EXPECT_EQ(1u, header->link_status);
856 EXPECT_EQ(arraysize(kAttribs), header->num_attribs); 856 EXPECT_EQ(arraysize(kAttribs), header->num_attribs);
857 EXPECT_EQ(arraysize(kUniforms), header->num_uniforms); 857 EXPECT_EQ(arraysize(kUniforms), header->num_uniforms);
858 const ProgramInput* inputs = bucket.GetDataAs<const ProgramInput*>( 858 const ProgramInput* inputs = bucket.GetDataAs<const ProgramInput*>(
859 sizeof(*header), 859 sizeof(*header),
860 sizeof(ProgramInput) * (header->num_attribs + header->num_attribs)); 860 sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms));
861 ASSERT_TRUE(inputs != NULL); 861 ASSERT_TRUE(inputs != NULL);
862 const ProgramInput* input = inputs; 862 const ProgramInput* input = inputs;
863 // TODO(gman): Don't assume these are in order. 863 // TODO(gman): Don't assume these are in order.
864 for (uint32 ii = 0; ii < header->num_attribs; ++ii) { 864 for (uint32 ii = 0; ii < header->num_attribs; ++ii) {
865 const AttribInfo& expected = kAttribs[ii]; 865 const AttribInfo& expected = kAttribs[ii];
866 EXPECT_EQ(expected.size, input->size); 866 EXPECT_EQ(expected.size, input->size);
867 EXPECT_EQ(expected.type, input->type); 867 EXPECT_EQ(expected.type, input->type);
868 const int32* location = bucket.GetDataAs<const int32*>( 868 const int32* location = bucket.GetDataAs<const int32*>(
869 input->location_offset, sizeof(int32)); 869 input->location_offset, sizeof(int32));
870 ASSERT_TRUE(location != NULL); 870 ASSERT_TRUE(location != NULL);
(...skipping 24 matching lines...) Expand all
895 ++input; 895 ++input;
896 } 896 }
897 EXPECT_EQ(header->num_attribs + header->num_uniforms, 897 EXPECT_EQ(header->num_attribs + header->num_uniforms,
898 static_cast<uint32>(input - inputs)); 898 static_cast<uint32>(input - inputs));
899 } 899 }
900 900
901 } // namespace gles2 901 } // namespace gles2
902 } // namespace gpu 902 } // namespace gpu
903 903
904 904
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc ('k') | gpu/gpu.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698