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

Side by Side Diff: media/gpu/rendering_helper.cc

Issue 2774363002: Initialize Ozone in video_decode_accelerator_unittest. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/gpu/rendering_helper.h" 5 #include "media/gpu/rendering_helper.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // static 191 // static
192 void RenderingHelper::InitializeOneOff(base::WaitableEvent* done) { 192 void RenderingHelper::InitializeOneOff(base::WaitableEvent* done) {
193 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 193 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
194 #if GL_VARIANT_GLX 194 #if GL_VARIANT_GLX
195 cmd_line->AppendSwitchASCII(switches::kUseGL, 195 cmd_line->AppendSwitchASCII(switches::kUseGL,
196 gl::kGLImplementationDesktopName); 196 gl::kGLImplementationDesktopName);
197 #else 197 #else
198 cmd_line->AppendSwitchASCII(switches::kUseGL, gl::kGLImplementationEGLName); 198 cmd_line->AppendSwitchASCII(switches::kUseGL, gl::kGLImplementationEGLName);
199 #endif 199 #endif
200 200
201 #if defined(USE_OZONE)
202 ui::OzonePlatform::InitParams params;
203 params.single_process = true;
204 ui::OzonePlatform::InitializeForGPU(params);
205 #endif
206
201 if (!gl::init::InitializeGLOneOff()) 207 if (!gl::init::InitializeGLOneOff())
202 LOG(FATAL) << "Could not initialize GL"; 208 LOG(FATAL) << "Could not initialize GL";
203 done->Signal(); 209 done->Signal();
204 } 210 }
205 211
206 RenderingHelper::RenderingHelper() : ignore_vsync_(false) { 212 RenderingHelper::RenderingHelper() : ignore_vsync_(false) {
207 window_ = gfx::kNullAcceleratedWidget; 213 window_ = gfx::kNullAcceleratedWidget;
208 Clear(); 214 Clear();
209 } 215 }
210 216
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // When the rendering falls behind, drops frames. 912 // When the rendering falls behind, drops frames.
907 while (scheduled_render_time_ < target) { 913 while (scheduled_render_time_ < target) {
908 scheduled_render_time_ += frame_duration_; 914 scheduled_render_time_ += frame_duration_;
909 DropOneFrameForAllVideos(); 915 DropOneFrameForAllVideos();
910 } 916 }
911 917
912 task_runner_->PostDelayedTask(FROM_HERE, render_task_.callback(), 918 task_runner_->PostDelayedTask(FROM_HERE, render_task_.callback(),
913 target - now); 919 target - now);
914 } 920 }
915 } // namespace media 921 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698