| OLD | NEW |
| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <cmath> | 6 #include <cmath> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data)); | 111 scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data)); |
| 112 base::ListValue* list; | 112 base::ListValue* list; |
| 113 CHECK(trace_data->GetAsList(&list)); | 113 CHECK(trace_data->GetAsList(&list)); |
| 114 for (size_t i = 0; i < list->GetSize(); i++) { | 114 for (size_t i = 0; i < list->GetSize(); i++) { |
| 115 base::Value* item = NULL; | 115 base::Value* item = NULL; |
| 116 if (list->Get(i, &item)) { | 116 if (list->Get(i, &item)) { |
| 117 base::DictionaryValue* dict; | 117 base::DictionaryValue* dict; |
| 118 CHECK(item->GetAsDictionary(&dict)); | 118 CHECK(item->GetAsDictionary(&dict)); |
| 119 std::string name; | 119 std::string name; |
| 120 CHECK(dict->GetString("name", &name)); | 120 CHECK(dict->GetString("name", &name)); |
| 121 (*event_counts)[name]++; | 121 std::string trace_type; |
| 122 CHECK(dict->GetString("ph", &trace_type)); |
| 123 // Count all except END traces, as they come in BEGIN/END pairs. |
| 124 if (trace_type != "E") |
| 125 (*event_counts)[name]++; |
| 122 VLOG(1) << "trace name: " << name; | 126 VLOG(1) << "trace name: " << name; |
| 123 } | 127 } |
| 124 } | 128 } |
| 125 } | 129 } |
| 126 | 130 |
| 127 // Bicubic filter kernel function. | 131 // Bicubic filter kernel function. |
| 128 static float Bicubic(float x) { | 132 static float Bicubic(float x) { |
| 129 const float a = -0.5; | 133 const float a = -0.5; |
| 130 x = std::abs(x); | 134 x = std::abs(x); |
| 131 float x2 = x * x; | 135 float x2 = x * x; |
| (...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 base::CommandLine::Init(argc, argv); | 1958 base::CommandLine::Init(argc, argv); |
| 1955 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1959 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 1956 #if defined(OS_MACOSX) | 1960 #if defined(OS_MACOSX) |
| 1957 base::mac::ScopedNSAutoreleasePool pool; | 1961 base::mac::ScopedNSAutoreleasePool pool; |
| 1958 #endif | 1962 #endif |
| 1959 | 1963 |
| 1960 content::UnitTestTestSuite runner(suite); | 1964 content::UnitTestTestSuite runner(suite); |
| 1961 base::MessageLoop message_loop; | 1965 base::MessageLoop message_loop; |
| 1962 return runner.Run(); | 1966 return runner.Run(); |
| 1963 } | 1967 } |
| OLD | NEW |