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

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

Issue 12494005: Use client side arrays for GL_STREAM_DRAW attributes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 #include "gpu/command_buffer/service/query_manager.h" 5 #include "gpu/command_buffer/service/query_manager.h"
6 #include "gpu/command_buffer/common/gles2_cmd_format.h" 6 #include "gpu/command_buffer/common/gles2_cmd_format.h"
7 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 7 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
10 #include "gpu/command_buffer/service/feature_info.h" 10 #include "gpu/command_buffer/service/feature_info.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 MockCommandBufferEngine() { 91 MockCommandBufferEngine() {
92 data_.reset(new int8[kSharedBufferSize]); 92 data_.reset(new int8[kSharedBufferSize]);
93 ClearSharedMemory(); 93 ClearSharedMemory();
94 valid_buffer_.ptr = data_.get(); 94 valid_buffer_.ptr = data_.get();
95 valid_buffer_.size = kSharedBufferSize; 95 valid_buffer_.size = kSharedBufferSize;
96 } 96 }
97 97
98 virtual ~MockCommandBufferEngine() { 98 virtual ~MockCommandBufferEngine() {
99 } 99 }
100 100
101 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE { 101 virtual gpu::Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE {
102 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_; 102 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_;
103 } 103 }
104 104
105 void ClearSharedMemory() { 105 void ClearSharedMemory() {
106 memset(data_.get(), kInitialMemoryValue, kSharedBufferSize); 106 memset(data_.get(), kInitialMemoryValue, kSharedBufferSize);
107 } 107 }
108 108
109 virtual void set_token(int32 token) OVERRIDE { 109 virtual void set_token(int32 token) OVERRIDE {
110 DCHECK(false); 110 DCHECK(false);
111 } 111 }
(...skipping 10 matching lines...) Expand all
122 } 122 }
123 123
124 // Overridden from CommandBufferEngine. 124 // Overridden from CommandBufferEngine.
125 virtual int32 GetGetOffset() OVERRIDE { 125 virtual int32 GetGetOffset() OVERRIDE {
126 DCHECK(false); 126 DCHECK(false);
127 return 0; 127 return 0;
128 } 128 }
129 129
130 private: 130 private:
131 scoped_array<int8> data_; 131 scoped_array<int8> data_;
132 Buffer valid_buffer_; 132 gpu::Buffer valid_buffer_;
133 Buffer invalid_buffer_; 133 gpu::Buffer invalid_buffer_;
134 }; 134 };
135 135
136 scoped_ptr<MockCommandBufferEngine> engine_; 136 scoped_ptr<MockCommandBufferEngine> engine_;
137 }; 137 };
138 138
139 // GCC requires these declarations, but MSVC requires they not be present 139 // GCC requires these declarations, but MSVC requires they not be present
140 #ifndef COMPILER_MSVC 140 #ifndef COMPILER_MSVC
141 const int32 QueryManagerTest::kSharedMemoryId; 141 const int32 QueryManagerTest::kSharedMemoryId;
142 const size_t QueryManagerTest::kSharedBufferSize; 142 const size_t QueryManagerTest::kSharedBufferSize;
143 const uint32 QueryManagerTest::kSharedMemoryOffset; 143 const uint32 QueryManagerTest::kSharedMemoryOffset;
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 561
562 EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), sync->result); 562 EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), sync->result);
563 563
564 manager->Destroy(false); 564 manager->Destroy(false);
565 } 565 }
566 566
567 } // namespace gles2 567 } // namespace gles2
568 } // namespace gpu 568 } // namespace gpu
569 569
570 570
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h ('k') | gpu/command_buffer/service/test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698