OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/ozone/platform/egltest/ozone_platform_egltest.h" | 5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 class SurfaceFactoryEgltest : public ui::SurfaceFactoryOzone { | 193 class SurfaceFactoryEgltest : public ui::SurfaceFactoryOzone { |
194 public: | 194 public: |
195 SurfaceFactoryEgltest(LibeglplatformShimLoader* eglplatform_shim) | 195 SurfaceFactoryEgltest(LibeglplatformShimLoader* eglplatform_shim) |
196 : eglplatform_shim_(eglplatform_shim) {} | 196 : eglplatform_shim_(eglplatform_shim) {} |
197 virtual ~SurfaceFactoryEgltest() {} | 197 virtual ~SurfaceFactoryEgltest() {} |
198 | 198 |
199 // SurfaceFactoryOzone: | 199 // SurfaceFactoryOzone: |
200 virtual HardwareState InitializeHardware() OVERRIDE; | 200 virtual HardwareState InitializeHardware() OVERRIDE; |
201 virtual void ShutdownHardware() OVERRIDE; | 201 virtual void ShutdownHardware() OVERRIDE; |
202 virtual intptr_t GetNativeDisplay() OVERRIDE; | 202 virtual intptr_t GetNativeDisplay() OVERRIDE; |
203 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | |
204 virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 203 virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
205 gfx::AcceleratedWidget widget) OVERRIDE; | 204 gfx::AcceleratedWidget widget) OVERRIDE; |
206 virtual const int32* GetEGLSurfaceProperties( | 205 virtual const int32* GetEGLSurfaceProperties( |
207 const int32* desired_list) OVERRIDE; | 206 const int32* desired_list) OVERRIDE; |
208 virtual bool LoadEGLGLES2Bindings( | 207 virtual bool LoadEGLGLES2Bindings( |
209 AddGLLibraryCallback add_gl_library, | 208 AddGLLibraryCallback add_gl_library, |
210 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE; | 209 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE; |
211 | 210 |
212 private: | 211 private: |
213 LibeglplatformShimLoader* eglplatform_shim_; | 212 LibeglplatformShimLoader* eglplatform_shim_; |
214 }; | 213 }; |
215 | 214 |
216 SurfaceFactoryEgltest::HardwareState | 215 SurfaceFactoryEgltest::HardwareState |
217 SurfaceFactoryEgltest::InitializeHardware() { | 216 SurfaceFactoryEgltest::InitializeHardware() { |
218 return INITIALIZED; | 217 return INITIALIZED; |
219 } | 218 } |
220 | 219 |
221 void SurfaceFactoryEgltest::ShutdownHardware() { | 220 void SurfaceFactoryEgltest::ShutdownHardware() { |
222 } | 221 } |
223 | 222 |
224 intptr_t SurfaceFactoryEgltest::GetNativeDisplay() { | 223 intptr_t SurfaceFactoryEgltest::GetNativeDisplay() { |
225 return eglplatform_shim_->ShimGetNativeDisplay(); | 224 return eglplatform_shim_->ShimGetNativeDisplay(); |
226 } | 225 } |
227 | 226 |
228 gfx::AcceleratedWidget SurfaceFactoryEgltest::GetAcceleratedWidget() { | |
229 NOTREACHED(); | |
230 return gfx::kNullAcceleratedWidget; | |
231 } | |
232 | |
233 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryEgltest::CreateEGLSurfaceForWidget( | 227 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryEgltest::CreateEGLSurfaceForWidget( |
234 gfx::AcceleratedWidget widget) { | 228 gfx::AcceleratedWidget widget) { |
235 return make_scoped_ptr<SurfaceOzoneEGL>( | 229 return make_scoped_ptr<SurfaceOzoneEGL>( |
236 new SurfaceOzoneEgltest(widget, eglplatform_shim_)); | 230 new SurfaceOzoneEgltest(widget, eglplatform_shim_)); |
237 } | 231 } |
238 | 232 |
239 bool SurfaceFactoryEgltest::LoadEGLGLES2Bindings( | 233 bool SurfaceFactoryEgltest::LoadEGLGLES2Bindings( |
240 AddGLLibraryCallback add_gl_library, | 234 AddGLLibraryCallback add_gl_library, |
241 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { | 235 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { |
242 const char* egl_soname = eglplatform_shim_->ShimQueryString(SHIM_EGL_LIBRARY); | 236 const char* egl_soname = eglplatform_shim_->ShimQueryString(SHIM_EGL_LIBRARY); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 389 |
396 } // namespace | 390 } // namespace |
397 | 391 |
398 OzonePlatform* CreateOzonePlatformEgltest() { | 392 OzonePlatform* CreateOzonePlatformEgltest() { |
399 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 393 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
400 platform->Initialize(); | 394 platform->Initialize(); |
401 return platform; | 395 return platform; |
402 } | 396 } |
403 | 397 |
404 } // namespace ui | 398 } // namespace ui |
OLD | NEW |