| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/common/gpu/gpu_surface_lookup.h" | 8 #include "content/common/gpu/gpu_surface_lookup.h" |
| 9 #include "content/common/gpu/texture_image_transport_surface.h" | 9 #include "content/common/gpu/texture_image_transport_surface.h" |
| 10 #include "ui/gl/gl_surface_egl.h" | 10 #include "ui/gl/gl_surface_egl.h" |
| 11 | 11 |
| 12 namespace content { |
| 13 |
| 12 // static | 14 // static |
| 13 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 15 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
| 14 GpuChannelManager* manager, | 16 GpuChannelManager* manager, |
| 15 GpuCommandBufferStub* stub, | 17 GpuCommandBufferStub* stub, |
| 16 const gfx::GLSurfaceHandle& handle) { | 18 const gfx::GLSurfaceHandle& handle) { |
| 17 scoped_refptr<gfx::GLSurface> surface; | 19 scoped_refptr<gfx::GLSurface> surface; |
| 18 if (!handle.handle && handle.transport) { | 20 if (!handle.handle && handle.transport) { |
| 19 DCHECK(handle.parent_client_id); | 21 DCHECK(handle.parent_client_id); |
| 20 surface = new TextureImageTransportSurface(manager, stub, handle); | 22 surface = new TextureImageTransportSurface(manager, stub, handle); |
| 21 } else if (handle.handle == gfx::kDummyPluginWindow && !handle.transport) { | 23 } else if (handle.handle == gfx::kDummyPluginWindow && !handle.transport) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 return NULL; | 36 return NULL; |
| 35 } | 37 } |
| 36 | 38 |
| 37 if (surface->Initialize()) | 39 if (surface->Initialize()) |
| 38 return surface; | 40 return surface; |
| 39 else { | 41 else { |
| 40 LOG(ERROR) << "Failed to initialize ImageTransportSurface"; | 42 LOG(ERROR) << "Failed to initialize ImageTransportSurface"; |
| 41 return NULL; | 43 return NULL; |
| 42 } | 44 } |
| 43 } | 45 } |
| 46 |
| 47 } // namespace content |
| OLD | NEW |