1 // Copyright (c) 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.
5 #ifndef UI_GL_GL_IMAGE_EGL_H_
6 #define UI_GL_GL_IMAGE_EGL_H_
8 #include "base/threading/thread_checker.h"
9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_image.h"
14 class GL_EXPORT GLImageEGL
: public GLImage
{
16 explicit GLImageEGL(const gfx::Size
& size
);
18 bool Initialize(EGLenum target
, EGLClientBuffer buffer
, const EGLint
* attrs
);
20 // Overridden from GLImage:
21 void Destroy(bool have_context
) override
;
22 gfx::Size
GetSize() override
;
23 unsigned GetInternalFormat() override
;
24 bool BindTexImage(unsigned target
) override
;
25 void ReleaseTexImage(unsigned target
) override
{}
26 bool CopyTexSubImage(unsigned target
,
28 const Rect
& rect
) override
;
29 void WillUseTexImage() override
{}
30 void DidUseTexImage() override
{}
31 void WillModifyTexImage() override
{}
32 void DidModifyTexImage() override
{}
33 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget
,
35 OverlayTransform transform
,
36 const Rect
& bounds_rect
,
37 const RectF
& crop_rect
) override
;
40 ~GLImageEGL() override
;
42 EGLImageKHR egl_image_
;
43 const gfx::Size size_
;
44 base::ThreadChecker thread_checker_
;
47 DISALLOW_COPY_AND_ASSIGN(GLImageEGL
);
52 #endif // UI_GL_GL_IMAGE_EGL_H_