blob: f360e78d0017b9946a9ad3566cbb725352d4de25 [file] [log] [blame]
[email protected]88105162013-12-05 01:02:121// Copyright 2013 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#ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_
6#define UI_GL_GL_IMAGE_IO_SURFACE_H_
7
[email protected]c3a6b4a2014-06-04 09:25:538#include <IOSurface/IOSurfaceAPI.h>
9
[email protected]88105162013-12-05 01:02:1210#include "base/mac/scoped_cftyperef.h"
[email protected]b63f1d62014-07-18 15:40:5911#include "ui/gfx/gpu_memory_buffer.h"
[email protected]88105162013-12-05 01:02:1212#include "ui/gl/gl_image.h"
13
[email protected]88105162013-12-05 01:02:1214namespace gfx {
15
16class GL_EXPORT GLImageIOSurface : public GLImage {
17 public:
[email protected]b63f1d62014-07-18 15:40:5918 explicit GLImageIOSurface(const gfx::Size& size);
[email protected]88105162013-12-05 01:02:1219
[email protected]b63f1d62014-07-18 15:40:5920 bool Initialize(const gfx::GpuMemoryBufferHandle& handle);
[email protected]88105162013-12-05 01:02:1221
[email protected]24365f72014-03-26 21:16:1622 // Overridden from GLImage:
[email protected]d2eaf52f2014-07-31 15:01:2423 virtual void Destroy(bool have_context) OVERRIDE;
[email protected]88105162013-12-05 01:02:1224 virtual gfx::Size GetSize() OVERRIDE;
25 virtual bool BindTexImage(unsigned target) OVERRIDE;
[email protected]24365f72014-03-26 21:16:1626 virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
27 virtual void WillUseTexImage() OVERRIDE {}
28 virtual void DidUseTexImage() OVERRIDE {}
29 virtual void WillModifyTexImage() OVERRIDE {}
30 virtual void DidModifyTexImage() OVERRIDE {}
[email protected]5e57db72014-08-01 21:50:1731 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
32 int z_order,
33 OverlayTransform transform,
34 const Rect& bounds_rect,
35 const RectF& crop_rect) OVERRIDE;
[email protected]88105162013-12-05 01:02:1236
37 protected:
38 virtual ~GLImageIOSurface();
39
40 private:
[email protected]c3a6b4a2014-06-04 09:25:5341 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
[email protected]b63f1d62014-07-18 15:40:5942 const gfx::Size size_;
[email protected]88105162013-12-05 01:02:1243
44 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
45};
46
47} // namespace gfx
48
49#endif // UI_GL_GL_IMAGE_IO_SURFACE_H_