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/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 27 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
28 GpuChannelManager* manager, | 28 GpuChannelManager* manager, |
29 GpuCommandBufferStub* stub, | 29 GpuCommandBufferStub* stub, |
30 const gfx::GLSurfaceHandle& handle) { | 30 const gfx::GLSurfaceHandle& handle) { |
31 scoped_refptr<gfx::GLSurface> surface; | 31 scoped_refptr<gfx::GLSurface> surface; |
32 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) | 32 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) |
33 surface = new TextureImageTransportSurface(manager, stub, handle); | 33 surface = new TextureImageTransportSurface(manager, stub, handle); |
34 else | 34 else |
35 surface = CreateNativeSurface(manager, stub, handle); | 35 surface = CreateNativeSurface(manager, stub, handle); |
36 | 36 |
37 if (!surface || !surface->Initialize()) | 37 if (!surface.get() || !surface->Initialize()) |
38 return NULL; | 38 return NULL; |
39 return surface; | 39 return surface; |
40 } | 40 } |
41 | 41 |
42 ImageTransportHelper::ImageTransportHelper(ImageTransportSurface* surface, | 42 ImageTransportHelper::ImageTransportHelper(ImageTransportSurface* surface, |
43 GpuChannelManager* manager, | 43 GpuChannelManager* manager, |
44 GpuCommandBufferStub* stub, | 44 GpuCommandBufferStub* stub, |
45 gfx::PluginWindowHandle handle) | 45 gfx::PluginWindowHandle handle) |
46 : surface_(surface), | 46 : surface_(surface), |
47 manager_(manager), | 47 manager_(manager), |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { | 349 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { |
350 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); | 350 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); |
351 if (vsync_provider) { | 351 if (vsync_provider) { |
352 vsync_provider->GetVSyncParameters( | 352 vsync_provider->GetVSyncParameters( |
353 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, | 353 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, |
354 helper_->AsWeakPtr())); | 354 helper_->AsWeakPtr())); |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 } // namespace content | 358 } // namespace content |
OLD | NEW |