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

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

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 15 matching lines...) Expand all
26 using ::testing::Return; 26 using ::testing::Return;
27 using ::testing::SetArrayArgument; 27 using ::testing::SetArrayArgument;
28 using ::testing::SetArgumentPointee; 28 using ::testing::SetArgumentPointee;
29 using ::testing::StrEq; 29 using ::testing::StrEq;
30 using ::testing::StrictMock; 30 using ::testing::StrictMock;
31 31
32 namespace gpu { 32 namespace gpu {
33 namespace gles2 { 33 namespace gles2 {
34 34
35 GLES2DecoderTestBase::GLES2DecoderTestBase() 35 GLES2DecoderTestBase::GLES2DecoderTestBase()
36 : client_buffer_id_(100), 36 : surface_(NULL),
37 context_(NULL),
38 client_buffer_id_(100),
37 client_framebuffer_id_(101), 39 client_framebuffer_id_(101),
38 client_program_id_(102), 40 client_program_id_(102),
39 client_renderbuffer_id_(103), 41 client_renderbuffer_id_(103),
40 client_shader_id_(104), 42 client_shader_id_(104),
41 client_texture_id_(106), 43 client_texture_id_(106),
42 client_element_buffer_id_(107) { 44 client_element_buffer_id_(107) {
43 memset(immediate_buffer_, 0xEE, sizeof(immediate_buffer_)); 45 memset(immediate_buffer_, 0xEE, sizeof(immediate_buffer_));
44 } 46 }
45 47
46 GLES2DecoderTestBase::~GLES2DecoderTestBase() {} 48 GLES2DecoderTestBase::~GLES2DecoderTestBase() {}
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 .RetiresOnSaturation(); 121 .RetiresOnSaturation();
120 122
121 engine_.reset(new StrictMock<MockCommandBufferEngine>()); 123 engine_.reset(new StrictMock<MockCommandBufferEngine>());
122 Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId); 124 Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId);
123 shared_memory_offset_ = kSharedMemoryOffset; 125 shared_memory_offset_ = kSharedMemoryOffset;
124 shared_memory_address_ = reinterpret_cast<int8*>(buffer.ptr) + 126 shared_memory_address_ = reinterpret_cast<int8*>(buffer.ptr) +
125 shared_memory_offset_; 127 shared_memory_offset_;
126 shared_memory_id_ = kSharedMemoryId; 128 shared_memory_id_ = kSharedMemoryId;
127 shared_memory_base_ = buffer.ptr; 129 shared_memory_base_ = buffer.ptr;
128 130
131 surface_ = new gfx::GLSurfaceStub;
132 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight));
133
129 context_ = new gfx::GLContextStub; 134 context_ = new gfx::GLContextStub;
130 context_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight));
131 135
132 decoder_.reset(GLES2Decoder::Create(group_.get())); 136 decoder_.reset(GLES2Decoder::Create(group_.get()));
133 decoder_->Initialize( 137 decoder_->Initialize(
134 context_, context_->GetSize(), DisallowedExtensions(), 138 surface_, context_, surface_->GetSize(), DisallowedExtensions(),
135 NULL, std::vector<int32>(), NULL, 0); 139 NULL, std::vector<int32>(), NULL, 0);
136 decoder_->set_engine(engine_.get()); 140 decoder_->set_engine(engine_.get());
137 141
138 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) 142 EXPECT_CALL(*gl_, GenBuffersARB(_, _))
139 .WillOnce(SetArgumentPointee<1>(kServiceBufferId)) 143 .WillOnce(SetArgumentPointee<1>(kServiceBufferId))
140 .RetiresOnSaturation(); 144 .RetiresOnSaturation();
141 GenHelper<GenBuffersImmediate>(client_buffer_id_); 145 GenHelper<GenBuffersImmediate>(client_buffer_id_);
142 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)) 146 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _))
143 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId)) 147 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId))
144 .RetiresOnSaturation(); 148 .RetiresOnSaturation();
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 805
802 const char* GLES2DecoderWithShaderTestBase::kAttrib1Name = "attrib1"; 806 const char* GLES2DecoderWithShaderTestBase::kAttrib1Name = "attrib1";
803 const char* GLES2DecoderWithShaderTestBase::kAttrib2Name = "attrib2"; 807 const char* GLES2DecoderWithShaderTestBase::kAttrib2Name = "attrib2";
804 const char* GLES2DecoderWithShaderTestBase::kAttrib3Name = "attrib3"; 808 const char* GLES2DecoderWithShaderTestBase::kAttrib3Name = "attrib3";
805 const char* GLES2DecoderWithShaderTestBase::kUniform1Name = "uniform1"; 809 const char* GLES2DecoderWithShaderTestBase::kUniform1Name = "uniform1";
806 const char* GLES2DecoderWithShaderTestBase::kUniform2Name = "uniform2[0]"; 810 const char* GLES2DecoderWithShaderTestBase::kUniform2Name = "uniform2[0]";
807 const char* GLES2DecoderWithShaderTestBase::kUniform3Name = "uniform3[0]"; 811 const char* GLES2DecoderWithShaderTestBase::kUniform3Name = "uniform3[0]";
808 812
809 } // namespace gles2 813 } // namespace gles2
810 } // namespace gpu 814 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698