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

Side by Side Diff: gpu/command_buffer/service/memory_shader_cache.h

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MEMORY_SHADER_CACHE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_SHADER_CACHE_H_
7
8 #include "base/hash_tables.h"
9 #include "gpu/command_buffer/service/shader_cache.h"
10 #include "net/disk_cache/disk_cache.h"
11
12 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.
13 using base::hash_map;
14
15 namespace gpu {
16
17 struct StoreValue {
18 StoreValue() : length(0), format(0), data(NULL) { }
19 StoreValue(GLsizei _length, GLenum _format, GLvoid* _data)
20 : 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.
21 GLsizei length;
22 GLenum format;
23 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
24 };
25
26 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.
27 public:
greggman 2012/06/15 08:10:24 style: 1 space before public:
dmurph 2012/06/19 01:08:33 Done.
28 MemoryShaderCache();
29 virtual ~MemoryShaderCache();
30
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.
31 bool isShaderCacheEnabled();
greggman 2012/06/15 08:10:24 can this be a const function?
dmurph 2012/06/19 01:08:33 gone
32 CompiledShaderStatus getShaderCompilationStatus(const char* shader_src);
greggman 2012/06/15 08:10:24 const func?
dmurph 2012/06/19 01:08:33 Done.
33 void setShaderCompilationStatus(const char* shader_src,
34 CompiledShaderStatus status);
35
36 LinkedProgramStatus getLinkedProgramStatus(const char* untranslated_a,
greggman 2012/06/15 08:10:24 const func?
dmurph 2012/06/19 01:08:33 Done.
37 const char* untranslated_b);
38
39 void setLinkedProgramStatus(const char* untranslated_a,
40 const char* untranslated_b,
41 LinkedProgramStatus status);
42
43
44 void getLinkedProgram(const char* untranslated_a,
greggman 2012/06/15 08:10:24 const func?
dmurph 2012/06/19 01:08:33 Done.
45 const char* untranslated_b,
46 GLsizei* length,
47 GLenum* binaryFormat,
48 const GLvoid** binary);
49
50 void setLinkedProgram(const char* untranslated_a,
51 const char* untranslated_b,
52 GLsizei length,
53 GLenum binaryFormat,
54 GLvoid* binary);
55
56 private:
greggman 2012/06/15 08:10:24 style: 1 space before private
dmurph 2012/06/19 01:08:33 Done.
57
greggman 2012/06/15 08:10:24 style: no blank lines after private
dmurph 2012/06/19 01:08:33 Done.
58
59 scoped_ptr<Backend> cache_backend_;
60 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.
61 CompiledShaderStatus,
62 CachedShaderKeyHash,
63 CachedShaderKeyEquals> shader_status_;
64 hash_map<CachedProgramKey,
65 LinkedProgramStatus,
66 CachedProgramKeyHash,
67 CachedProgramKeyEquals> link_status_;
68 hash_map<CachedProgramKey,
69 StoreValue,
70 CachedProgramKeyHash,
71 CachedProgramKeyEquals> store_;
72
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.
73
greggman 2012/06/15 08:10:24 You probably want a DISALLOW_COPY_AND_ASSIGN(Memor
dmurph 2012/06/19 01:08:33 Done.
74 };
75
76 } // namespace gpu
77
78 #endif /* GPU_COMMAND_BUFFER_SERVICE_MEMORY_SHADER_CACHE_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698