| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.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::ReadFileToString; | 22 using base::ReadFileToString; |
| 23 using std::string; | 23 using std::string; |
| 24 using std::vector; | 24 using std::vector; |
| 25 | 25 |
| 26 GLenum TextureFormatFromString(std::string format) { | 26 GLenum TextureFormatFromString(const std::string& format) { |
| 27 if (format == "RGBA") | 27 if (format == "RGBA") |
| 28 return GL_RGBA; | 28 return GL_RGBA; |
| 29 if (format == "RGB") | 29 if (format == "RGB") |
| 30 return GL_RGB; | 30 return GL_RGB; |
| 31 if (format == "LUMINANCE") | 31 if (format == "LUMINANCE") |
| 32 return GL_LUMINANCE; | 32 return GL_LUMINANCE; |
| 33 return GL_INVALID_ENUM; | 33 return GL_INVALID_ENUM; |
| 34 } | 34 } |
| 35 | 35 |
| 36 const char* TextureFormatName(GLenum format) { | 36 const char* TextureFormatName(GLenum format) { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 base::DictionaryValue* v = static_cast<base::DictionaryValue*>(root.get()); | 472 base::DictionaryValue* v = static_cast<base::DictionaryValue*>(root.get()); |
| 473 RenderNode* tree = InterpretContentLayer(v); | 473 RenderNode* tree = InterpretContentLayer(v); |
| 474 return tree; | 474 return tree; |
| 475 } else { | 475 } else { |
| 476 LOG(ERROR) << path.LossyDisplayName() << | 476 LOG(ERROR) << path.LossyDisplayName() << |
| 477 " doesn not encode a JSON dictionary."; | 477 " doesn not encode a JSON dictionary."; |
| 478 return NULL; | 478 return NULL; |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 | 481 |
| OLD | NEW |