OLD | NEW |
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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
7 // - RenderingHelper is charged with interacting with X11, EGL, and GLES2. | 7 // - RenderingHelper is charged with interacting with X11, EGL, and GLES2. |
8 // - ClientState is an enum for the state of the decode client used by the test. | 8 // - ClientState is an enum for the state of the decode client used by the test. |
9 // - ClientStateNotification is a barrier abstraction that allows the test code | 9 // - ClientStateNotification is a barrier abstraction that allows the test code |
10 // to be written sequentially and wait for the decode client to see certain | 10 // to be written sequentially and wait for the decode client to see certain |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 return window; | 417 return window; |
418 } | 418 } |
419 | 419 |
420 EGLDisplay RenderingHelper::PlatformGetDisplay() { | 420 EGLDisplay RenderingHelper::PlatformGetDisplay() { |
421 return eglGetDisplay(EGL_DEFAULT_DISPLAY); | 421 return eglGetDisplay(EGL_DEFAULT_DISPLAY); |
422 } | 422 } |
423 | 423 |
424 #else // OS_WIN | 424 #else // OS_WIN |
425 | 425 |
426 void RenderingHelper::PlatformInitialize() { | 426 void RenderingHelper::PlatformInitialize() { |
427 CHECK(x_display_ = XOpenDisplay(NULL)); | 427 CHECK(x_display_ = base::MessagePumpForUI::GetDefaultXDisplay()); |
428 } | 428 } |
429 | 429 |
430 void RenderingHelper::PlatformUnInitialize() { | 430 void RenderingHelper::PlatformUnInitialize() { |
431 // Destroy resources acquired in Initialize, in reverse-acquisition order. | 431 // Destroy resources acquired in Initialize, in reverse-acquisition order. |
432 for (size_t i = 0; i < x_windows_.size(); ++i) { | 432 for (size_t i = 0; i < x_windows_.size(); ++i) { |
433 CHECK(XUnmapWindow(x_display_, x_windows_[i])); | 433 CHECK(XUnmapWindow(x_display_, x_windows_[i])); |
434 CHECK(XDestroyWindow(x_display_, x_windows_[i])); | 434 CHECK(XDestroyWindow(x_display_, x_windows_[i])); |
435 } | 435 } |
436 // Mimic newly created object. | 436 // Mimic newly created object. |
437 x_display_ = NULL; | 437 x_display_ = NULL; |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1))); | 1166 gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1))); |
1167 scoped_refptr<gfx::GLContext> context( | 1167 scoped_refptr<gfx::GLContext> context( |
1168 gfx::GLContext::CreateGLContext(NULL, surface.get(), | 1168 gfx::GLContext::CreateGLContext(NULL, surface.get(), |
1169 gfx::PreferIntegratedGpu)); | 1169 gfx::PreferIntegratedGpu)); |
1170 context->MakeCurrent(surface.get()); | 1170 context->MakeCurrent(surface.get()); |
1171 } | 1171 } |
1172 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 1172 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
1173 #endif // OS_WIN | 1173 #endif // OS_WIN |
1174 return RUN_ALL_TESTS(); | 1174 return RUN_ALL_TESTS(); |
1175 } | 1175 } |
OLD | NEW |