| 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool DidRunOnGpu(const std::string& json_events) { | 120 bool DidRunOnGpu(const std::string& json_events) { |
| 121 using trace_analyzer::Query; | 121 using trace_analyzer::Query; |
| 122 using trace_analyzer::TraceAnalyzer; | 122 using trace_analyzer::TraceAnalyzer; |
| 123 | 123 |
| 124 // Check trace for GPU accleration. | 124 // Check trace for GPU accleration. |
| 125 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); | 125 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); |
| 126 | 126 |
| 127 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone; | 127 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone; |
| 128 const trace_analyzer::TraceEvent* gpu_event = analyzer->FindOneEvent( | 128 const trace_analyzer::TraceEvent* gpu_event = analyzer->FindFirstOf( |
| 129 Query::EventName() == Query::String("SwapBuffers") && | 129 Query::EventNameIs("SwapBuffers") && |
| 130 Query::EventHasNumberArg("GLImpl")); | 130 Query::EventHasNumberArg("GLImpl")); |
| 131 if (gpu_event) | 131 if (gpu_event) |
| 132 gl_impl = static_cast<gfx::GLImplementation>( | 132 gl_impl = static_cast<gfx::GLImplementation>( |
| 133 gpu_event->GetKnownArgAsInt("GLImpl")); | 133 gpu_event->GetKnownArgAsInt("GLImpl")); |
| 134 return (gl_impl == gfx::kGLImplementationDesktopGL || | 134 return (gl_impl == gfx::kGLImplementationDesktopGL || |
| 135 gl_impl == gfx::kGLImplementationEGLGLES2); | 135 gl_impl == gfx::kGLImplementationEGLGLES2); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void RunTest(const std::string& name) { | 138 void RunTest(const std::string& name) { |
| 139 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 kIsGpuCanvasTest | kInternal | kHasRedirect | kUseGpu | kDisableVsync, | 304 kIsGpuCanvasTest | kInternal | kHasRedirect | kUseGpu | kDisableVsync, |
| 305 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu, | 305 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu, |
| 306 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu | | 306 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu | |
| 307 kDisableVsync)); | 307 kDisableVsync)); |
| 308 | 308 |
| 309 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies) | 309 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies) |
| 310 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE) | 310 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE) |
| 311 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading) | 311 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading) |
| 312 | 312 |
| 313 } // namespace | 313 } // namespace |
| OLD | NEW |