blob: a8a606b8212d2c2b08e94f0eef4568582c249aa3 [file] [log] [blame]
watke6e68b1e2015-12-01 04:04:031// 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
kylechar7a463842016-05-26 14:46:1213namespace gl {
watke6e68b1e2015-12-01 04:04:0314
15GLSurfaceOverlay::GLSurfaceOverlay(int z_order,
kylechar7a463842016-05-26 14:46:1216 gfx::OverlayTransform transform,
kylecharfd721902016-05-27 16:00:2417 GLImage* image,
kylechar7a463842016-05-26 14:46:1218 const gfx::Rect& bounds_rect,
19 const gfx::RectF& crop_rect)
watke6e68b1e2015-12-01 04:04:0320 : z_order_(z_order),
21 transform_(transform),
22 image_(image),
23 bounds_rect_(bounds_rect),
24 crop_rect_(crop_rect) {}
25
vmpstr8108fdf2016-04-08 18:55:5026GLSurfaceOverlay::GLSurfaceOverlay(const GLSurfaceOverlay& other) = default;
27
watke6e68b1e2015-12-01 04:04:0328GLSurfaceOverlay::~GLSurfaceOverlay() {}
29
kylechar7a463842016-05-26 14:46:1230bool GLSurfaceOverlay::ScheduleOverlayPlane(
31 gfx::AcceleratedWidget widget) const {
watke6e68b1e2015-12-01 04:04:0332 return image_->ScheduleOverlayPlane(widget, z_order_, transform_,
33 bounds_rect_, crop_rect_);
34}
35
vince.h8baf5bd72016-07-15 01:12:2536void GLSurfaceOverlay::Flush() const {
37 return image_->Flush();
38}
39
kylechar7a463842016-05-26 14:46:1240} // namespace gl