| 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/mac/scoped_cftyperef.h" | 7 #include "base/mac/scoped_cftyperef.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/common/gpu/gpu_messages.h" | 9 #include "content/common/gpu/gpu_messages.h" |
| 10 #include "content/common/gpu/texture_image_transport_surface.h" | 10 #include "content/common/gpu/texture_image_transport_surface.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 bool g_allow_os_mesa = false; | 433 bool g_allow_os_mesa = false; |
| 434 | 434 |
| 435 } // namespace | 435 } // namespace |
| 436 | 436 |
| 437 // static | 437 // static |
| 438 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 438 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
| 439 GpuChannelManager* manager, | 439 GpuChannelManager* manager, |
| 440 GpuCommandBufferStub* stub, | 440 GpuCommandBufferStub* stub, |
| 441 const gfx::GLSurfaceHandle& surface_handle) { | 441 const gfx::GLSurfaceHandle& surface_handle) { |
| 442 scoped_refptr<gfx::GLSurface> surface; | 442 scoped_refptr<gfx::GLSurface> surface; |
| 443 if (surface_handle.transport_type == gfx::TEXTURE_TRANSPORT) { | 443 if (surface_handle.transport_type == gfx::TEXTURE_TRANSPORT || |
| 444 surface_handle.transport_type == |
| 445 gfx::TEXTURE_TRANSPORT_NO_PARTIAL_SWAP) { |
| 444 surface = new TextureImageTransportSurface(manager, stub, surface_handle); | 446 surface = new TextureImageTransportSurface(manager, stub, surface_handle); |
| 445 } else { | 447 } else { |
| 446 DCHECK(surface_handle.transport_type == gfx::NATIVE_TRANSPORT); | 448 DCHECK(surface_handle.transport_type == gfx::NATIVE_TRANSPORT); |
| 447 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); | 449 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); |
| 448 | 450 |
| 449 switch (gfx::GetGLImplementation()) { | 451 switch (gfx::GetGLImplementation()) { |
| 450 case gfx::kGLImplementationDesktopGL: | 452 case gfx::kGLImplementationDesktopGL: |
| 451 case gfx::kGLImplementationAppleGL: | 453 case gfx::kGLImplementationAppleGL: |
| 452 if (!io_surface_support) { | 454 if (!io_surface_support) { |
| 453 DLOG(WARNING) << "No IOSurface support"; | 455 DLOG(WARNING) << "No IOSurface support"; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 474 else | 476 else |
| 475 return NULL; | 477 return NULL; |
| 476 } | 478 } |
| 477 | 479 |
| 478 // static | 480 // static |
| 479 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { | 481 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { |
| 480 g_allow_os_mesa = allow; | 482 g_allow_os_mesa = allow; |
| 481 } | 483 } |
| 482 | 484 |
| 483 } // namespace content | 485 } // namespace content |
| OLD | NEW |