watk | e6e68b1e | 2015-12-01 04:04:03 | [diff] [blame] | 1 | // Copyright 2015 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/gl/gl_surface_overlay.h" |
| 6 | |
| 7 | #include "ui/gfx/geometry/rect.h" |
| 8 | #include "ui/gfx/geometry/rect_f.h" |
| 9 | #include "ui/gfx/native_widget_types.h" |
| 10 | #include "ui/gfx/overlay_transform.h" |
| 11 | #include "ui/gl/gl_image.h" |
| 12 | |
kylechar | 7a46384 | 2016-05-26 14:46:12 | [diff] [blame] | 13 | namespace gl { |
watk | e6e68b1e | 2015-12-01 04:04:03 | [diff] [blame] | 14 | |
| 15 | GLSurfaceOverlay::GLSurfaceOverlay(int z_order, |
kylechar | 7a46384 | 2016-05-26 14:46:12 | [diff] [blame] | 16 | gfx::OverlayTransform transform, |
kylechar | fd72190 | 2016-05-27 16:00:24 | [diff] [blame] | 17 | GLImage* image, |
kylechar | 7a46384 | 2016-05-26 14:46:12 | [diff] [blame] | 18 | const gfx::Rect& bounds_rect, |
| 19 | const gfx::RectF& crop_rect) |
watk | e6e68b1e | 2015-12-01 04:04:03 | [diff] [blame] | 20 | : z_order_(z_order), |
| 21 | transform_(transform), |
| 22 | image_(image), |
| 23 | bounds_rect_(bounds_rect), |
| 24 | crop_rect_(crop_rect) {} |
| 25 | |
vmpstr | 8108fdf | 2016-04-08 18:55:50 | [diff] [blame] | 26 | GLSurfaceOverlay::GLSurfaceOverlay(const GLSurfaceOverlay& other) = default; |
| 27 | |
watk | e6e68b1e | 2015-12-01 04:04:03 | [diff] [blame] | 28 | GLSurfaceOverlay::~GLSurfaceOverlay() {} |
| 29 | |
kylechar | 7a46384 | 2016-05-26 14:46:12 | [diff] [blame] | 30 | bool GLSurfaceOverlay::ScheduleOverlayPlane( |
| 31 | gfx::AcceleratedWidget widget) const { |
watk | e6e68b1e | 2015-12-01 04:04:03 | [diff] [blame] | 32 | return image_->ScheduleOverlayPlane(widget, z_order_, transform_, |
| 33 | bounds_rect_, crop_rect_); |
| 34 | } |
| 35 | |
vince.h | 8baf5bd7 | 2016-07-15 01:12:25 | [diff] [blame] | 36 | void GLSurfaceOverlay::Flush() const { |
| 37 | return image_->Flush(); |
| 38 | } |
| 39 | |
kylechar | 7a46384 | 2016-05-26 14:46:12 | [diff] [blame] | 40 | } // namespace gl |