blob: cd4f7a134901025f3a59507e48087e7d341814d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_
#define UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_
#include "ui/gl/gl_image_egl.h"
namespace gfx {
class GL_EXPORT GLImageAndroidNativeBuffer : public GLImageEGL {
public:
explicit GLImageAndroidNativeBuffer(const gfx::Size& size);
bool Initialize(EGLClientBuffer native_buffer);
// Overridden from GLImage:
virtual void Destroy(bool have_context) OVERRIDE;
virtual bool BindTexImage(unsigned target) OVERRIDE;
virtual void WillUseTexImage() OVERRIDE;
virtual void DidUseTexImage() OVERRIDE;
virtual void SetReleaseAfterUse() OVERRIDE;
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
const RectF& crop_rect) OVERRIDE;
protected:
virtual ~GLImageAndroidNativeBuffer();
private:
bool release_after_use_;
bool in_use_;
unsigned target_;
EGLImageKHR egl_image_for_unbind_;
GLuint texture_id_for_unbind_;
DISALLOW_COPY_AND_ASSIGN(GLImageAndroidNativeBuffer);
};
} // namespace gfx
#endif // UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_
|