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 <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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Some of the tests may launch http requests through JSON or AJAX | 93 // Some of the tests may launch http requests through JSON or AJAX |
94 // which causes a security error (cross domain request) when the page | 94 // which causes a security error (cross domain request) when the page |
95 // is loaded from the local file system ( file:// ). The following switch | 95 // is loaded from the local file system ( file:// ). The following switch |
96 // fixes that error. | 96 // fixes that error. |
97 launch_arguments_.AppendSwitch(switches::kAllowFileAccessFromFiles); | 97 launch_arguments_.AppendSwitch(switches::kAllowFileAccessFromFiles); |
98 | 98 |
99 if (!HasFlag(kUseGpu)) { | 99 if (!HasFlag(kUseGpu)) { |
100 launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing); | 100 launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing); |
101 launch_arguments_.AppendSwitch(switches::kDisableExperimentalWebGL); | 101 launch_arguments_.AppendSwitch(switches::kDisableExperimentalWebGL); |
| 102 launch_arguments_.AppendSwitch(switches::kDisableAccelerated2dCanvas); |
102 } else { | 103 } else { |
103 // This switch is required for enabling the accelerated 2d canvas on | 104 // This switch is required for enabling the accelerated 2d canvas on |
104 // Chrome versions prior to Chrome 15, which may be the case for the | 105 // Chrome versions prior to Chrome 15, which may be the case for the |
105 // reference build. | 106 // reference build. |
106 launch_arguments_.AppendSwitch(switches::kEnableAccelerated2dCanvas); | 107 launch_arguments_.AppendSwitch(switches::kEnableAccelerated2dCanvas); |
107 } | 108 } |
108 | 109 |
109 if (HasFlag(kDisableVsync)) | 110 if (HasFlag(kDisableVsync)) |
110 launch_arguments_.AppendSwitch(switches::kDisableGpuVsync); | 111 launch_arguments_.AppendSwitch(switches::kDisableGpuVsync); |
111 | 112 |
112 UIPerfTest::SetUp(); | 113 UIPerfTest::SetUp(); |
113 } | 114 } |
114 | 115 |
115 bool DidRunOnGpu(const std::string& json_events) { | 116 bool DidRunOnGpu(const std::string& json_events) { |
116 using namespace trace_analyzer; | 117 using namespace trace_analyzer; |
117 | 118 |
118 // Check trace for GPU accleration. | 119 // Check trace for GPU accleration. |
119 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); | 120 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); |
120 | 121 |
121 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone; | 122 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone; |
122 const TraceEvent* gpu_event = analyzer->FindOneEvent( | 123 const TraceEvent* gpu_event = analyzer->FindOneEvent( |
123 Query(EVENT_NAME) == Query::String("GLES2DecoderImpl::Initialize") && | 124 Query(EVENT_NAME) == Query::String("SwapBuffers") && |
124 Query(EVENT_HAS_NUMBER_ARG, "GLImpl")); | 125 Query(EVENT_HAS_NUMBER_ARG, "GLImpl")); |
125 if (gpu_event) | 126 if (gpu_event) |
126 gl_impl = static_cast<gfx::GLImplementation>( | 127 gl_impl = static_cast<gfx::GLImplementation>( |
127 gpu_event->GetKnownArgAsInt("GLImpl")); | 128 gpu_event->GetKnownArgAsInt("GLImpl")); |
128 return (gl_impl == gfx::kGLImplementationDesktopGL || | 129 return (gl_impl == gfx::kGLImplementationDesktopGL || |
129 gl_impl == gfx::kGLImplementationEGLGLES2); | 130 gl_impl == gfx::kGLImplementationEGLGLES2); |
130 } | 131 } |
131 | 132 |
132 void RunTest(const std::string& name) { | 133 void RunTest(const std::string& name) { |
133 if (HasFlag(kUseGpu) && !IsGpuAvailable()) { | 134 if (HasFlag(kUseGpu) && !IsGpuAvailable()) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 kInternal | kHasRedirect | kUseGpu, | 283 kInternal | kHasRedirect | kUseGpu, |
283 kInternal | kHasRedirect | kUseGpu | kDisableVsync, | 284 kInternal | kHasRedirect | kUseGpu | kDisableVsync, |
284 kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu, | 285 kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu, |
285 kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu | kDisableVsync)); | 286 kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu | kDisableVsync)); |
286 | 287 |
287 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies) | 288 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies) |
288 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE) | 289 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE) |
289 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading) | 290 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading) |
290 | 291 |
291 } // namespace | 292 } // namespace |
OLD | NEW |