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

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

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Style fixes, thorough tests Created 8 years, 5 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
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 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 struct VariableInfo { 57 struct VariableInfo {
58 VariableInfo() 58 VariableInfo()
59 : type(0), 59 : type(0),
60 size(0) { 60 size(0) {
61 } 61 }
62 VariableInfo(int _type, int _size, std::string _name) 62 VariableInfo(int _type, int _size, std::string _name)
63 : type(_type), 63 : type(_type),
64 size(_size), 64 size(_size),
65 name(_name) { 65 name(_name) {
66 } 66 }
67 bool operator==(
68 const ShaderTranslatorInterface::VariableInfo& other) const {
69 return type == other.type &&
70 size == other.size &&
71 strcmp(name.c_str(), other.name.c_str()) == 0;
72 }
73
67 int type; 74 int type;
68 int size; 75 int size;
69 std::string name; // name in the original shader source. 76 std::string name; // name in the original shader source.
70 }; 77 };
71 // Mapping between variable name and info. 78 // Mapping between variable name and info.
72 typedef base::hash_map<std::string, VariableInfo> VariableMap; 79 typedef base::hash_map<std::string, VariableInfo> VariableMap;
73 virtual const VariableMap& attrib_map() const = 0; 80 virtual const VariableMap& attrib_map() const = 0;
74 virtual const VariableMap& uniform_map() const = 0; 81 virtual const VariableMap& uniform_map() const = 0;
75 }; 82 };
76 83
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 friend class base::RefCounted<ShaderTranslator>; 137 friend class base::RefCounted<ShaderTranslator>;
131 138
132 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); 139 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator);
133 }; 140 };
134 141
135 } // namespace gles2 142 } // namespace gles2
136 } // namespace gpu 143 } // namespace gpu
137 144
138 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ 145 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_
139 146
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698