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

Side by Side Diff: ui/gfx/gl/gl_surface_egl.cc

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gfx/gl/gl_surface_egl.h" 5 #include "ui/gfx/gl/gl_surface_egl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/angle/include/EGL/egl.h" 10 #include "third_party/angle/include/EGL/egl.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 bool PbufferGLSurfaceEGL::SwapBuffers() { 301 bool PbufferGLSurfaceEGL::SwapBuffers() {
302 NOTREACHED() << "Attempted to call SwapBuffers on a PbufferGLSurfaceEGL."; 302 NOTREACHED() << "Attempted to call SwapBuffers on a PbufferGLSurfaceEGL.";
303 return false; 303 return false;
304 } 304 }
305 305
306 gfx::Size PbufferGLSurfaceEGL::GetSize() { 306 gfx::Size PbufferGLSurfaceEGL::GetSize() {
307 return size_; 307 return size_;
308 } 308 }
309 309
310 bool PbufferGLSurfaceEGL::Resize(const gfx::Size& size) {
311 if (size == size_)
312 return true;
313
314 Destroy();
315 size_ = size;
316 return Initialize();
317 }
318
310 EGLSurface PbufferGLSurfaceEGL::GetHandle() { 319 EGLSurface PbufferGLSurfaceEGL::GetHandle() {
311 return surface_; 320 return surface_;
312 } 321 }
313 322
323 void* PbufferGLSurfaceEGL::GetShareHandle() {
324 const char* extensions = eglQueryString(g_display, EGL_EXTENSIONS);
325 if (!strstr(extensions, "EGL_ANGLE_query_surface_pointer"))
326 return NULL;
327
328 void* handle;
329 if (!eglQuerySurfacePointerANGLE(g_display,
330 GetHandle(),
331 EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE,
332 &handle)) {
333 return NULL;
334 }
335
336 return handle;
337 }
338
314 } // namespace gfx 339 } // namespace gfx
OLDNEW
« gpu/DEPS ('K') | « ui/gfx/gl/gl_surface_egl.h ('k') | ui/gfx/gl/gl_surface_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698