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/program_cache.h" | 5 #include "gpu/command_buffer/service/program_cache.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace gpu { | 10 namespace gpu { |
11 namespace gles2 { | 11 namespace gles2 { |
12 | 12 |
13 class NoBackendProgramCache : public ProgramCache { | 13 class NoBackendProgramCache : public ProgramCache { |
14 public: | 14 public: |
15 virtual ProgramLoadResult LoadLinkedProgram( | 15 virtual ProgramLoadResult LoadLinkedProgram( |
16 GLuint /* program */, | 16 GLuint /* program */, |
17 ShaderManager::ShaderInfo* /* shader_a */, | 17 Shader* /* shader_a */, |
18 ShaderManager::ShaderInfo* /* shader_b */, | 18 Shader* /* shader_b */, |
19 const LocationMap* /* bind_attrib_location_map */) const OVERRIDE { | 19 const LocationMap* /* bind_attrib_location_map */) const OVERRIDE { |
20 return PROGRAM_LOAD_SUCCESS; | 20 return PROGRAM_LOAD_SUCCESS; |
21 } | 21 } |
22 virtual void SaveLinkedProgram( | 22 virtual void SaveLinkedProgram( |
23 GLuint /* program */, | 23 GLuint /* program */, |
24 const ShaderManager::ShaderInfo* /* shader_a */, | 24 const Shader* /* shader_a */, |
25 const ShaderManager::ShaderInfo* /* shader_b */, | 25 const Shader* /* shader_b */, |
26 const LocationMap* /* bind_attrib_location_map */) OVERRIDE { } | 26 const LocationMap* /* bind_attrib_location_map */) OVERRIDE { } |
27 | 27 |
28 virtual void ClearBackend() OVERRIDE {} | 28 virtual void ClearBackend() OVERRIDE {} |
29 | 29 |
30 void SaySuccessfullyCached(const std::string& shader1, | 30 void SaySuccessfullyCached(const std::string& shader1, |
31 const std::string& shader2, | 31 const std::string& shader2, |
32 std::map<std::string, GLint>* attrib_map) { | 32 std::map<std::string, GLint>* attrib_map) { |
33 char a_sha[kHashLength]; | 33 char a_sha[kHashLength]; |
34 char b_sha[kHashLength]; | 34 char b_sha[kHashLength]; |
35 ComputeShaderHash(shader1, a_sha); | 35 ComputeShaderHash(shader1, a_sha); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 EXPECT_EQ(ProgramCache::COMPILATION_UNKNOWN, | 240 EXPECT_EQ(ProgramCache::COMPILATION_UNKNOWN, |
241 cache_->GetShaderCompilationStatus(shader3)); | 241 cache_->GetShaderCompilationStatus(shader3)); |
242 EXPECT_EQ(ProgramCache::LINK_UNKNOWN, | 242 EXPECT_EQ(ProgramCache::LINK_UNKNOWN, |
243 cache_->GetLinkedProgramStatus(shader1, shader2, NULL)); | 243 cache_->GetLinkedProgramStatus(shader1, shader2, NULL)); |
244 EXPECT_EQ(ProgramCache::LINK_UNKNOWN, | 244 EXPECT_EQ(ProgramCache::LINK_UNKNOWN, |
245 cache_->GetLinkedProgramStatus(shader1, shader3, NULL)); | 245 cache_->GetLinkedProgramStatus(shader1, shader3, NULL)); |
246 } | 246 } |
247 | 247 |
248 } // namespace gles2 | 248 } // namespace gles2 |
249 } // namespace gpu | 249 } // namespace gpu |
OLD | NEW |