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_command_buffer_stub.h" | 9 #include "content/common/gpu/gpu_command_buffer_stub.h" |
10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 bool g_allow_os_mesa = false; | 509 bool g_allow_os_mesa = false; |
510 | 510 |
511 } // namespace | 511 } // namespace |
512 | 512 |
513 // static | 513 // static |
514 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( | 514 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( |
515 GpuChannelManager* manager, | 515 GpuChannelManager* manager, |
516 GpuCommandBufferStub* stub, | 516 GpuCommandBufferStub* stub, |
517 const gfx::GLSurfaceHandle& surface_handle) { | 517 const gfx::GLSurfaceHandle& surface_handle) { |
518 DCHECK(surface_handle.transport_type == gfx::NATIVE_TRANSPORT); | 518 DCHECK(surface_handle.transport_type == gfx::NATIVE_DIRECT || |
| 519 surface_handle.transport_type == gfx::NATIVE_TRANSPORT); |
519 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); | 520 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); |
520 | 521 |
521 switch (gfx::GetGLImplementation()) { | 522 switch (gfx::GetGLImplementation()) { |
522 case gfx::kGLImplementationDesktopGL: | 523 case gfx::kGLImplementationDesktopGL: |
523 case gfx::kGLImplementationAppleGL: | 524 case gfx::kGLImplementationAppleGL: |
524 if (!io_surface_support) { | 525 if (!io_surface_support) { |
525 DLOG(WARNING) << "No IOSurface support"; | 526 DLOG(WARNING) << "No IOSurface support"; |
526 return scoped_refptr<gfx::GLSurface>(); | 527 return scoped_refptr<gfx::GLSurface>(); |
527 } | 528 } |
528 return scoped_refptr<gfx::GLSurface>(new IOSurfaceImageTransportSurface( | 529 return scoped_refptr<gfx::GLSurface>(new IOSurfaceImageTransportSurface( |
(...skipping 14 matching lines...) Expand all Loading... |
543 manager, stub, surface.get())); | 544 manager, stub, surface.get())); |
544 } | 545 } |
545 } | 546 } |
546 | 547 |
547 // static | 548 // static |
548 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { | 549 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { |
549 g_allow_os_mesa = allow; | 550 g_allow_os_mesa = allow; |
550 } | 551 } |
551 | 552 |
552 } // namespace content | 553 } // namespace content |
OLD | NEW |