| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GL_GL_IMAGE_EGL_H_ | 5 #ifndef UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_ |
| 6 #define UI_GL_GL_IMAGE_EGL_H_ | 6 #define UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_ |
| 7 | 7 |
| 8 #include "ui/gl/gl_bindings.h" // for EGLImageKHR | 8 #include "ui/gl/gl_image_egl.h" |
| 9 #include "ui/gl/gl_image.h" | |
| 10 | 9 |
| 11 namespace gfx { | 10 namespace gfx { |
| 12 | 11 |
| 13 class GL_EXPORT GLImageEGL : public GLImage { | 12 class GL_EXPORT GLImageAndroidNativeBuffer : public GLImageEGL { |
| 14 public: | 13 public: |
| 15 explicit GLImageEGL(gfx::Size size); | 14 explicit GLImageAndroidNativeBuffer(gfx::Size size); |
| 16 | 15 |
| 17 bool Initialize(gfx::GpuMemoryBufferHandle buffer); | 16 bool Initialize(gfx::GpuMemoryBufferHandle buffer); |
| 18 | 17 |
| 19 // Overridden from GLImage: | 18 // Overridden from GLImage: |
| 20 virtual void Destroy() OVERRIDE; | 19 virtual void Destroy() OVERRIDE; |
| 21 virtual gfx::Size GetSize() OVERRIDE; | |
| 22 virtual bool BindTexImage(unsigned target) OVERRIDE; | 20 virtual bool BindTexImage(unsigned target) OVERRIDE; |
| 23 virtual void ReleaseTexImage(unsigned target) OVERRIDE; | |
| 24 virtual void WillUseTexImage() OVERRIDE; | 21 virtual void WillUseTexImage() OVERRIDE; |
| 25 virtual void DidUseTexImage() OVERRIDE; | 22 virtual void DidUseTexImage() OVERRIDE; |
| 26 virtual void WillModifyTexImage() OVERRIDE {} | |
| 27 virtual void DidModifyTexImage() OVERRIDE {} | |
| 28 virtual void SetReleaseAfterUse() OVERRIDE; | 23 virtual void SetReleaseAfterUse() OVERRIDE; |
| 29 | 24 |
| 30 protected: | 25 protected: |
| 31 virtual ~GLImageEGL(); | 26 virtual ~GLImageAndroidNativeBuffer(); |
| 32 | 27 |
| 33 private: | 28 private: |
| 34 EGLImageKHR egl_image_; | |
| 35 gfx::Size size_; | |
| 36 bool release_after_use_; | 29 bool release_after_use_; |
| 37 bool in_use_; | 30 bool in_use_; |
| 38 unsigned target_; | 31 unsigned target_; |
| 39 EGLImageKHR egl_image_for_unbind_; | 32 EGLImageKHR egl_image_for_unbind_; |
| 40 GLuint texture_id_for_unbind_; | 33 GLuint texture_id_for_unbind_; |
| 41 | 34 |
| 42 DISALLOW_COPY_AND_ASSIGN(GLImageEGL); | 35 DISALLOW_COPY_AND_ASSIGN(GLImageAndroidNativeBuffer); |
| 43 }; | 36 }; |
| 44 | 37 |
| 45 } // namespace gfx | 38 } // namespace gfx |
| 46 | 39 |
| 47 #endif // UI_GL_GL_IMAGE_EGL_H_ | 40 #endif // UI_GL_GL_IMAGE_ANDROID_NATIVE_BUFFER_H_ |
| OLD | NEW |