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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 #include "gpu/command_buffer/service/shader_translator.h" 5 #include "gpu/command_buffer/service/shader_translator.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string.h> 9 #include <string.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 18 matching lines...) Expand all
29 TRACE_EVENT0("gpu", "ShInitialize"); 29 TRACE_EVENT0("gpu", "ShInitialize");
30 CHECK(sh::Initialize()); 30 CHECK(sh::Initialize());
31 } 31 }
32 32
33 ~ShaderTranslatorInitializer() { 33 ~ShaderTranslatorInitializer() {
34 TRACE_EVENT0("gpu", "ShFinalize"); 34 TRACE_EVENT0("gpu", "ShFinalize");
35 sh::Finalize(); 35 sh::Finalize();
36 } 36 }
37 }; 37 };
38 38
39 base::LazyInstance<ShaderTranslatorInitializer> g_translator_initializer = 39 base::LazyInstance<ShaderTranslatorInitializer>::DestructorAtExit
40 LAZY_INSTANCE_INITIALIZER; 40 g_translator_initializer = LAZY_INSTANCE_INITIALIZER;
41 41
42 void GetAttributes(ShHandle compiler, AttributeMap* var_map) { 42 void GetAttributes(ShHandle compiler, AttributeMap* var_map) {
43 if (!var_map) 43 if (!var_map)
44 return; 44 return;
45 var_map->clear(); 45 var_map->clear();
46 const std::vector<sh::Attribute>* attribs = sh::GetAttributes(compiler); 46 const std::vector<sh::Attribute>* attribs = sh::GetAttributes(compiler);
47 if (attribs) { 47 if (attribs) {
48 for (size_t ii = 0; ii < attribs->size(); ++ii) 48 for (size_t ii = 0; ii < attribs->size(); ++ii)
49 (*var_map)[(*attribs)[ii].mappedName] = (*attribs)[ii]; 49 (*var_map)[(*attribs)[ii].mappedName] = (*attribs)[ii];
50 } 50 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 for (auto& observer : destruction_observers_) 278 for (auto& observer : destruction_observers_)
279 observer.OnDestruct(this); 279 observer.OnDestruct(this);
280 280
281 if (compiler_ != NULL) 281 if (compiler_ != NULL)
282 sh::Destruct(compiler_); 282 sh::Destruct(compiler_);
283 } 283 }
284 284
285 } // namespace gles2 285 } // namespace gles2
286 } // namespace gpu 286 } // namespace gpu
287 287
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | gpu/ipc/in_process_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698