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

Side by Side Diff: content/common/gpu/image_transport_surface_linux.cc

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
OLDNEW
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/image_transport_surface.h" 5 #include "content/common/gpu/image_transport_surface.h"
6 6
7 // This conflicts with the defines in Xlib.h and must come first. 7 // This conflicts with the defines in Xlib.h and must come first.
8 #include "content/common/gpu/gpu_messages.h" 8 #include "content/common/gpu/gpu_messages.h"
9 9
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 903
904 // static 904 // static
905 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( 905 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
906 GpuChannelManager* manager, 906 GpuChannelManager* manager,
907 GpuCommandBufferStub* stub, 907 GpuCommandBufferStub* stub,
908 const gfx::GLSurfaceHandle& handle) { 908 const gfx::GLSurfaceHandle& handle) {
909 scoped_refptr<gfx::GLSurface> surface; 909 scoped_refptr<gfx::GLSurface> surface;
910 if (!handle.handle) { 910 if (!handle.handle) {
911 DCHECK(handle.transport); 911 DCHECK(handle.transport);
912 if (!handle.parent_client_id) { 912 if (!handle.parent_client_id) {
913 printf("New GL surface; had textures %u and %u\n", handle.parent_texture_i d[0], handle.parent_texture_id[1]);
Fady Samuel 2012/07/06 15:14:44 Please remember to delete once you're done debuggi
913 switch (gfx::GetGLImplementation()) { 914 switch (gfx::GetGLImplementation()) {
914 case gfx::kGLImplementationDesktopGL: 915 case gfx::kGLImplementationDesktopGL:
915 surface = new GLXImageTransportSurface(manager, stub); 916 surface = new GLXImageTransportSurface(manager, stub);
916 break; 917 break;
917 case gfx::kGLImplementationEGLGLES2: 918 case gfx::kGLImplementationEGLGLES2:
918 surface = new EGLImageTransportSurface(manager, stub); 919 surface = new EGLImageTransportSurface(manager, stub);
919 break; 920 break;
920 case gfx::kGLImplementationOSMesaGL: 921 case gfx::kGLImplementationOSMesaGL:
921 surface = new OSMesaImageTransportSurface(manager, stub); 922 surface = new OSMesaImageTransportSurface(manager, stub);
922 break; 923 break;
923 default: 924 default:
924 NOTREACHED(); 925 NOTREACHED();
925 return NULL; 926 return NULL;
926 } 927 }
927 } else { 928 } else {
929 printf("New tits with textures %u and %u\n", handle.parent_texture_id[0], handle.parent_texture_id[1]);
Fady Samuel 2012/07/06 15:14:44 Ditto
928 surface = new TextureImageTransportSurface(manager, stub, handle); 930 surface = new TextureImageTransportSurface(manager, stub, handle);
929 } 931 }
930 } else { 932 } else {
933 printf("New view gl surface; had textures %u and %u\n", handle.parent_text ure_id[0], handle.parent_texture_id[1]);
Fady Samuel 2012/07/06 15:14:44 Ditto.
931 surface = gfx::GLSurface::CreateViewGLSurface(false, handle.handle); 934 surface = gfx::GLSurface::CreateViewGLSurface(false, handle.handle);
932 if (!surface.get()) 935 if (!surface.get())
933 return NULL; 936 return NULL;
934 surface = new PassThroughImageTransportSurface(manager, 937 surface = new PassThroughImageTransportSurface(manager,
935 stub, 938 stub,
936 surface.get(), 939 surface.get(),
937 handle.transport); 940 handle.transport);
938 } 941 }
939 942
940 if (surface->Initialize()) 943 if (surface->Initialize())
941 return surface; 944 return surface;
942 else 945 else
943 return NULL; 946 return NULL;
944 } 947 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698