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

Side by Side Diff: media/tools/shader_bench/shader_bench.cc

Issue 6976055: More POSIX support for Chromium, consisting mostly of broadening ifdefs. This (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/base/media_switches.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <deque> 5 #include <deque>
6 #include <iostream> 6 #include <iostream>
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/command_line.h" 11 #include "base/command_line.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "media/base/callback.h" 15 #include "media/base/callback.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" 19 #include "media/tools/shader_bench/gpu_color_painter_exp.h"
20 #include "media/tools/shader_bench/painter.h" 20 #include "media/tools/shader_bench/painter.h"
21 #include "media/tools/shader_bench/window.h" 21 #include "media/tools/shader_bench/window.h"
22 #include "ui/gfx/gl/gl_bindings.h" 22 #include "ui/gfx/gl/gl_bindings.h"
23 #include "ui/gfx/gl/gl_context.h" 23 #include "ui/gfx/gl/gl_context.h"
24 #include "ui/gfx/gl/gl_implementation.h" 24 #include "ui/gfx/gl/gl_implementation.h"
25 #include "ui/gfx/gl/gl_surface.h" 25 #include "ui/gfx/gl/gl_surface.h"
26 #include "ui/gfx/native_widget_types.h" 26 #include "ui/gfx/native_widget_types.h"
27 27
28 #if defined(OS_LINUX) 28 #if defined(TOOLKIT_USES_GTK)
29 #include <gtk/gtk.h> 29 #include <gtk/gtk.h>
30 #endif 30 #endif
31 31
32 static const int kNumFramesToPaint = 500; 32 static const int kNumFramesToPaint = 500;
33 static base::TimeTicks g_start_; 33 static base::TimeTicks g_start_;
34 static base::TimeTicks g_end_; 34 static base::TimeTicks g_end_;
35 35
36 long CalculateYUVFrameSize(FILE* file_handle, int num_frames) { 36 long CalculateYUVFrameSize(FILE* file_handle, int num_frames) {
37 fseek(file_handle, 0, SEEK_END); 37 fseek(file_handle, 0, SEEK_END);
38 long file_size = (long) ftell(file_handle); 38 long file_size = (long) ftell(file_handle);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Read arguments. 91 // Read arguments.
92 if (argc == 1) { 92 if (argc == 1) {
93 printf("Usage: %s --file=FILE --wxh=DIMENSIONS --frames=NUM_FRAMES\n" 93 printf("Usage: %s --file=FILE --wxh=DIMENSIONS --frames=NUM_FRAMES\n"
94 "FILE is a raw .yuv file with 1+ frames in it\n" 94 "FILE is a raw .yuv file with 1+ frames in it\n"
95 "DIMENSIONS is the width and height of the frame in pixels\n" 95 "DIMENSIONS is the width and height of the frame in pixels\n"
96 "NUM_FRAMES is the number of frames in FILE\n", argv[0]); 96 "NUM_FRAMES is the number of frames in FILE\n", argv[0]);
97 return 1; 97 return 1;
98 } 98 }
99 99
100 // Read command line. 100 // Read command line.
101 #if defined(OS_LINUX) 101 #if defined(TOOLKIT_USES_GTK)
102 gtk_init(&argc, &argv); 102 gtk_init(&argc, &argv);
103 #endif 103 #endif
104 CommandLine::Init(argc, argv); 104 CommandLine::Init(argc, argv);
105 105
106 // Determine file name. 106 // Determine file name.
107 std::string file_name = 107 std::string file_name =
108 CommandLine::ForCurrentProcess()->GetSwitchValueASCII("file"); 108 CommandLine::ForCurrentProcess()->GetSwitchValueASCII("file");
109 109
110 // Determine number of frames. 110 // Determine number of frames.
111 int num_frames = 0; 111 int num_frames = 0;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 scoped_ptr<GPUPainter> painter(painters[i].painter); 156 scoped_ptr<GPUPainter> painter(painters[i].painter);
157 painter->LoadFrames(&frames); 157 painter->LoadFrames(&frames);
158 painter->SetGLContext(surface, context); 158 painter->SetGLContext(surface, context);
159 painter->Initialize(width, height); 159 painter->Initialize(width, height);
160 printf("Running %s tests...", painters[i].name); 160 printf("Running %s tests...", painters[i].name);
161 RunTest(window.get(), painter.get()); 161 RunTest(window.get(), painter.get());
162 } 162 }
163 163
164 return 0; 164 return 0;
165 } 165 }
OLDNEW
« no previous file with comments | « media/base/media_switches.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698