| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #include "ui/ozone/platform/dri/overlay_plane.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "ui/ozone/platform/dri/scanout_buffer.h" | |
| 9 | |
| 10 namespace ui { | |
| 11 | |
| 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), | |
| 17 overlay_plane(0) { | |
| 18 } | |
| 19 | |
| 20 OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer, | |
| 21 int z_order, | |
| 22 gfx::OverlayTransform plane_transform, | |
| 23 const gfx::Rect& display_bounds, | |
| 24 const gfx::RectF& crop_rect) | |
| 25 : buffer(buffer), | |
| 26 z_order(z_order), | |
| 27 plane_transform(plane_transform), | |
| 28 display_bounds(display_bounds), | |
| 29 crop_rect(crop_rect), | |
| 30 overlay_plane(0) { | |
| 31 } | |
| 32 | |
| 33 OverlayPlane::~OverlayPlane() { | |
| 34 } | |
| 35 | |
| 36 // static | |
| 37 const OverlayPlane& OverlayPlane::GetPrimaryPlane( | |
| 38 const OverlayPlaneList& overlays) { | |
| 39 for (size_t i = 0; i < overlays.size(); ++i) { | |
| 40 if (overlays[i].z_order == 0) | |
| 41 return overlays[i]; | |
| 42 } | |
| 43 | |
| 44 NOTREACHED(); | |
| 45 return overlays[0]; | |
| 46 } | |
| 47 | |
| 48 } // namespace ui | |
| OLD | NEW |