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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 std::string trace_type; | 121 std::string trace_type; |
122 CHECK(dict->GetString("ph", &trace_type)); | 122 CHECK(dict->GetString("ph", &trace_type)); |
123 // Count all except END traces, as they come in BEGIN/END pairs. | 123 // Count all except END traces, as they come in BEGIN/END pairs. |
124 if (trace_type != "E") | 124 if (trace_type != "E") |
125 (*event_counts)[name]++; | 125 (*event_counts)[name]++; |
126 VLOG(1) << "trace name: " << name; | 126 DVLOG(1) << "trace name: " << name; |
127 } | 127 } |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 // Bicubic filter kernel function. | 131 // Bicubic filter kernel function. |
132 static float Bicubic(float x) { | 132 static float Bicubic(float x) { |
133 const float a = -0.5; | 133 const float a = -0.5; |
134 x = std::abs(x); | 134 x = std::abs(x); |
135 float x2 = x * x; | 135 float x2 = x * x; |
136 float x3 = x2 * x; | 136 float x3 = x2 * x; |
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 0, | 1754 0, |
1755 1, | 1755 1, |
1756 false, | 1756 false, |
1757 true, | 1757 true, |
1758 content::GLHelper::SCALER_QUALITY_FAST); | 1758 content::GLHelper::SCALER_QUALITY_FAST); |
1759 | 1759 |
1760 std::map<std::string, int> event_counts; | 1760 std::map<std::string, int> event_counts; |
1761 EndTracing(&event_counts); | 1761 EndTracing(&event_counts); |
1762 int draw_buffer_calls = event_counts["kDrawBuffersEXTImmediate"]; | 1762 int draw_buffer_calls = event_counts["kDrawBuffersEXTImmediate"]; |
1763 int draw_arrays_calls = event_counts["kDrawArrays"]; | 1763 int draw_arrays_calls = event_counts["kDrawArrays"]; |
1764 VLOG(1) << "Draw buffer calls: " << draw_buffer_calls; | 1764 DVLOG(1) << "Draw buffer calls: " << draw_buffer_calls; |
1765 VLOG(1) << "DrawArrays calls: " << draw_arrays_calls; | 1765 DVLOG(1) << "DrawArrays calls: " << draw_arrays_calls; |
1766 | 1766 |
1767 if (draw_buffer_calls) { | 1767 if (draw_buffer_calls) { |
1768 // When using MRT, the YUV readback code should only | 1768 // When using MRT, the YUV readback code should only |
1769 // execute two draw arrays, and scaling should be integrated | 1769 // execute two draw arrays, and scaling should be integrated |
1770 // into those two calls since we are using the FAST scalign | 1770 // into those two calls since we are using the FAST scalign |
1771 // quality. | 1771 // quality. |
1772 EXPECT_EQ(2, draw_arrays_calls); | 1772 EXPECT_EQ(2, draw_arrays_calls); |
1773 } else { | 1773 } else { |
1774 // When not using MRT, there are three passes for the YUV, | 1774 // When not using MRT, there are three passes for the YUV, |
1775 // and one for the scaling. | 1775 // and one for the scaling. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 base::CommandLine::Init(argc, argv); | 1958 base::CommandLine::Init(argc, argv); |
1959 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1959 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
1960 #if defined(OS_MACOSX) | 1960 #if defined(OS_MACOSX) |
1961 base::mac::ScopedNSAutoreleasePool pool; | 1961 base::mac::ScopedNSAutoreleasePool pool; |
1962 #endif | 1962 #endif |
1963 | 1963 |
1964 content::UnitTestTestSuite runner(suite); | 1964 content::UnitTestTestSuite runner(suite); |
1965 base::MessageLoop message_loop; | 1965 base::MessageLoop message_loop; |
1966 return runner.Run(); | 1966 return runner.Run(); |
1967 } | 1967 } |
OLD | NEW |