OLD | NEW |
1 // Copyright (c) 2011 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 <deque> | 5 #include <deque> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "media/base/video_frame.h" | 16 #include "media/base/video_frame.h" |
17 #include "media/tools/shader_bench/cpu_color_painter.h" | 17 #include "media/tools/shader_bench/cpu_color_painter.h" |
18 #include "media/tools/shader_bench/gpu_color_painter.h" | 18 #include "media/tools/shader_bench/gpu_color_painter.h" |
19 #include "media/tools/shader_bench/gpu_color_painter_exp.h" | |
20 #include "media/tools/shader_bench/painter.h" | 19 #include "media/tools/shader_bench/painter.h" |
21 #include "media/tools/shader_bench/window.h" | 20 #include "media/tools/shader_bench/window.h" |
22 #include "ui/gfx/gl/gl_bindings.h" | 21 #include "ui/gfx/gl/gl_bindings.h" |
23 #include "ui/gfx/gl/gl_context.h" | 22 #include "ui/gfx/gl/gl_context.h" |
24 #include "ui/gfx/gl/gl_implementation.h" | 23 #include "ui/gfx/gl/gl_implementation.h" |
25 #include "ui/gfx/gl/gl_surface.h" | 24 #include "ui/gfx/gl/gl_surface.h" |
26 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
27 | 26 |
28 #if defined(TOOLKIT_GTK) | 27 #if defined(TOOLKIT_GTK) |
29 #include <gtk/gtk.h> | 28 #include <gtk/gtk.h> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 context->SetSwapInterval(0); | 141 context->SetSwapInterval(0); |
143 | 142 |
144 // Initialize and name GPU painters. | 143 // Initialize and name GPU painters. |
145 static const int kNumPainters = 3; | 144 static const int kNumPainters = 3; |
146 static const struct { | 145 static const struct { |
147 const char* name; | 146 const char* name; |
148 GPUPainter* painter; | 147 GPUPainter* painter; |
149 } painters[] = { | 148 } painters[] = { |
150 { "CPU CSC + GPU Render", new CPUColorPainter() }, | 149 { "CPU CSC + GPU Render", new CPUColorPainter() }, |
151 { "GPU CSC/Render", new GPUColorWithLuminancePainter() }, | 150 { "GPU CSC/Render", new GPUColorWithLuminancePainter() }, |
152 { "GPU CSC/Render (experimental)", new GPUColorRGBALumHackPainter() }, | |
153 }; | 151 }; |
154 | 152 |
155 // Run GPU painter tests. | 153 // Run GPU painter tests. |
156 for (int i = 0; i < kNumPainters; i++) { | 154 for (int i = 0; i < kNumPainters; i++) { |
157 scoped_ptr<GPUPainter> painter(painters[i].painter); | 155 scoped_ptr<GPUPainter> painter(painters[i].painter); |
158 painter->LoadFrames(&frames); | 156 painter->LoadFrames(&frames); |
159 painter->SetGLContext(surface, context); | 157 painter->SetGLContext(surface, context); |
160 painter->Initialize(width, height); | 158 painter->Initialize(width, height); |
161 printf("Running %s tests...", painters[i].name); | 159 printf("Running %s tests...", painters[i].name); |
162 RunTest(window.get(), painter.get()); | 160 RunTest(window.get(), painter.get()); |
163 } | 161 } |
164 | 162 |
165 return 0; | 163 return 0; |
166 } | 164 } |
OLD | NEW |