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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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/filters/video_renderer_base_unittest.cc ('k') | net/base/upload_data_stream_unittest.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) 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 <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <deque> 7 #include <deque>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Process files. 124 // Process files.
125 std::deque<scoped_refptr<media::VideoFrame> > frames; 125 std::deque<scoped_refptr<media::VideoFrame> > frames;
126 GetFrames(file_name, width, height, num_frames, frames); 126 GetFrames(file_name, width, height, num_frames, frames);
127 127
128 // Initialize window and graphics context. 128 // Initialize window and graphics context.
129 base::AtExitManager at_exit_manager; 129 base::AtExitManager at_exit_manager;
130 gfx::GLSurface::InitializeOneOff(); 130 gfx::GLSurface::InitializeOneOff();
131 scoped_ptr<media::Window> window(new media::Window(width, height)); 131 scoped_ptr<media::Window> window(new media::Window(width, height));
132 gfx::GLSurface* surface = 132 gfx::GLSurface* surface =
133 gfx::GLSurface::CreateViewGLSurface(false, window->PluginWindow()); 133 gfx::GLSurface::CreateViewGLSurface(false, window->PluginWindow()).get();
134 gfx::GLContext* context = gfx::GLContext::CreateGLContext( 134 gfx::GLContext* context = gfx::GLContext::CreateGLContext(
135 NULL, 135 NULL, surface, gfx::PreferDiscreteGpu).get();
136 surface,
137 gfx::PreferDiscreteGpu);
138 context->MakeCurrent(surface); 136 context->MakeCurrent(surface);
139 // This sets D3DPRESENT_INTERVAL_IMMEDIATE on Windows. 137 // This sets D3DPRESENT_INTERVAL_IMMEDIATE on Windows.
140 context->SetSwapInterval(0); 138 context->SetSwapInterval(0);
141 139
142 // Initialize and name GPU painters. 140 // Initialize and name GPU painters.
143 static const int kNumPainters = 3; 141 static const int kNumPainters = 3;
144 static const struct { 142 static const struct {
145 const char* name; 143 const char* name;
146 GPUPainter* painter; 144 GPUPainter* painter;
147 } painters[] = { 145 } painters[] = {
148 { "CPU CSC + GPU Render", new CPUColorPainter() }, 146 { "CPU CSC + GPU Render", new CPUColorPainter() },
149 { "GPU CSC/Render", new GPUColorWithLuminancePainter() }, 147 { "GPU CSC/Render", new GPUColorWithLuminancePainter() },
150 }; 148 };
151 149
152 // Run GPU painter tests. 150 // Run GPU painter tests.
153 for (int i = 0; i < kNumPainters; i++) { 151 for (int i = 0; i < kNumPainters; i++) {
154 scoped_ptr<GPUPainter> painter(painters[i].painter); 152 scoped_ptr<GPUPainter> painter(painters[i].painter);
155 painter->LoadFrames(&frames); 153 painter->LoadFrames(&frames);
156 painter->SetGLContext(surface, context); 154 painter->SetGLContext(surface, context);
157 painter->Initialize(width, height); 155 painter->Initialize(width, height);
158 printf("Running %s tests...", painters[i].name); 156 printf("Running %s tests...", painters[i].name);
159 RunTest(window.get(), painter.get()); 157 RunTest(window.get(), painter.get());
160 } 158 }
161 159
162 return 0; 160 return 0;
163 } 161 }
OLDNEW
« no previous file with comments | « media/filters/video_renderer_base_unittest.cc ('k') | net/base/upload_data_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698