Chromium Code Reviews| 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 "content/common/gpu/image_transport_surface.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 // static | 9 // static |
| 10 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 10 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
| 11 GpuChannelManager* manager, | 11 GpuChannelManager* manager, |
| 12 GpuCommandBufferStub* stub, | 12 GpuCommandBufferStub* stub, |
| 13 const gfx::GLSurfaceHandle& handle) { | 13 const gfx::GLSurfaceHandle& handle) { |
| 14 DCHECK(handle.handle); | 14 DCHECK(handle.handle); |
| 15 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT); | 15 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT); |
| 16 scoped_refptr<gfx::GLSurface> surface = | 16 scoped_refptr<gfx::GLSurface> surface; |
| 17 gfx::GLSurface::CreateViewGLSurface(handle.handle); | 17 #if USE_OZONE |
|
spang
2015/02/19 00:42:04
Don't you need to take the flag into account? Not
achaulk
2015/02/19 00:43:07
That's done inside ozone, if we don't support due
spang
2015/02/19 00:49:26
Ok, so this is "maybe create surfaceless, but I ca
| |
| 18 surface = gfx::GLSurface::CreateSurfacelessViewGLSurface(handle.handle); | |
| 19 #endif | |
| 20 if (!surface.get()) | |
| 21 surface = gfx::GLSurface::CreateViewGLSurface(handle.handle); | |
| 18 if (!surface.get()) | 22 if (!surface.get()) |
| 19 return surface; | 23 return surface; |
| 20 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( | 24 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( |
| 21 manager, stub, surface.get())); | 25 manager, stub, surface.get())); |
| 22 } | 26 } |
| 23 | 27 |
| 24 } // namespace content | 28 } // namespace content |
| OLD | NEW |