blob: 262582f1cce3beece92e61c92813c982a8dc0485 [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
revemandfa74e6b92014-09-25 23:06:0720 bool Initialize(IOSurfaceRef io_surface);
[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 {}
revemance8fbe82014-09-05 02:19:5227 virtual bool CopyTexImage(unsigned target) OVERRIDE;
[email protected]24365f72014-03-26 21:16:1628 virtual void WillUseTexImage() OVERRIDE {}
29 virtual void DidUseTexImage() OVERRIDE {}
30 virtual void WillModifyTexImage() OVERRIDE {}
31 virtual void DidModifyTexImage() OVERRIDE {}
[email protected]5e57db72014-08-01 21:50:1732 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
33 int z_order,
34 OverlayTransform transform,
35 const Rect& bounds_rect,
36 const RectF& crop_rect) OVERRIDE;
[email protected]88105162013-12-05 01:02:1237
38 protected:
39 virtual ~GLImageIOSurface();
40
41 private:
[email protected]c3a6b4a2014-06-04 09:25:5342 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
[email protected]b63f1d62014-07-18 15:40:5943 const gfx::Size size_;
[email protected]88105162013-12-05 01:02:1244
45 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
46};
47
48} // namespace gfx
49
50#endif // UI_GL_GL_IMAGE_IO_SURFACE_H_