OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_path.h" | 10 #include "base/file_path.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 return InterpretContentLayer(node); | 434 return InterpretContentLayer(node); |
435 if (type == "CanvasLayer") | 435 if (type == "CanvasLayer") |
436 return InterpretCanvasLayer(node); | 436 return InterpretCanvasLayer(node); |
437 if (type == "VideoLayer") | 437 if (type == "VideoLayer") |
438 return InterpretVideoLayer(node); | 438 return InterpretVideoLayer(node); |
439 if (type == "ImageLayer") | 439 if (type == "ImageLayer") |
440 return InterpretImageLayer(node); | 440 return InterpretImageLayer(node); |
441 | 441 |
442 | 442 |
443 string outjson; | 443 string outjson; |
444 JSONWriter::Write(node, true, &outjson); | 444 JSONWriter::WriteWithOptions(node, base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 445 &outjson); |
445 LOG(ERROR) << "Unrecognized node type! JSON:\n\n" | 446 LOG(ERROR) << "Unrecognized node type! JSON:\n\n" |
446 "-----------------------\n" << | 447 "-----------------------\n" << |
447 outjson << | 448 outjson << |
448 "-----------------------"; | 449 "-----------------------"; |
449 | 450 |
450 return NULL; | 451 return NULL; |
451 } | 452 } |
452 | 453 |
453 RenderNode* BuildRenderTreeFromFile(const FilePath& path) { | 454 RenderNode* BuildRenderTreeFromFile(const FilePath& path) { |
454 LOG(INFO) << "Reading " << path.LossyDisplayName(); | 455 LOG(INFO) << "Reading " << path.LossyDisplayName(); |
(...skipping 18 matching lines...) Expand all Loading... |
473 DictionaryValue* v = static_cast<DictionaryValue*>(root.get()); | 474 DictionaryValue* v = static_cast<DictionaryValue*>(root.get()); |
474 RenderNode* tree = InterpretContentLayer(v); | 475 RenderNode* tree = InterpretContentLayer(v); |
475 return tree; | 476 return tree; |
476 } else { | 477 } else { |
477 LOG(ERROR) << path.LossyDisplayName() << | 478 LOG(ERROR) << path.LossyDisplayName() << |
478 " doesn not encode a JSON dictionary."; | 479 " doesn not encode a JSON dictionary."; |
479 return NULL; | 480 return NULL; |
480 } | 481 } |
481 } | 482 } |
482 | 483 |
OLD | NEW |