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

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

Issue 6883179: Rework FlushSync to return early if commands have been processed since the last update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style Created 9 years, 7 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) 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 // Tests for the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 #include "gpu/command_buffer/common/command_buffer.h" 8 #include "gpu/command_buffer/common/command_buffer.h"
9 #include "gpu/GLES2/gles2_command_buffer.h" 9 #include "gpu/GLES2/gles2_command_buffer.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 virtual State GetState() { 45 virtual State GetState() {
46 return state_; 46 return state_;
47 } 47 }
48 48
49 virtual void Flush(int32 put_offset) { 49 virtual void Flush(int32 put_offset) {
50 state_.put_offset = put_offset; 50 state_.put_offset = put_offset;
51 } 51 }
52 52
53 virtual State FlushSync(int32 put_offset) { 53 virtual State FlushSync(int32 put_offset, int32 last_known_get) {
54 state_.put_offset = put_offset; 54 state_.put_offset = put_offset;
55 state_.get_offset = put_offset; 55 state_.get_offset = put_offset;
56 OnFlush(transfer_buffer_buffer_.ptr); 56 OnFlush(transfer_buffer_buffer_.ptr);
57 57
58 return state_; 58 return state_;
59 } 59 }
60 60
61 virtual void SetGetOffset(int32 get_offset) { 61 virtual void SetGetOffset(int32 get_offset) {
62 state_.get_offset = get_offset; 62 state_.get_offset = get_offset;
63 } 63 }
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), gl_->GetError()); 973 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), gl_->GetError());
974 const char* kPtr = "something"; 974 const char* kPtr = "something";
975 gl_->UnmapTexSubImage2DCHROMIUM(kPtr); 975 gl_->UnmapTexSubImage2DCHROMIUM(kPtr);
976 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError()); 976 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError());
977 } 977 }
978 978
979 } // namespace gles2 979 } // namespace gles2
980 } // namespace gpu 980 } // namespace gpu
981 981
982 982
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_demo.cc ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698