| OLD | NEW |
| 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/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (command_line) { | 191 if (command_line) { |
| 192 GpuDriverBugWorkarounds gpu_driver_bug_workaround(command_line); | 192 GpuDriverBugWorkarounds gpu_driver_bug_workaround(command_line); |
| 193 feature_info = new FeatureInfo(*command_line, gpu_driver_bug_workaround); | 193 feature_info = new FeatureInfo(*command_line, gpu_driver_bug_workaround); |
| 194 } | 194 } |
| 195 | 195 |
| 196 group_ = scoped_refptr<ContextGroup>( | 196 group_ = scoped_refptr<ContextGroup>( |
| 197 new ContextGroup(gpu_preferences_, NULL, memory_tracker_, | 197 new ContextGroup(gpu_preferences_, NULL, memory_tracker_, |
| 198 new ShaderTranslatorCache(gpu_preferences_), | 198 new ShaderTranslatorCache(gpu_preferences_), |
| 199 new FramebufferCompletenessCache, feature_info, | 199 new FramebufferCompletenessCache, feature_info, |
| 200 normalized_init.bind_generates_resource, nullptr, | 200 normalized_init.bind_generates_resource, nullptr, |
| 201 nullptr, GpuFeatureInfo())); | 201 nullptr, GpuFeatureInfo(), &discardable_manager_)); |
| 202 bool use_default_textures = normalized_init.bind_generates_resource; | 202 bool use_default_textures = normalized_init.bind_generates_resource; |
| 203 | 203 |
| 204 InSequence sequence; | 204 InSequence sequence; |
| 205 | 205 |
| 206 surface_ = new gl::GLSurfaceStub; | 206 surface_ = new gl::GLSurfaceStub; |
| 207 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); | 207 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); |
| 208 surface_->set_supports_draw_rectangle(surface_supports_draw_rectangle_); | 208 surface_->set_supports_draw_rectangle(surface_supports_draw_rectangle_); |
| 209 | 209 |
| 210 // Context needs to be created before initializing ContextGroup, which will | 210 // Context needs to be created before initializing ContextGroup, which will |
| 211 // in turn initialize FeatureInfo, which needs a context to determine | 211 // in turn initialize FeatureInfo, which needs a context to determine |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 void GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::set_token( | 2162 void GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::set_token( |
| 2163 int32_t token) { | 2163 int32_t token) { |
| 2164 DCHECK(false); | 2164 DCHECK(false); |
| 2165 } | 2165 } |
| 2166 | 2166 |
| 2167 void GLES2DecoderWithShaderTestBase::SetUp() { | 2167 void GLES2DecoderWithShaderTestBase::SetUp() { |
| 2168 GLES2DecoderTestBase::SetUp(); | 2168 GLES2DecoderTestBase::SetUp(); |
| 2169 SetupDefaultProgram(); | 2169 SetupDefaultProgram(); |
| 2170 } | 2170 } |
| 2171 | 2171 |
| 2172 void GLES2DecoderTestBase::DoInitializeDiscardableTextureCHROMIUM( |
| 2173 GLuint texture_id) { |
| 2174 scoped_refptr<gpu::Buffer> buffer = |
| 2175 engine_->GetSharedMemoryBuffer(kSharedMemoryId); |
| 2176 ClientDiscardableHandle handle(buffer, 0, kSharedMemoryId); |
| 2177 |
| 2178 cmds::InitializeDiscardableTextureCHROMIUM cmd; |
| 2179 cmd.Init(texture_id, kSharedMemoryId, 0); |
| 2180 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2181 } |
| 2182 |
| 2183 void GLES2DecoderTestBase::DoUnlockDiscardableTextureCHROMIUM( |
| 2184 GLuint texture_id) { |
| 2185 cmds::UnlockDiscardableTextureCHROMIUM cmd; |
| 2186 cmd.Init(texture_id); |
| 2187 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2188 } |
| 2189 |
| 2190 void GLES2DecoderTestBase::DoLockDiscardableTextureCHROMIUM(GLuint texture_id) { |
| 2191 cmds::LockDiscardableTextureCHROMIUM cmd; |
| 2192 cmd.Init(texture_id); |
| 2193 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2194 } |
| 2195 |
| 2172 // Include the auto-generated part of this file. We split this because it means | 2196 // Include the auto-generated part of this file. We split this because it means |
| 2173 // we can easily edit the non-auto generated parts right here in this file | 2197 // we can easily edit the non-auto generated parts right here in this file |
| 2174 // instead of having to edit some template or the code generator. | 2198 // instead of having to edit some template or the code generator. |
| 2175 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2199 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 2176 | 2200 |
| 2177 } // namespace gles2 | 2201 } // namespace gles2 |
| 2178 } // namespace gpu | 2202 } // namespace gpu |
| OLD | NEW |