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
3 // found in the LICENSE file.
5 #include "ui/ozone/platform/drm/gpu/overlay_plane.h"
7 #include "base/logging.h"
8 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
12 OverlayPlane::OverlayPlane(scoped_refptr
<ScanoutBuffer
> buffer
)
14 plane_transform(gfx::OVERLAY_TRANSFORM_INVALID
),
15 display_bounds(gfx::Point(), buffer
->GetSize()),
16 crop_rect(0, 0, 1, 1) {}
18 OverlayPlane::OverlayPlane(scoped_refptr
<ScanoutBuffer
> buffer
,
20 gfx::OverlayTransform plane_transform
,
21 const gfx::Rect
& display_bounds
,
22 const gfx::RectF
& crop_rect
)
25 plane_transform(plane_transform
),
26 display_bounds(display_bounds
),
27 crop_rect(crop_rect
) {
30 OverlayPlane::~OverlayPlane() {
34 const OverlayPlane
* OverlayPlane::GetPrimaryPlane(
35 const OverlayPlaneList
& overlays
) {
36 for (size_t i
= 0; i
< overlays
.size(); ++i
) {
37 if (overlays
[i
].z_order
== 0)