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

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

Issue 184223003: gpu: Use explicit atomics instead of assuming that 32bit read/writes are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more s/uint32/base::subtle::Atomic32/ Created 6 years, 9 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 | « no previous file | gpu/command_buffer/client/query_tracker.h » ('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) 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 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 EXPECT_EQ(0, memcmp( 2919 EXPECT_EQ(0, memcmp(
2920 &expected_end_cmds, commands, sizeof(expected_end_cmds))); 2920 &expected_end_cmds, commands, sizeof(expected_end_cmds)));
2921 2921
2922 // Test EndQueryEXT fails if no current query. 2922 // Test EndQueryEXT fails if no current query.
2923 ClearCommands(); 2923 ClearCommands();
2924 gl_->EndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT); 2924 gl_->EndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT);
2925 EXPECT_TRUE(NoCommandsWritten()); 2925 EXPECT_TRUE(NoCommandsWritten());
2926 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); 2926 EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
2927 2927
2928 // Test 2nd Begin/End increments count. 2928 // Test 2nd Begin/End increments count.
2929 uint32 old_submit_count = query->submit_count(); 2929 base::subtle::Atomic32 old_submit_count = query->submit_count();
2930 gl_->BeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, id1); 2930 gl_->BeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, id1);
2931 EXPECT_NE(old_submit_count, query->submit_count()); 2931 EXPECT_NE(old_submit_count, query->submit_count());
2932 expected_end_cmds.end_query.Init( 2932 expected_end_cmds.end_query.Init(
2933 GL_ANY_SAMPLES_PASSED_EXT, query->submit_count()); 2933 GL_ANY_SAMPLES_PASSED_EXT, query->submit_count());
2934 commands = GetPut(); 2934 commands = GetPut();
2935 gl_->EndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT); 2935 gl_->EndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT);
2936 EXPECT_EQ(0, memcmp( 2936 EXPECT_EQ(0, memcmp(
2937 &expected_end_cmds, commands, sizeof(expected_end_cmds))); 2937 &expected_end_cmds, commands, sizeof(expected_end_cmds)));
2938 2938
2939 // Test BeginQueryEXT fails if target changed. 2939 // Test BeginQueryEXT fails if target changed.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
3098 Cmds expected; 3098 Cmds expected;
3099 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); 3099 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name);
3100 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 3100 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
3101 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3101 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3102 } 3102 }
3103 3103
3104 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 3104 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
3105 3105
3106 } // namespace gles2 3106 } // namespace gles2
3107 } // namespace gpu 3107 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/query_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698