| 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/command_line.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | |
| 10 #include "content/common/gpu/gpu_channel_manager.h" | |
| 11 #include "content/common/gpu/gpu_command_buffer_stub.h" | |
| 12 #include "content/common/gpu/gpu_surface_lookup.h" | 8 #include "content/common/gpu/gpu_surface_lookup.h" |
| 13 #include "content/common/gpu/pass_through_image_transport_surface.h" | 9 #include "content/common/gpu/pass_through_image_transport_surface.h" |
| 14 #include "content/public/common/content_switches.h" | |
| 15 #include "ui/gl/gl_surface_egl.h" | 10 #include "ui/gl/gl_surface_egl.h" |
| 16 | 11 |
| 17 namespace content { | 12 namespace content { |
| 18 | 13 |
| 19 // static | 14 // static |
| 20 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 15 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
| 21 GpuChannelManager* manager, | 16 GpuChannelManager* manager, |
| 22 GpuCommandBufferStub* stub, | 17 GpuCommandBufferStub* stub, |
| 23 gpu::SurfaceHandle surface_handle, | 18 gpu::SurfaceHandle surface_handle, |
| 24 gfx::GLSurface::Format format) { | 19 gfx::GLSurface::Format format) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 bool initialize_success = surface->Initialize(format); | 32 bool initialize_success = surface->Initialize(format); |
| 38 ANativeWindow_release(window); | 33 ANativeWindow_release(window); |
| 39 if (!initialize_success) | 34 if (!initialize_success) |
| 40 return scoped_refptr<gfx::GLSurface>(); | 35 return scoped_refptr<gfx::GLSurface>(); |
| 41 | 36 |
| 42 return scoped_refptr<gfx::GLSurface>( | 37 return scoped_refptr<gfx::GLSurface>( |
| 43 new PassThroughImageTransportSurface(manager, stub, surface.get())); | 38 new PassThroughImageTransportSurface(manager, stub, surface.get())); |
| 44 } | 39 } |
| 45 | 40 |
| 46 } // namespace content | 41 } // namespace content |
| OLD | NEW |