OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gl/gl_image_shm.h" | 5 #include "ui/gl/gl_image_shm.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
9 #include "ui/gl/scoped_binders.h" | 9 #include "ui/gl/scoped_binders.h" |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 0, // mip level | 155 0, // mip level |
156 TextureFormat(internalformat_), | 156 TextureFormat(internalformat_), |
157 size_.width(), | 157 size_.width(), |
158 size_.height(), | 158 size_.height(), |
159 0, // border | 159 0, // border |
160 DataFormat(internalformat_), | 160 DataFormat(internalformat_), |
161 DataType(internalformat_), | 161 DataType(internalformat_), |
162 shared_memory_->memory()); | 162 shared_memory_->memory()); |
163 } | 163 } |
164 | 164 |
165 EGLint attrs[] = {EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_IMAGE_PRESERVED_KHR, | 165 EGLint attrs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; |
reveman
2014/03/27 22:52:04
Removing "EGL_GL_TEXTURE_LEVEL_KHR, 0" here as wel
| |
166 EGL_TRUE, EGL_NONE}; | |
167 // Need to pass current EGL rendering context to eglCreateImageKHR for | 166 // Need to pass current EGL rendering context to eglCreateImageKHR for |
168 // target type EGL_GL_TEXTURE_2D_KHR. | 167 // target type EGL_GL_TEXTURE_2D_KHR. |
169 egl_image_ = | 168 egl_image_ = |
170 eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(), | 169 eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(), |
171 eglGetCurrentContext(), | 170 eglGetCurrentContext(), |
172 EGL_GL_TEXTURE_2D_KHR, | 171 EGL_GL_TEXTURE_2D_KHR, |
173 reinterpret_cast<EGLClientBuffer>(egl_texture_id_), | 172 reinterpret_cast<EGLClientBuffer>(egl_texture_id_), |
174 attrs); | 173 attrs); |
175 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_) | 174 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_) |
176 << "Error creating EGLImage: " << eglGetError(); | 175 << "Error creating EGLImage: " << eglGetError(); |
(...skipping 15 matching lines...) Expand all Loading... | |
192 0, // border | 191 0, // border |
193 DataFormat(internalformat_), | 192 DataFormat(internalformat_), |
194 DataType(internalformat_), | 193 DataType(internalformat_), |
195 shared_memory_->memory()); | 194 shared_memory_->memory()); |
196 | 195 |
197 shared_memory_->Unmap(); | 196 shared_memory_->Unmap(); |
198 return true; | 197 return true; |
199 } | 198 } |
200 | 199 |
201 } // namespace gfx | 200 } // namespace gfx |
OLD | NEW |