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

Side by Side Diff: ui/gl/gl_enums.cc

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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
« no previous file with comments | « ui/gl/gl_enums.h ('k') | ui/gl/gl_fence.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <sstream> 5 #include <sstream>
6 #include <GLES2/gl2.h> 6 #include <GLES2/gl2.h>
7 7
8 #include "ui/gl/gl_enums.h" 8 #include "ui/gl/gl_enums.h"
9 9
10 namespace gfx { 10 namespace gl {
11 11
12 std::string GLEnums::GetStringEnum(uint32_t value) { 12 std::string GLEnums::GetStringEnum(uint32_t value) {
13 const EnumToString* entry = enum_to_string_table_; 13 const EnumToString* entry = enum_to_string_table_;
14 const EnumToString* end = entry + enum_to_string_table_len_; 14 const EnumToString* end = entry + enum_to_string_table_len_;
15 for (;entry < end; ++entry) { 15 for (;entry < end; ++entry) {
16 if (value == entry->value) { 16 if (value == entry->value) {
17 return entry->name; 17 return entry->name;
18 } 18 }
19 } 19 }
20 std::stringstream ss; 20 std::stringstream ss;
21 ss.fill('0'); 21 ss.fill('0');
22 ss.width(value < 0x10000 ? 4 : 8); 22 ss.width(value < 0x10000 ? 4 : 8);
23 ss << std::hex << value; 23 ss << std::hex << value;
24 return "0x" + ss.str(); 24 return "0x" + ss.str();
25 } 25 }
26 26
27 std::string GLEnums::GetStringError(uint32_t value) { 27 std::string GLEnums::GetStringError(uint32_t value) {
28 if (value == GL_NONE) 28 if (value == GL_NONE)
29 return "GL_NONE"; 29 return "GL_NONE";
30 return GetStringEnum(value); 30 return GetStringEnum(value);
31 } 31 }
32 32
33 std::string GLEnums::GetStringBool(uint32_t value) { 33 std::string GLEnums::GetStringBool(uint32_t value) {
34 return value ? "GL_TRUE" : "GL_FALSE"; 34 return value ? "GL_TRUE" : "GL_FALSE";
35 } 35 }
36 36
37 #include "ui/gl/gl_enums_implementation_autogen.h" 37 #include "ui/gl/gl_enums_implementation_autogen.h"
38 38
39 } // namespace gfx 39 } // namespace gl
40
OLDNEW
« no previous file with comments | « ui/gl/gl_enums.h ('k') | ui/gl/gl_fence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698