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

Side by Side Diff: ui/gl/gl_surface_ozone.cc

Issue 962723002: Change CHROMIUM_image declarations to support multi planar input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trybot issues fixed. Created 5 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698