[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 1 | // 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] | c3a6b4a | 2014-06-04 09:25:53 | [diff] [blame] | 8 | #include <IOSurface/IOSurfaceAPI.h> |
9 | |||||
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 10 | #include "base/mac/scoped_cftyperef.h" |
[email protected] | b63f1d6 | 2014-07-18 15:40:59 | [diff] [blame] | 11 | #include "ui/gfx/gpu_memory_buffer.h" |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 12 | #include "ui/gl/gl_image.h" |
13 | |||||
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 14 | namespace gfx { |
15 | |||||
16 | class GL_EXPORT GLImageIOSurface : public GLImage { | ||||
17 | public: | ||||
[email protected] | b63f1d6 | 2014-07-18 15:40:59 | [diff] [blame] | 18 | explicit GLImageIOSurface(const gfx::Size& size); |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 19 | |
[email protected] | b63f1d6 | 2014-07-18 15:40:59 | [diff] [blame] | 20 | bool Initialize(const gfx::GpuMemoryBufferHandle& handle); |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 21 | |
[email protected] | 24365f7 | 2014-03-26 21:16:16 | [diff] [blame] | 22 | // Overridden from GLImage: |
[email protected] | d2eaf52f | 2014-07-31 15:01:24 | [diff] [blame] | 23 | virtual void Destroy(bool have_context) OVERRIDE; |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 24 | virtual gfx::Size GetSize() OVERRIDE; |
25 | virtual bool BindTexImage(unsigned target) OVERRIDE; | ||||
[email protected] | 24365f7 | 2014-03-26 21:16:16 | [diff] [blame] | 26 | 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] | 5e57db7 | 2014-08-01 21:50:17 | [diff] [blame^] | 31 | 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] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 36 | |
37 | protected: | ||||
38 | virtual ~GLImageIOSurface(); | ||||
39 | |||||
40 | private: | ||||
[email protected] | c3a6b4a | 2014-06-04 09:25:53 | [diff] [blame] | 41 | base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
[email protected] | b63f1d6 | 2014-07-18 15:40:59 | [diff] [blame] | 42 | const gfx::Size size_; |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 43 | |
44 | DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); | ||||
45 | }; | ||||
46 | |||||
47 | } // namespace gfx | ||||
48 | |||||
49 | #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ |