| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/common/gpu/media/gles2_texture_to_egl_image_translator.h" | 5 #include "content/common/gpu/media/gles2_texture_to_egl_image_translator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #if defined(TOOLKIT_USES_GTK) | 8 #if defined(TOOLKIT_USES_GTK) |
| 9 #include "base/message_pump_gtk.h" | 9 #include "base/message_pump_gtk.h" |
| 10 #elif defined(USE_AURA) | 10 #elif defined(USE_AURA) |
| 11 #include "base/message_pump_aurax11.h" | 11 #include "base/message_pump_aurax11.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace content { |
| 15 |
| 14 // Get EGL extension functions. | 16 // Get EGL extension functions. |
| 15 static PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr = | 17 static PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr = |
| 16 reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>( | 18 reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>( |
| 17 eglGetProcAddress("eglCreateImageKHR")); | 19 eglGetProcAddress("eglCreateImageKHR")); |
| 18 static PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image_khr = | 20 static PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image_khr = |
| 19 reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>( | 21 reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>( |
| 20 eglGetProcAddress("eglDestroyImageKHR")); | 22 eglGetProcAddress("eglDestroyImageKHR")); |
| 21 static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glegl_image_targettexture_2does = | 23 static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glegl_image_targettexture_2does = |
| 22 reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>( | 24 reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>( |
| 23 eglGetProcAddress("glEGLImageTargetTexture2DOES")); | 25 eglGetProcAddress("glEGLImageTargetTexture2DOES")); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 109 |
| 108 if (use_backing_pixmaps_) { | 110 if (use_backing_pixmaps_) { |
| 109 ImagePixmap::iterator it = eglimage_pixmap_.find(egl_image); | 111 ImagePixmap::iterator it = eglimage_pixmap_.find(egl_image); |
| 110 CHECK(it != eglimage_pixmap_.end()); | 112 CHECK(it != eglimage_pixmap_.end()); |
| 111 Pixmap pixmap = it->second; | 113 Pixmap pixmap = it->second; |
| 112 eglimage_pixmap_.erase(it); | 114 eglimage_pixmap_.erase(it); |
| 113 Display* x_display = base::MessagePumpForUI::GetDefaultXDisplay(); | 115 Display* x_display = base::MessagePumpForUI::GetDefaultXDisplay(); |
| 114 XFreePixmap(x_display, pixmap); | 116 XFreePixmap(x_display, pixmap); |
| 115 } | 117 } |
| 116 } | 118 } |
| 119 |
| 120 } // namespace content |
| OLD | NEW |