Chromium Code Reviews| Index: gpu/command_buffer/service/memory_shader_cache.h |
| diff --git a/gpu/command_buffer/service/memory_shader_cache.h b/gpu/command_buffer/service/memory_shader_cache.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..596f6841fc401d988bb1447232a172093272af14 |
| --- /dev/null |
| +++ b/gpu/command_buffer/service/memory_shader_cache.h |
| @@ -0,0 +1,78 @@ |
| +// 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_MEMORY_SHADER_CACHE_H_ |
| +#define GPU_COMMAND_BUFFER_SERVICE_MEMORY_SHADER_CACHE_H_ |
| + |
| +#include "base/hash_tables.h" |
| +#include "gpu/command_buffer/service/shader_cache.h" |
| +#include "net/disk_cache/disk_cache.h" |
| + |
| +using disk_cache::Backend; |
|
greggman
2012/06/15 08:10:24
style: not allowed to use using in a header file.
dmurph
2012/06/19 01:08:33
Done.
|
| +using base::hash_map; |
| + |
| +namespace gpu { |
| + |
| +struct StoreValue { |
| + StoreValue() : length(0), format(0), data(NULL) { } |
| + StoreValue(GLsizei _length, GLenum _format, GLvoid* _data) |
| + : length(_length), format(_format), data(_data) { } |
|
greggman
2012/06/15 08:10:24
style: 4 spaces in front of :
dmurph
2012/06/19 01:08:33
Done.
|
| + GLsizei length; |
| + GLenum format; |
| + GLvoid* data; |
|
greggman
2012/06/15 08:10:24
could all of these be marked as const?
dmurph
2012/06/19 01:08:33
It looks like I need assignment working for hash_m
|
| +}; |
| + |
| +class GPU_EXPORT MemoryShaderCache : public ShaderCache { |
|
greggman
2012/06/15 08:10:24
style: classes need a command description describi
dmurph
2012/06/19 01:08:33
Done.
|
| +public: |
|
greggman
2012/06/15 08:10:24
style: 1 space before public:
dmurph
2012/06/19 01:08:33
Done.
|
| + MemoryShaderCache(); |
| + virtual ~MemoryShaderCache(); |
| + |
|
greggman
2012/06/15 08:10:24
style: All of these function names need to start w
dmurph
2012/06/19 01:08:33
Done.
|
| + bool isShaderCacheEnabled(); |
|
greggman
2012/06/15 08:10:24
can this be a const function?
dmurph
2012/06/19 01:08:33
gone
|
| + CompiledShaderStatus getShaderCompilationStatus(const char* shader_src); |
|
greggman
2012/06/15 08:10:24
const func?
dmurph
2012/06/19 01:08:33
Done.
|
| + void setShaderCompilationStatus(const char* shader_src, |
| + CompiledShaderStatus status); |
| + |
| + LinkedProgramStatus getLinkedProgramStatus(const char* untranslated_a, |
|
greggman
2012/06/15 08:10:24
const func?
dmurph
2012/06/19 01:08:33
Done.
|
| + const char* untranslated_b); |
| + |
| + void setLinkedProgramStatus(const char* untranslated_a, |
| + const char* untranslated_b, |
| + LinkedProgramStatus status); |
| + |
| + |
| + void getLinkedProgram(const char* untranslated_a, |
|
greggman
2012/06/15 08:10:24
const func?
dmurph
2012/06/19 01:08:33
Done.
|
| + const char* untranslated_b, |
| + GLsizei* length, |
| + GLenum* binaryFormat, |
| + const GLvoid** binary); |
| + |
| + void setLinkedProgram(const char* untranslated_a, |
| + const char* untranslated_b, |
| + GLsizei length, |
| + GLenum binaryFormat, |
| + GLvoid* binary); |
| + |
| +private: |
|
greggman
2012/06/15 08:10:24
style: 1 space before private
dmurph
2012/06/19 01:08:33
Done.
|
| + |
|
greggman
2012/06/15 08:10:24
style: no blank lines after private
dmurph
2012/06/19 01:08:33
Done.
|
| + |
| + scoped_ptr<Backend> cache_backend_; |
| + hash_map<CachedShaderKey, |
|
greggman
2012/06/15 08:10:24
Do you want to typedef these types?
dmurph
2012/06/19 01:08:33
Done.
|
| + CompiledShaderStatus, |
| + CachedShaderKeyHash, |
| + CachedShaderKeyEquals> shader_status_; |
| + hash_map<CachedProgramKey, |
| + LinkedProgramStatus, |
| + CachedProgramKeyHash, |
| + CachedProgramKeyEquals> link_status_; |
| + hash_map<CachedProgramKey, |
| + StoreValue, |
| + CachedProgramKeyHash, |
| + CachedProgramKeyEquals> store_; |
| + |
|
greggman
2012/06/15 08:10:24
style: no blank lines at the end of a class
dmurph
2012/06/19 01:08:33
Done.
|
| + |
|
greggman
2012/06/15 08:10:24
You probably want a DISALLOW_COPY_AND_ASSIGN(Memor
dmurph
2012/06/19 01:08:33
Done.
|
| +}; |
| + |
| +} // namespace gpu |
| + |
| +#endif /* GPU_COMMAND_BUFFER_SERVICE_MEMORY_SHADER_CACHE_H_ */ |