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/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 | 321 |
322 private: | 322 private: |
323 class SurfaceImage : public GLImageLinuxDMABuffer { | 323 class SurfaceImage : public GLImageLinuxDMABuffer { |
324 public: | 324 public: |
325 SurfaceImage(const gfx::Size& size, unsigned internalformat) | 325 SurfaceImage(const gfx::Size& size, unsigned internalformat) |
326 : GLImageLinuxDMABuffer(size, internalformat) {} | 326 : GLImageLinuxDMABuffer(size, internalformat) {} |
327 | 327 |
328 bool Initialize(scoped_refptr<ui::NativePixmap> pixmap, | 328 bool Initialize(scoped_refptr<ui::NativePixmap> pixmap, |
329 gfx::GpuMemoryBuffer::Format format) { | 329 gfx::GpuMemoryBuffer::Format format) { |
330 base::FileDescriptor handle(pixmap->GetDmaBufFd(), false); | 330 const std::vector<base::FileDescriptor> handles = { |
331 if (!GLImageLinuxDMABuffer::Initialize(handle, format, | 331 base::FileDescriptor(pixmap->GetDmaBufFd(), false)}; |
332 pixmap->GetDmaBufPitch())) | 332 const std::vector<gfx::GpuMemoryBuffer::Format> formats = {format}; |
| 333 const std::vector<int> pitches = {pixmap->GetDmaBufPitch()}; |
| 334 |
| 335 if (!GLImageLinuxDMABuffer::Initialize(1, handles, formats, pitches)) |
333 return false; | 336 return false; |
334 pixmap_ = pixmap; | 337 pixmap_ = pixmap; |
335 return true; | 338 return true; |
336 } | 339 } |
337 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 340 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
338 int z_order, | 341 int z_order, |
339 gfx::OverlayTransform transform, | 342 gfx::OverlayTransform transform, |
340 const gfx::Rect& bounds_rect, | 343 const gfx::Rect& bounds_rect, |
341 const gfx::RectF& crop_rect) override { | 344 const gfx::RectF& crop_rect) override { |
342 return ui::SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane( | 345 return ui::SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane( |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 NOTREACHED(); | 504 NOTREACHED(); |
502 return NULL; | 505 return NULL; |
503 } | 506 } |
504 } | 507 } |
505 | 508 |
506 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 509 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
507 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 510 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
508 } | 511 } |
509 | 512 |
510 } // namespace gfx | 513 } // namespace gfx |
OLD | NEW |