Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1107)

Unified Diff: content/common/gpu/gles2_texture_to_egl_image_translator.cc

Issue 7088021: OmxVideoDecodeAcceleratorTest is born! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gles2_texture_to_egl_image_translator.cc
diff --git a/content/common/gpu/gles2_texture_to_egl_image_translator.cc b/content/common/gpu/gles2_texture_to_egl_image_translator.cc
index 487dd0b751ddfc8175bec53ff4d67acb42fb6354..210b6fabf6d2eb486f610e13a178f3f329178811 100644
--- a/content/common/gpu/gles2_texture_to_egl_image_translator.cc
+++ b/content/common/gpu/gles2_texture_to_egl_image_translator.cc
@@ -18,16 +18,7 @@ static bool AreEGLExtensionsInitialized() {
return (egl_create_image_khr && egl_destroy_image_khr);
}
-Gles2TextureToEglImageTranslator::Gles2TextureToEglImageTranslator(
- Display* display,
- int32 gles2_context_id)
- : size_(320, 240),
- egl_display_((EGLDisplay)0x1/*display*/),
- egl_context_((EGLContext)0x368b8001/*gles2_context_id*/) {
- // TODO(vhiremath@nvidia.com)
- // Replace the above hard coded values with appropriate variables.
- // size_/egl_display_/egl_context_.
- // These should be initiated from the App.
+Gles2TextureToEglImageTranslator::Gles2TextureToEglImageTranslator() {
if (!AreEGLExtensionsInitialized()) {
LOG(DFATAL) << "Failed to get EGL extensions";
return;
@@ -39,17 +30,18 @@ Gles2TextureToEglImageTranslator::~Gles2TextureToEglImageTranslator() {
}
EGLImageKHR Gles2TextureToEglImageTranslator::TranslateToEglImage(
- uint32 texture) {
+ EGLDisplay egl_display, EGLContext egl_context, uint32 texture) {
EGLint attrib = EGL_NONE;
if (!egl_create_image_khr)
return EGL_NO_IMAGE_KHR;
// Create an EGLImage
EGLImageKHR hEglImage = egl_create_image_khr(
- egl_display_,
- egl_context_,
- EGL_GL_TEXTURE_2D_KHR,
- reinterpret_cast<EGLClientBuffer>(texture),
- &attrib);
+ egl_display,
+ egl_context,
+ EGL_GL_TEXTURE_2D_KHR,
+ reinterpret_cast<EGLClientBuffer>(texture),
+ &attrib);
+ CHECK(hEglImage);
return hEglImage;
}
@@ -62,12 +54,13 @@ uint32 Gles2TextureToEglImageTranslator::TranslateToTexture(
return texture;
}
-void Gles2TextureToEglImageTranslator::DestroyEglImage(EGLImageKHR egl_image) {
+void Gles2TextureToEglImageTranslator::DestroyEglImage(
+ EGLDisplay egl_display, EGLImageKHR egl_image) {
// Clients of this class will call this method for each EGLImage handle.
// Actual destroying of the handles is done here.
if (!egl_destroy_image_khr) {
LOG(ERROR) << "egl_destroy_image_khr failed";
return;
}
- egl_destroy_image_khr(egl_display_, egl_image);
+ egl_destroy_image_khr(egl_display, egl_image);
}
« no previous file with comments | « content/common/gpu/gles2_texture_to_egl_image_translator.h ('k') | content/common/gpu/omx_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698