| 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/drm/gpu/gbm_buffer.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 6 | 6 |
| 7 #include <drm.h> | 7 #include <drm.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <gbm.h> | 9 #include <gbm.h> |
| 10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 353 } |
| 354 | 354 |
| 355 uint64_t GbmPixmap::GetDmaBufModifier(size_t plane) const { | 355 uint64_t GbmPixmap::GetDmaBufModifier(size_t plane) const { |
| 356 return buffer_->GetFormatModifier(); | 356 return buffer_->GetFormatModifier(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 gfx::BufferFormat GbmPixmap::GetBufferFormat() const { | 359 gfx::BufferFormat GbmPixmap::GetBufferFormat() const { |
| 360 return ui::GetBufferFormatFromFourCCFormat(buffer_->GetFormat()); | 360 return ui::GetBufferFormatFromFourCCFormat(buffer_->GetFormat()); |
| 361 } | 361 } |
| 362 | 362 |
| 363 gfx::BufferUsage GbmPixmap::GetBufferUsage() const { |
| 364 return ui::GetBufferUsageFromGbmFlags(buffer_->GetFlags()); |
| 365 } |
| 366 |
| 363 gfx::Size GbmPixmap::GetBufferSize() const { | 367 gfx::Size GbmPixmap::GetBufferSize() const { |
| 364 return buffer_->GetSize(); | 368 return buffer_->GetSize(); |
| 365 } | 369 } |
| 366 | 370 |
| 367 bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 371 bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 368 int plane_z_order, | 372 int plane_z_order, |
| 369 gfx::OverlayTransform plane_transform, | 373 gfx::OverlayTransform plane_transform, |
| 370 const gfx::Rect& display_bounds, | 374 const gfx::Rect& display_bounds, |
| 371 const gfx::RectF& crop_rect) { | 375 const gfx::RectF& crop_rect) { |
| 372 DCHECK(buffer_->GetFlags() & GBM_BO_USE_SCANOUT); | 376 DCHECK(buffer_->GetFlags() & GBM_BO_USE_SCANOUT); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 DCHECK(!processing_callback_.is_null()); | 408 DCHECK(!processing_callback_.is_null()); |
| 405 if (!processing_callback_.Run(this, processed_pixmap_)) { | 409 if (!processing_callback_.Run(this, processed_pixmap_)) { |
| 406 LOG(ERROR) << "Failed processing NativePixmap"; | 410 LOG(ERROR) << "Failed processing NativePixmap"; |
| 407 return nullptr; | 411 return nullptr; |
| 408 } | 412 } |
| 409 | 413 |
| 410 return processed_pixmap_->buffer(); | 414 return processed_pixmap_->buffer(); |
| 411 } | 415 } |
| 412 | 416 |
| 413 } // namespace ui | 417 } // namespace ui |
| OLD | NEW |