ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / ui / ozone / platform / dri / overlay_plane.cc
blob674586d00c2cbd4309c79da86c40930dbe7b37a6
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/dri/overlay_plane.h"
7 #include "base/logging.h"
8 #include "ui/ozone/platform/dri/scanout_buffer.h"
10 namespace ui {
12 OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer)
13 : buffer(buffer),
14 z_order(0),
15 display_bounds(gfx::Point(), buffer->GetSize()),
16 crop_rect(0, 0, 1, 1) {
19 OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer,
20 int z_order,
21 gfx::OverlayTransform plane_transform,
22 const gfx::Rect& display_bounds,
23 const gfx::RectF& crop_rect)
24 : buffer(buffer),
25 z_order(z_order),
26 plane_transform(plane_transform),
27 display_bounds(display_bounds),
28 crop_rect(crop_rect) {
31 OverlayPlane::~OverlayPlane() {
34 // static
35 const OverlayPlane* OverlayPlane::GetPrimaryPlane(
36 const OverlayPlaneList& overlays) {
37 for (size_t i = 0; i < overlays.size(); ++i) {
38 if (overlays[i].z_order == 0)
39 return &overlays[i];
42 return nullptr;
45 } // namespace ui