OLD | NEW |
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/tools/compositor_model_bench/render_tree.h" | 5 #include "gpu/tools/compositor_model_bench/render_tree.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 | 17 |
18 #include "gpu/tools/compositor_model_bench/shaders.h" | 18 #include "gpu/tools/compositor_model_bench/shaders.h" |
19 | 19 |
20 using base::JSONReader; | 20 using base::JSONReader; |
21 using base::JSONWriter; | 21 using base::JSONWriter; |
22 using base::Value; | 22 using base::Value; |
23 using file_util::ReadFileToString; | 23 using base::ReadFileToString; |
24 using std::string; | 24 using std::string; |
25 using std::vector; | 25 using std::vector; |
26 | 26 |
27 GLenum TextureFormatFromString(std::string format) { | 27 GLenum TextureFormatFromString(std::string format) { |
28 if (format == "RGBA") | 28 if (format == "RGBA") |
29 return GL_RGBA; | 29 return GL_RGBA; |
30 if (format == "RGB") | 30 if (format == "RGB") |
31 return GL_RGB; | 31 return GL_RGB; |
32 if (format == "LUMINANCE") | 32 if (format == "LUMINANCE") |
33 return GL_LUMINANCE; | 33 return GL_LUMINANCE; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 DictionaryValue* v = static_cast<DictionaryValue*>(root.get()); | 474 DictionaryValue* v = static_cast<DictionaryValue*>(root.get()); |
475 RenderNode* tree = InterpretContentLayer(v); | 475 RenderNode* tree = InterpretContentLayer(v); |
476 return tree; | 476 return tree; |
477 } else { | 477 } else { |
478 LOG(ERROR) << path.LossyDisplayName() << | 478 LOG(ERROR) << path.LossyDisplayName() << |
479 " doesn not encode a JSON dictionary."; | 479 " doesn not encode a JSON dictionary."; |
480 return NULL; | 480 return NULL; |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
OLD | NEW |