diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 21:04:56 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 21:04:56 +0000 |
commit | 99ea48ccaeaee631ac223bec74789a01fbc8f46f (patch) | |
tree | 8b03ded3b816b32637045417fa2f6520c71dc2f6 /app/gfx | |
parent | 292829c20ddcb13e0480e1fe3f25039569c414f8 (diff) | |
download | chromium_src-99ea48ccaeaee631ac223bec74789a01fbc8f46f.zip chromium_src-99ea48ccaeaee631ac223bec74789a01fbc8f46f.tar.gz chromium_src-99ea48ccaeaee631ac223bec74789a01fbc8f46f.tar.bz2 |
De-wstringify gl_implementation.cc.
Review URL: http://codereview.chromium.org/3085006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx')
-rw-r--r-- | app/gfx/gl/gl_implementation.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/app/gfx/gl/gl_implementation.cc b/app/gfx/gl/gl_implementation.cc index 9c8686a..3739611 100644 --- a/app/gfx/gl/gl_implementation.cc +++ b/app/gfx/gl/gl_implementation.cc @@ -13,10 +13,6 @@ namespace gfx { namespace { -struct NamePair { - std::wstring name; - GLImplementation implemention; -}; typedef std::vector<base::NativeLibrary> LibraryArray; @@ -36,15 +32,18 @@ void CleanupNativeLibraries(void* unused) { } } -GLImplementation GetNamedGLImplementation(const std::wstring& name) { - static const NamePair name_pairs[] = { - { L"desktop", kGLImplementationDesktopGL }, - { L"osmesa", kGLImplementationOSMesaGL }, - { L"egl", kGLImplementationEGLGLES2 }, - { L"mock", kGLImplementationMockGL } +GLImplementation GetNamedGLImplementation(const std::string& name) { + static const struct { + const char* name; + GLImplementation implemention; + } name_pairs[] = { + { "desktop", kGLImplementationDesktopGL }, + { "osmesa", kGLImplementationOSMesaGL }, + { "egl", kGLImplementationEGLGLES2 }, + { "mock", kGLImplementationMockGL } }; - for (size_t i = 0; i < arraysize(name_pairs); ++i) { + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(name_pairs); ++i) { if (name == name_pairs[i].name) return name_pairs[i].implemention; } @@ -56,8 +55,8 @@ bool InitializeBestGLBindings( const GLImplementation* allowed_implementations_begin, const GLImplementation* allowed_implementations_end) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { - std::wstring requested_implementation_name = - CommandLine::ForCurrentProcess()->GetSwitchValue(switches::kUseGL); + std::string requested_implementation_name = + CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); GLImplementation requested_implementation = GetNamedGLImplementation(requested_implementation_name); if (std::find(allowed_implementations_begin, |