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

Side by Side Diff: content/common/gpu/client/gl_helper_unittest.cc

Issue 553293002: command_buffer: Optimize non-debug path of GLES2DecoderImpl::DoCommands(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test that relied on "cb_command" using scoped TRACE. Created 6 years, 3 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
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 <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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698