[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 | |
reveman | dfa74e6b9 | 2014-09-25 23:06:07 | [diff] [blame] | 20 | bool Initialize(IOSurfaceRef io_surface); |
[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 {} |
reveman | ce8fbe8 | 2014-09-05 02:19:52 | [diff] [blame] | 27 | virtual bool CopyTexImage(unsigned target) OVERRIDE; |
[email protected] | 24365f7 | 2014-03-26 21:16:16 | [diff] [blame] | 28 | virtual void WillUseTexImage() OVERRIDE {} |
29 | virtual void DidUseTexImage() OVERRIDE {} | ||||
30 | virtual void WillModifyTexImage() OVERRIDE {} | ||||
31 | virtual void DidModifyTexImage() OVERRIDE {} | ||||
[email protected] | 5e57db7 | 2014-08-01 21:50:17 | [diff] [blame] | 32 | 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] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 37 | |
38 | protected: | ||||
39 | virtual ~GLImageIOSurface(); | ||||
40 | |||||
41 | private: | ||||
[email protected] | c3a6b4a | 2014-06-04 09:25:53 | [diff] [blame] | 42 | base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
[email protected] | b63f1d6 | 2014-07-18 15:40:59 | [diff] [blame] | 43 | const gfx::Size size_; |
[email protected] | 8810516 | 2013-12-05 01:02:12 | [diff] [blame] | 44 | |
45 | DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); | ||||
46 | }; | ||||
47 | |||||
48 | } // namespace gfx | ||||
49 | |||||
50 | #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ |