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

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

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests Created 6 years, 8 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/error_state_mock.h" 8 #include "gpu/command_buffer/service/error_state_mock.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; 86 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
87 scoped_ptr<MockGLES2Decoder> decoder_; 87 scoped_ptr<MockGLES2Decoder> decoder_;
88 scoped_ptr<QueryManager> manager_; 88 scoped_ptr<QueryManager> manager_;
89 89
90 private: 90 private:
91 class MockCommandBufferEngine : public CommandBufferEngine { 91 class MockCommandBufferEngine : public CommandBufferEngine {
92 public: 92 public:
93 MockCommandBufferEngine() { 93 MockCommandBufferEngine() {
94 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); 94 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
95 shared_memory->CreateAndMapAnonymous(kSharedBufferSize); 95 shared_memory->CreateAndMapAnonymous(kSharedBufferSize);
96 valid_buffer_ = new gpu::Buffer(shared_memory.Pass(), kSharedBufferSize); 96 valid_buffer_ =
97 MakeBufferFromSharedMemory(shared_memory.Pass(), kSharedBufferSize);
97 data_ = static_cast<uint8*>(valid_buffer_->memory()); 98 data_ = static_cast<uint8*>(valid_buffer_->memory());
98 ClearSharedMemory(); 99 ClearSharedMemory();
99 } 100 }
100 101
101 virtual ~MockCommandBufferEngine() { 102 virtual ~MockCommandBufferEngine() {
102 } 103 }
103 104
104 virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id) 105 virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id)
105 OVERRIDE { 106 OVERRIDE {
106 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_; 107 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_;
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 569
569 EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), sync->result); 570 EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), sync->result);
570 571
571 manager->Destroy(false); 572 manager->Destroy(false);
572 } 573 }
573 574
574 } // namespace gles2 575 } // namespace gles2
575 } // namespace gpu 576 } // namespace gpu
576 577
577 578
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_scheduler_unittest.cc ('k') | gpu/command_buffer/service/transfer_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698