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

Unified Diff: gpu/command_buffer/service/shader_translator_cache.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/shader_translator_cache.h
diff --git a/gpu/command_buffer/service/shader_translator_cache.h b/gpu/command_buffer/service/shader_translator_cache.h
index e804ef26b8c3ade1774373d2a21c85a4ddbd15f0..6b0b1a57ef35cfc3a727a8962db1af05803dbae3 100644
--- a/gpu/command_buffer/service/shader_translator_cache.h
+++ b/gpu/command_buffer/service/shader_translator_cache.h
@@ -41,6 +41,7 @@ class GPU_EXPORT ShaderTranslatorCache
private:
friend class base::RefCounted<ShaderTranslatorCache>;
+ friend class ShaderTranslatorCacheTest_InitParamComparable_Test;
~ShaderTranslatorCache() override;
// Parameters passed into ShaderTranslator::Init
@@ -52,18 +53,18 @@ class GPU_EXPORT ShaderTranslatorCache
glsl_implementation_type;
ShCompileOptions driver_bug_workarounds;
- ShaderTranslatorInitParams(
- sh::GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources& resources,
- ShaderTranslatorInterface::GlslImplementationType
- glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds)
- : shader_type(shader_type),
- shader_spec(shader_spec),
- resources(resources),
- glsl_implementation_type(glsl_implementation_type),
- driver_bug_workarounds(driver_bug_workarounds) {
+ ShaderTranslatorInitParams(sh::GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources& resources,
+ ShaderTranslatorInterface::GlslImplementationType
+ glsl_implementation_type,
+ ShCompileOptions driver_bug_workarounds) {
+ memset(this, 0, sizeof(*this));
+ this->shader_type = shader_type;
+ this->shader_spec = shader_spec;
+ this->resources = resources;
+ this->glsl_implementation_type = glsl_implementation_type;
+ this->driver_bug_workarounds = driver_bug_workarounds;
}
ShaderTranslatorInitParams(const ShaderTranslatorInitParams& params) {
@@ -77,6 +78,10 @@ class GPU_EXPORT ShaderTranslatorCache
bool operator< (const ShaderTranslatorInitParams& params) const {
return memcmp(&params, this, sizeof(*this)) < 0;
}
+
+ private:
+ ShaderTranslatorInitParams();
+ ShaderTranslatorInitParams& operator=(const ShaderTranslatorInitParams&);
};
typedef std::map<ShaderTranslatorInitParams, ShaderTranslator* > Cache;
« no previous file with comments | « gpu/command_buffer/service/query_manager_unittest.cc ('k') | gpu/command_buffer/service/shader_translator_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698