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/image_transport_surface.h" | 5 #include "content/common/gpu/image_transport_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // static | 23 // static |
24 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 24 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
25 GpuChannelManager* manager, | 25 GpuChannelManager* manager, |
26 GpuCommandBufferStub* stub, | 26 GpuCommandBufferStub* stub, |
27 const gfx::GLSurfaceHandle& handle) { | 27 const gfx::GLSurfaceHandle& handle) { |
28 DCHECK(handle.handle); | 28 DCHECK(handle.handle); |
29 DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT); | 29 DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT); |
30 scoped_refptr<gfx::GLSurface> surface = | 30 scoped_refptr<gfx::GLSurface> surface = |
31 gfx::GLSurface::CreateViewGLSurface(handle.handle); | 31 gfx::GLSurface::CreateViewGLSurface(handle.handle); |
32 if (!surface) | 32 if (!surface.get()) |
33 return surface; | 33 return surface; |
34 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( | 34 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( |
35 manager, stub, surface.get())); | 35 manager, stub, surface.get())); |
36 } | 36 } |
37 | 37 |
38 } // namespace content | 38 } // namespace content |
OLD | NEW |