| 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/overlay_plane.h" | 5 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 9 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const gfx::RectF& crop_rect) | 23 const gfx::RectF& crop_rect) |
| 24 : buffer(buffer), | 24 : buffer(buffer), |
| 25 z_order(z_order), | 25 z_order(z_order), |
| 26 plane_transform(plane_transform), | 26 plane_transform(plane_transform), |
| 27 display_bounds(display_bounds), | 27 display_bounds(display_bounds), |
| 28 crop_rect(crop_rect) {} | 28 crop_rect(crop_rect) {} |
| 29 | 29 |
| 30 OverlayPlane::~OverlayPlane() { | 30 OverlayPlane::~OverlayPlane() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, |
| 34 int z_order, |
| 35 gfx::OverlayTransform plane_transform, |
| 36 const gfx::Rect& display_bounds, |
| 37 const gfx::RectF& crop_rect, |
| 38 const ProcessBufferCallback& processing_callback) |
| 39 : buffer(buffer), |
| 40 z_order(z_order), |
| 41 plane_transform(plane_transform), |
| 42 display_bounds(display_bounds), |
| 43 crop_rect(crop_rect), |
| 44 processing_callback(processing_callback) {} |
| 45 |
| 33 bool OverlayPlane::operator<(const OverlayPlane& plane) const { | 46 bool OverlayPlane::operator<(const OverlayPlane& plane) const { |
| 34 return std::tie(z_order, display_bounds, crop_rect, plane_transform) < | 47 return std::tie(z_order, display_bounds, crop_rect, plane_transform) < |
| 35 std::tie(plane.z_order, plane.display_bounds, plane.crop_rect, | 48 std::tie(plane.z_order, plane.display_bounds, plane.crop_rect, |
| 36 plane.plane_transform); | 49 plane.plane_transform); |
| 37 } | 50 } |
| 38 | 51 |
| 39 // static | 52 // static |
| 40 const OverlayPlane* OverlayPlane::GetPrimaryPlane( | 53 const OverlayPlane* OverlayPlane::GetPrimaryPlane( |
| 41 const OverlayPlaneList& overlays) { | 54 const OverlayPlaneList& overlays) { |
| 42 for (size_t i = 0; i < overlays.size(); ++i) { | 55 for (size_t i = 0; i < overlays.size(); ++i) { |
| 43 if (overlays[i].z_order == 0) | 56 if (overlays[i].z_order == 0) |
| 44 return &overlays[i]; | 57 return &overlays[i]; |
| 45 } | 58 } |
| 46 | 59 |
| 47 return nullptr; | 60 return nullptr; |
| 48 } | 61 } |
| 49 | 62 |
| 50 } // namespace ui | 63 } // namespace ui |
| OLD | NEW |