| 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 "content/common/gpu/image_transport_surface.h" | 5 #include "gpu/ipc/service/image_transport_surface.h" |
| 6 | 6 |
| 7 #include "content/common/gpu/pass_through_image_transport_surface.h" | 7 #include "gpu/ipc/service/pass_through_image_transport_surface.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace gpu { |
| 10 | 10 |
| 11 // static | 11 // static |
| 12 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 12 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
| 13 GpuChannelManager* manager, | 13 GpuChannelManager* manager, |
| 14 GpuCommandBufferStub* stub, | 14 GpuCommandBufferStub* stub, |
| 15 gpu::SurfaceHandle surface_handle, | 15 SurfaceHandle surface_handle, |
| 16 gfx::GLSurface::Format format) { | 16 gfx::GLSurface::Format format) { |
| 17 DCHECK_NE(surface_handle, gpu::kNullSurfaceHandle); | 17 DCHECK_NE(surface_handle, kNullSurfaceHandle); |
| 18 scoped_refptr<gfx::GLSurface> surface; | 18 scoped_refptr<gfx::GLSurface> surface; |
| 19 #if defined(USE_OZONE) | 19 #if defined(USE_OZONE) |
| 20 surface = gfx::GLSurface::CreateSurfacelessViewGLSurface(surface_handle); | 20 surface = gfx::GLSurface::CreateSurfacelessViewGLSurface(surface_handle); |
| 21 #endif | 21 #endif |
| 22 if (!surface) | 22 if (!surface) |
| 23 surface = gfx::GLSurface::CreateViewGLSurface(surface_handle); | 23 surface = gfx::GLSurface::CreateViewGLSurface(surface_handle); |
| 24 if (!surface) | 24 if (!surface) |
| 25 return surface; | 25 return surface; |
| 26 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( | 26 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( |
| 27 manager, stub, surface.get())); | 27 manager, stub, surface.get())); |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace content | 30 } // namespace gpu |
| OLD | NEW |