summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/service/memory_program_cache.cc160
-rw-r--r--gpu/command_buffer/service/memory_program_cache.h92
-rw-r--r--gpu/command_buffer/service/mocks.h2
-rw-r--r--gpu/command_buffer/service/program_cache.cc2
-rw-r--r--gpu/command_buffer/service/program_cache.h2
-rw-r--r--gpu/command_buffer/service/program_cache_lru_helper.cc49
-rw-r--r--gpu/command_buffer/service/program_cache_lru_helper.h51
-rw-r--r--gpu/command_buffer/service/program_cache_lru_helper_unittest.cc84
-rw-r--r--gpu/command_buffer/service/program_cache_unittest.cc2
-rw-r--r--gpu/command_buffer_service.gypi2
-rw-r--r--gpu/gpu.gyp1
11 files changed, 153 insertions, 294 deletions
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc
index 0df3cca..3207f7c 100644
--- a/gpu/command_buffer/service/memory_program_cache.cc
+++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -90,18 +90,21 @@ void RunShaderCallback(const ShaderCacheCallback& callback,
MemoryProgramCache::MemoryProgramCache()
: max_size_bytes_(GetCacheSizeBytes()),
- curr_size_bytes_(0) { }
+ curr_size_bytes_(0),
+ store_(ProgramMRUCache::NO_AUTO_EVICT) {
+}
MemoryProgramCache::MemoryProgramCache(const size_t max_cache_size_bytes)
: max_size_bytes_(max_cache_size_bytes),
- curr_size_bytes_(0) {}
+ curr_size_bytes_(0),
+ store_(ProgramMRUCache::NO_AUTO_EVICT) {
+}
MemoryProgramCache::~MemoryProgramCache() {}
void MemoryProgramCache::ClearBackend() {
- curr_size_bytes_ = 0;
- store_.clear();
- eviction_helper_.Clear();
+ store_.Clear();
+ DCHECK_EQ(0U, curr_size_bytes_);
}
ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
@@ -111,7 +114,7 @@ ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
Shader* shader_b,
const ShaderTranslatorInterface* translator_b,
const LocationMap* bind_attrib_location_map,
- const ShaderCacheCallback& shader_callback) const {
+ const ShaderCacheCallback& shader_callback) {
char a_sha[kHashLength];
char b_sha[kHashLength];
ComputeShaderHash(
@@ -126,24 +129,24 @@ ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
sha);
const std::string sha_string(sha, kHashLength);
- StoreMap::const_iterator found = store_.find(sha_string);
+ ProgramMRUCache::iterator found = store_.Get(sha_string);
if (found == store_.end()) {
return PROGRAM_LOAD_FAILURE;
}
const scoped_refptr<ProgramCacheValue> value = found->second;
glProgramBinary(program,
- value->format,
- static_cast<const GLvoid*>(value->data.get()),
- value->length);
+ value->format(),
+ static_cast<const GLvoid*>(value->data()),
+ value->length());
GLint success = 0;
glGetProgramiv(program, GL_LINK_STATUS, &success);
if (success == GL_FALSE) {
return PROGRAM_LOAD_FAILURE;
}
- shader_a->set_attrib_map(value->attrib_map_0);
- shader_a->set_uniform_map(value->uniform_map_0);
- shader_b->set_attrib_map(value->attrib_map_1);
- shader_b->set_uniform_map(value->uniform_map_1);
+ shader_a->set_attrib_map(value->attrib_map_0());
+ shader_a->set_uniform_map(value->uniform_map_0());
+ shader_b->set_attrib_map(value->attrib_map_1());
+ shader_b->set_uniform_map(value->uniform_map_1());
if (!shader_callback.is_null() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
@@ -151,8 +154,8 @@ ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
scoped_ptr<GpuProgramProto> proto(
GpuProgramProto::default_instance().New());
proto->set_sha(sha, kHashLength);
- proto->set_format(value->format);
- proto->set_program(value->data.get(), value->length);
+ proto->set_format(value->format());
+ proto->set_program(value->data(), value->length());
FillShaderProto(proto->mutable_vertex_shader(), a_sha, shader_a);
FillShaderProto(proto->mutable_fragment_shader(), b_sha, shader_b);
@@ -201,23 +204,15 @@ void MemoryProgramCache::SaveLinkedProgram(
UMA_HISTOGRAM_COUNTS("GPU.ProgramCache.MemorySizeBeforeKb",
curr_size_bytes_ / 1024);
- if (store_.find(sha_string) != store_.end()) {
- const StoreMap::iterator found = store_.find(sha_string);
- const ProgramCacheValue* evicting = found->second.get();
- curr_size_bytes_ -= evicting->length;
- Evict(sha_string, evicting->shader_0_hash, evicting->shader_1_hash);
- store_.erase(found);
- }
+ // Evict any cached program with the same key in favor of the least recently
+ // accessed.
+ ProgramMRUCache::iterator existing = store_.Peek(sha_string);
+ if(existing != store_.end())
+ store_.Erase(existing);
while (curr_size_bytes_ + length > max_size_bytes_) {
- DCHECK(!eviction_helper_.IsEmpty());
- const std::string* program = eviction_helper_.PeekKey();
- const StoreMap::iterator found = store_.find(*program);
- const ProgramCacheValue* evicting = found->second.get();
- curr_size_bytes_ -= evicting->length;
- Evict(*program, evicting->shader_0_hash, evicting->shader_1_hash);
- store_.erase(found);
- eviction_helper_.PopKey();
+ DCHECK(!store_.empty());
+ store_.Erase(store_.rbegin());
}
if (!shader_callback.is_null() &&
@@ -234,24 +229,21 @@ void MemoryProgramCache::SaveLinkedProgram(
RunShaderCallback(shader_callback, proto.get(), sha_string);
}
- store_[sha_string] = new ProgramCacheValue(length,
- format,
- binary.release(),
- a_sha,
- shader_a->attrib_map(),
- shader_a->uniform_map(),
- b_sha,
- shader_b->attrib_map(),
- shader_b->uniform_map());
- curr_size_bytes_ += length;
- eviction_helper_.KeyUsed(sha_string);
+ store_.Put(sha_string,
+ new ProgramCacheValue(length,
+ format,
+ binary.release(),
+ sha_string,
+ a_sha,
+ shader_a->attrib_map(),
+ shader_a->uniform_map(),
+ b_sha,
+ shader_b->attrib_map(),
+ shader_b->uniform_map(),
+ this));
UMA_HISTOGRAM_COUNTS("GPU.ProgramCache.MemorySizeAfterKb",
curr_size_bytes_ / 1024);
-
- LinkedProgramCacheSuccess(sha_string,
- std::string(a_sha, kHashLength),
- std::string(b_sha, kHashLength));
}
void MemoryProgramCache::LoadProgram(const std::string& program) {
@@ -284,51 +276,63 @@ void MemoryProgramCache::LoadProgram(const std::string& program) {
scoped_ptr<char[]> binary(new char[proto->program().length()]);
memcpy(binary.get(), proto->program().c_str(), proto->program().length());
- store_[proto->sha()] = new ProgramCacheValue(proto->program().length(),
- proto->format(), binary.release(),
- proto->vertex_shader().sha().c_str(), vertex_attribs, vertex_uniforms,
- proto->fragment_shader().sha().c_str(), fragment_attribs,
- fragment_uniforms);
+ store_.Put(proto->sha(),
+ new ProgramCacheValue(proto->program().length(),
+ proto->format(),
+ binary.release(),
+ proto->sha(),
+ proto->vertex_shader().sha().c_str(),
+ vertex_attribs,
+ vertex_uniforms,
+ proto->fragment_shader().sha().c_str(),
+ fragment_attribs,
+ fragment_uniforms,
+ this));
ShaderCompilationSucceededSha(proto->sha());
ShaderCompilationSucceededSha(proto->vertex_shader().sha());
ShaderCompilationSucceededSha(proto->fragment_shader().sha());
- curr_size_bytes_ += proto->program().length();
- eviction_helper_.KeyUsed(proto->sha());
-
UMA_HISTOGRAM_COUNTS("GPU.ProgramCache.MemorySizeAfterKb",
curr_size_bytes_ / 1024);
-
- LinkedProgramCacheSuccess(proto->sha(),
- proto->vertex_shader().sha(),
- proto->fragment_shader().sha());
} else {
LOG(ERROR) << "Failed to parse proto file.";
}
}
MemoryProgramCache::ProgramCacheValue::ProgramCacheValue(
- GLsizei _length,
- GLenum _format,
- const char* _data,
- const char* _shader_0_hash,
- const ShaderTranslator::VariableMap& _attrib_map_0,
- const ShaderTranslator::VariableMap& _uniform_map_0,
- const char* _shader_1_hash,
- const ShaderTranslator::VariableMap& _attrib_map_1,
- const ShaderTranslator::VariableMap& _uniform_map_1)
- : length(_length),
- format(_format),
- data(_data),
- shader_0_hash(_shader_0_hash, kHashLength),
- attrib_map_0(_attrib_map_0),
- uniform_map_0(_uniform_map_0),
- shader_1_hash(_shader_1_hash, kHashLength),
- attrib_map_1(_attrib_map_1),
- uniform_map_1(_uniform_map_1) {}
-
-MemoryProgramCache::ProgramCacheValue::~ProgramCacheValue() {}
+ GLsizei length,
+ GLenum format,
+ const char* data,
+ const std::string& program_hash,
+ const char* shader_0_hash,
+ const ShaderTranslator::VariableMap& attrib_map_0,
+ const ShaderTranslator::VariableMap& uniform_map_0,
+ const char* shader_1_hash,
+ const ShaderTranslator::VariableMap& attrib_map_1,
+ const ShaderTranslator::VariableMap& uniform_map_1,
+ MemoryProgramCache* program_cache)
+ : length_(length),
+ format_(format),
+ data_(data),
+ program_hash_(program_hash),
+ shader_0_hash_(shader_0_hash, kHashLength),
+ attrib_map_0_(attrib_map_0),
+ uniform_map_0_(uniform_map_0),
+ shader_1_hash_(shader_1_hash, kHashLength),
+ attrib_map_1_(attrib_map_1),
+ uniform_map_1_(uniform_map_1),
+ program_cache_(program_cache) {
+ program_cache_->curr_size_bytes_ += length_;
+ program_cache_->LinkedProgramCacheSuccess(program_hash,
+ shader_0_hash_,
+ shader_1_hash_);
+}
+
+MemoryProgramCache::ProgramCacheValue::~ProgramCacheValue() {
+ program_cache_->curr_size_bytes_ -= length_;
+ program_cache_->Evict(program_hash_, shader_0_hash_, shader_1_hash_);
+}
} // namespace gles2
} // namespace gpu
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h
index 1f2e53a..b2f23e6 100644
--- a/gpu/command_buffer/service/memory_program_cache.h
+++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -9,11 +9,11 @@
#include <string>
#include "base/containers/hash_tables.h"
+#include "base/containers/mru_cache.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/program_cache.h"
-#include "gpu/command_buffer/service/program_cache_lru_helper.h"
#include "gpu/command_buffer/service/shader_translator.h"
namespace gpu {
@@ -33,7 +33,7 @@ class GPU_EXPORT MemoryProgramCache : public ProgramCache {
Shader* shader_b,
const ShaderTranslatorInterface* translator_b,
const LocationMap* bind_attrib_location_map,
- const ShaderCacheCallback& shader_callback) const OVERRIDE;
+ const ShaderCacheCallback& shader_callback) OVERRIDE;
virtual void SaveLinkedProgram(
GLuint program,
const Shader* shader_a,
@@ -48,42 +48,84 @@ class GPU_EXPORT MemoryProgramCache : public ProgramCache {
private:
virtual void ClearBackend() OVERRIDE;
- struct ProgramCacheValue : public base::RefCounted<ProgramCacheValue> {
+ class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> {
public:
- ProgramCacheValue(GLsizei _length,
- GLenum _format,
- const char* _data,
- const char* _shader_0_hash,
- const ShaderTranslator::VariableMap& _attrib_map_0,
- const ShaderTranslator::VariableMap& _uniform_map_0,
- const char* _shader_1_hash,
- const ShaderTranslator::VariableMap& _attrib_map_1,
- const ShaderTranslator::VariableMap& _uniform_map_1);
- const GLsizei length;
- const GLenum format;
- const scoped_ptr<const char[]> data;
- const std::string shader_0_hash;
- const ShaderTranslator::VariableMap attrib_map_0;
- const ShaderTranslator::VariableMap uniform_map_0;
- const std::string shader_1_hash;
- const ShaderTranslator::VariableMap attrib_map_1;
- const ShaderTranslator::VariableMap uniform_map_1;
+ ProgramCacheValue(GLsizei length,
+ GLenum format,
+ const char* data,
+ const std::string& program_hash,
+ const char* shader_0_hash,
+ const ShaderTranslator::VariableMap& attrib_map_0,
+ const ShaderTranslator::VariableMap& uniform_map_0,
+ const char* shader_1_hash,
+ const ShaderTranslator::VariableMap& attrib_map_1,
+ const ShaderTranslator::VariableMap& uniform_map_1,
+ MemoryProgramCache* program_cache);
+
+ GLsizei length() const {
+ return length_;
+ }
+
+ GLenum format() const {
+ return format_;
+ }
+
+ const char* data() const {
+ return data_.get();
+ }
+
+ const std::string& shader_0_hash() const {
+ return shader_0_hash_;
+ }
+
+ const ShaderTranslator::VariableMap& attrib_map_0() const {
+ return attrib_map_0_;
+ }
+
+ const ShaderTranslator::VariableMap& uniform_map_0() const {
+ return uniform_map_0_;
+ }
+
+ const std::string& shader_1_hash() const {
+ return shader_1_hash_;
+ }
+
+ const ShaderTranslator::VariableMap& attrib_map_1() const {
+ return attrib_map_1_;
+ }
+
+ const ShaderTranslator::VariableMap& uniform_map_1() const {
+ return uniform_map_1_;
+ }
private:
friend class base::RefCounted<ProgramCacheValue>;
~ProgramCacheValue();
+ const GLsizei length_;
+ const GLenum format_;
+ const scoped_ptr<const char[]> data_;
+ const std::string program_hash_;
+ const std::string shader_0_hash_;
+ const ShaderTranslator::VariableMap attrib_map_0_;
+ const ShaderTranslator::VariableMap uniform_map_0_;
+ const std::string shader_1_hash_;
+ const ShaderTranslator::VariableMap attrib_map_1_;
+ const ShaderTranslator::VariableMap uniform_map_1_;
+ MemoryProgramCache* const program_cache_;
+
DISALLOW_COPY_AND_ASSIGN(ProgramCacheValue);
};
- typedef base::hash_map<std::string,
- scoped_refptr<ProgramCacheValue> > StoreMap;
+ friend class ProgramCacheValue;
+
+ typedef base::MRUCache<std::string,
+ scoped_refptr<ProgramCacheValue> > ProgramMRUCache;
const size_t max_size_bytes_;
size_t curr_size_bytes_;
- StoreMap store_;
- ProgramCacheLruHelper eviction_helper_;
+ ProgramMRUCache store_;
DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache);
};
diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h
index 11b8ae6..fda8722 100644
--- a/gpu/command_buffer/service/mocks.h
+++ b/gpu/command_buffer/service/mocks.h
@@ -100,7 +100,7 @@ class MockProgramCache : public ProgramCache {
MockProgramCache();
virtual ~MockProgramCache();
- MOCK_CONST_METHOD7(LoadLinkedProgram, ProgramLoadResult(
+ MOCK_METHOD7(LoadLinkedProgram, ProgramLoadResult(
GLuint program,
Shader* shader_a,
const ShaderTranslatorInterface* translator_a,
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc
index 62e636d..f0adf6e 100644
--- a/gpu/command_buffer/service/program_cache.cc
+++ b/gpu/command_buffer/service/program_cache.cc
@@ -15,9 +15,9 @@ ProgramCache::ProgramCache() {}
ProgramCache::~ProgramCache() {}
void ProgramCache::Clear() {
+ ClearBackend();
shader_status_.clear();
link_status_.clear();
- ClearBackend();
}
ProgramCache::CompiledShaderStatus ProgramCache::GetShaderCompilationStatus(
diff --git a/gpu/command_buffer/service/program_cache.h b/gpu/command_buffer/service/program_cache.h
index 9b28dd8..a8b9f91 100644
--- a/gpu/command_buffer/service/program_cache.h
+++ b/gpu/command_buffer/service/program_cache.h
@@ -68,7 +68,7 @@ class GPU_EXPORT ProgramCache {
Shader* shader_b,
const ShaderTranslatorInterface* translator_b,
const LocationMap* bind_attrib_location_map,
- const ShaderCacheCallback& shader_callback) const = 0;
+ const ShaderCacheCallback& shader_callback) = 0;
// Saves the program into the cache. If successful, the implementation should
// call LinkedProgramCacheSuccess.
diff --git a/gpu/command_buffer/service/program_cache_lru_helper.cc b/gpu/command_buffer/service/program_cache_lru_helper.cc
deleted file mode 100644
index a1f4555..0000000
--- a/gpu/command_buffer/service/program_cache_lru_helper.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gpu/command_buffer/service/program_cache_lru_helper.h"
-
-namespace gpu {
-namespace gles2 {
-
-ProgramCacheLruHelper::ProgramCacheLruHelper() {}
-ProgramCacheLruHelper::~ProgramCacheLruHelper() {}
-
-void ProgramCacheLruHelper::Clear() {
- location_map.clear();
- queue.clear();
-}
-
-bool ProgramCacheLruHelper::IsEmpty() {
- return queue.empty();
-}
-
-void ProgramCacheLruHelper::KeyUsed(const std::string& key) {
- IteratorMap::iterator location_iterator = location_map.find(key);
- if (location_iterator != location_map.end()) {
- // already exists, erase it
- queue.erase(location_iterator->second);
- }
- queue.push_front(key);
- location_map[key] = queue.begin();
-}
-
-const std::string* ProgramCacheLruHelper::PeekKey() {
- if (queue.empty()) {
- return NULL;
- }
- return &queue.back();
-}
-
-void ProgramCacheLruHelper::PopKey() {
- if (queue.empty()) {
- return;
- }
- const std::string& last = queue.back();
- location_map.erase(last);
- queue.pop_back();
-}
-
-} // namespace gpu
-} // namespace gles2
diff --git a/gpu/command_buffer/service/program_cache_lru_helper.h b/gpu/command_buffer/service/program_cache_lru_helper.h
deleted file mode 100644
index 766704c..0000000
--- a/gpu/command_buffer/service/program_cache_lru_helper.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
-#define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
-
-#include <list>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/containers/hash_tables.h"
-#include "gpu/gpu_export.h"
-
-namespace gpu {
-namespace gles2 {
-
-// LRU helper for the program cache, operates in O(1) time.
-// This class uses a linked list with a hash map. Both copy their string keys,
-// so be mindful that keys you insert will be stored again twice in memory.
-class GPU_EXPORT ProgramCacheLruHelper {
- public:
- ProgramCacheLruHelper();
- ~ProgramCacheLruHelper();
-
- // clears the lru queue
- void Clear();
- // returns true if the lru queue is empty
- bool IsEmpty();
- // inserts or refreshes a key in the queue
- void KeyUsed(const std::string& key);
- // Peeks at the next key. Use IsEmpty() first (if the queue is empty then
- // null is returned).
- const std::string* PeekKey();
- // evicts the next key from the queue.
- void PopKey();
-
- private:
- typedef std::list<std::string> StringList;
- typedef base::hash_map<std::string,
- StringList::iterator> IteratorMap;
- StringList queue;
- IteratorMap location_map;
-
- DISALLOW_COPY_AND_ASSIGN(ProgramCacheLruHelper);
-};
-
-} // namespace gles2
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_LRU_HELPER_H_
diff --git a/gpu/command_buffer/service/program_cache_lru_helper_unittest.cc b/gpu/command_buffer/service/program_cache_lru_helper_unittest.cc
deleted file mode 100644
index 5aaa088..0000000
--- a/gpu/command_buffer/service/program_cache_lru_helper_unittest.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gpu/command_buffer/service/program_cache_lru_helper.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gpu {
-namespace gles2 {
-
-class ProgramCacheLruHelperTest : public testing::Test {
- public:
- ProgramCacheLruHelperTest() :
- lru_helper_(new ProgramCacheLruHelper()) { }
-
- protected:
- virtual void SetUp() {
- }
-
- virtual void TearDown() {
- lru_helper_->Clear();
- }
-
- scoped_ptr<ProgramCacheLruHelper> lru_helper_;
-};
-
-TEST_F(ProgramCacheLruHelperTest, ProgramCacheLruHelperEvictionOrderNoReuse) {
- lru_helper_->KeyUsed("1");
- lru_helper_->KeyUsed("2");
- lru_helper_->KeyUsed("3");
- lru_helper_->KeyUsed("4");
- const std::string* key = lru_helper_->PeekKey();
- EXPECT_EQ("1", *key);
- EXPECT_EQ("1", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_FALSE(lru_helper_->IsEmpty());
- EXPECT_EQ("2", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_FALSE(lru_helper_->IsEmpty());
- EXPECT_EQ("3", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_FALSE(lru_helper_->IsEmpty());
- EXPECT_EQ("4", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_TRUE(lru_helper_->IsEmpty());
-}
-
-TEST_F(ProgramCacheLruHelperTest, ProgramCacheLruHelperClear) {
- EXPECT_TRUE(lru_helper_->IsEmpty());
- lru_helper_->KeyUsed("1");
- lru_helper_->KeyUsed("2");
- lru_helper_->KeyUsed("3");
- lru_helper_->KeyUsed("4");
- EXPECT_FALSE(lru_helper_->IsEmpty());
- lru_helper_->Clear();
- EXPECT_TRUE(lru_helper_->IsEmpty());
-}
-
-TEST_F(ProgramCacheLruHelperTest, ProgramCacheLruHelperEvictionOrderWithReuse) {
- lru_helper_->KeyUsed("1");
- lru_helper_->KeyUsed("2");
- lru_helper_->KeyUsed("4");
- lru_helper_->KeyUsed("2");
- lru_helper_->KeyUsed("3");
- lru_helper_->KeyUsed("1");
- lru_helper_->KeyUsed("1");
- lru_helper_->KeyUsed("2");
- EXPECT_EQ("4", *lru_helper_->PeekKey());
- EXPECT_EQ("4", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_EQ("3", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_EQ("1", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_FALSE(lru_helper_->IsEmpty());
- EXPECT_EQ("2", *lru_helper_->PeekKey());
- lru_helper_->PopKey();
- EXPECT_TRUE(lru_helper_->IsEmpty());
-}
-
-} // namespace gles2
-} // namespace gpu
diff --git a/gpu/command_buffer/service/program_cache_unittest.cc b/gpu/command_buffer/service/program_cache_unittest.cc
index 63c032d..9ff6da9 100644
--- a/gpu/command_buffer/service/program_cache_unittest.cc
+++ b/gpu/command_buffer/service/program_cache_unittest.cc
@@ -22,7 +22,7 @@ class NoBackendProgramCache : public ProgramCache {
Shader* /* shader_b */,
const ShaderTranslatorInterface* /* translator_b */,
const LocationMap* /* bind_attrib_location_map */,
- const ShaderCacheCallback& /* callback */) const OVERRIDE {
+ const ShaderCacheCallback& /* callback */) OVERRIDE {
return PROGRAM_LOAD_SUCCESS;
}
virtual void SaveLinkedProgram(
diff --git a/gpu/command_buffer_service.gypi b/gpu/command_buffer_service.gypi
index 37d28a5..f8e94c1 100644
--- a/gpu/command_buffer_service.gypi
+++ b/gpu/command_buffer_service.gypi
@@ -103,8 +103,6 @@
'command_buffer/service/renderbuffer_manager.cc',
'command_buffer/service/program_cache.h',
'command_buffer/service/program_cache.cc',
- 'command_buffer/service/program_cache_lru_helper.h',
- 'command_buffer/service/program_cache_lru_helper.cc',
'command_buffer/service/safe_shared_memory_pool.h',
'command_buffer/service/safe_shared_memory_pool.cc',
'command_buffer/service/shader_manager.h',
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index 3b612a0..1598ba5 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -199,7 +199,6 @@
'command_buffer/service/program_manager_unittest.cc',
'command_buffer/service/query_manager_unittest.cc',
'command_buffer/service/renderbuffer_manager_unittest.cc',
- 'command_buffer/service/program_cache_lru_helper_unittest.cc',
'command_buffer/service/program_cache_unittest.cc',
'command_buffer/service/shader_manager_unittest.cc',
'command_buffer/service/shader_translator_unittest.cc',