| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cast/surface_factory_cast.h" | 5 #include "ui/ozone/platform/cast/surface_factory_cast.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <EGL/egl.h> | 8 #include <EGL/egl.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 new_display_size_ = gfx::Size(widget >> 16, widget & 0xFFFF); | 230 new_display_size_ = gfx::Size(widget >> 16, widget & 0xFFFF); |
| 231 new_display_size_.SetToMax(GetMinDisplaySize()); | 231 new_display_size_.SetToMax(GetMinDisplaySize()); |
| 232 return make_scoped_ptr<SurfaceOzoneEGL>(new SurfaceOzoneEglCast(this)); | 232 return make_scoped_ptr<SurfaceOzoneEGL>(new SurfaceOzoneEglCast(this)); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void SurfaceFactoryCast::ChildDestroyed() { | 235 void SurfaceFactoryCast::ChildDestroyed() { |
| 236 if (egl_platform_->MultipleSurfaceUnsupported()) | 236 if (egl_platform_->MultipleSurfaceUnsupported()) |
| 237 DestroyWindow(); | 237 DestroyWindow(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 const int32_t* SurfaceFactoryCast::GetEGLSurfaceProperties( |
| 241 const int32_t* desired_list) { |
| 242 return egl_platform_->GetEGLSurfaceProperties(desired_list); |
| 243 } |
| 244 |
| 240 scoped_refptr<NativePixmap> SurfaceFactoryCast::CreateNativePixmap( | 245 scoped_refptr<NativePixmap> SurfaceFactoryCast::CreateNativePixmap( |
| 241 gfx::AcceleratedWidget widget, | 246 gfx::AcceleratedWidget widget, |
| 242 gfx::Size size, | 247 gfx::Size size, |
| 243 gfx::BufferFormat format, | 248 gfx::BufferFormat format, |
| 244 gfx::BufferUsage usage) { | 249 gfx::BufferUsage usage) { |
| 245 class CastPixmap : public NativePixmap { | 250 class CastPixmap : public NativePixmap { |
| 246 public: | 251 public: |
| 247 CastPixmap(SurfaceFactoryCast* parent) : parent_(parent) {} | 252 CastPixmap(SurfaceFactoryCast* parent) : parent_(parent) {} |
| 248 | 253 |
| 249 void* GetEGLClientBuffer() const override { | 254 void* GetEGLClientBuffer() const override { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 return false; | 303 return false; |
| 299 } | 304 } |
| 300 | 305 |
| 301 set_gl_get_proc_address.Run(gl_proc); | 306 set_gl_get_proc_address.Run(gl_proc); |
| 302 add_gl_library.Run(lib_egl); | 307 add_gl_library.Run(lib_egl); |
| 303 add_gl_library.Run(lib_gles2); | 308 add_gl_library.Run(lib_gles2); |
| 304 return true; | 309 return true; |
| 305 } | 310 } |
| 306 | 311 |
| 307 } // namespace ui | 312 } // namespace ui |
| OLD | NEW |