OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_fbo_mac.h" | 5 #include "content/common/gpu/image_transport_surface_fbo_mac.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "content/common/gpu/gpu_messages.h" | 8 #include "content/common/gpu/gpu_messages.h" |
9 #include "content/common/gpu/image_transport_surface_calayer_mac.h" | 9 #include "content/common/gpu/image_transport_surface_calayer_mac.h" |
10 #include "content/common/gpu/image_transport_surface_iosurface_mac.h" | 10 #include "content/common/gpu/image_transport_surface_iosurface_mac.h" |
| 11 #include "content/common/gpu/image_transport_surface_overlay_mac.h" |
11 #include "ui/base/cocoa/remote_layer_api.h" | 12 #include "ui/base/cocoa/remote_layer_api.h" |
12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gl/gl_context.h" | 14 #include "ui/gl/gl_context.h" |
14 #include "ui/gl/gl_implementation.h" | 15 #include "ui/gl/gl_implementation.h" |
15 #include "ui/gl/gl_surface_osmesa.h" | 16 #include "ui/gl/gl_surface_osmesa.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 scoped_refptr<gfx::GLSurface> ImageTransportSurfaceCreateNativeSurface( | 20 scoped_refptr<gfx::GLSurface> ImageTransportSurfaceCreateNativeSurface( |
20 GpuChannelManager* manager, | 21 GpuChannelManager* manager, |
21 GpuCommandBufferStub* stub, | 22 GpuCommandBufferStub* stub, |
22 gfx::PluginWindowHandle handle) { | 23 gfx::PluginWindowHandle handle) { |
23 return new ImageTransportSurfaceFBO(manager, stub, handle); | 24 if (ui::RemoteLayerAPISupported()) |
| 25 return new ImageTransportSurfaceOverlayMac(manager, stub, handle); |
| 26 else |
| 27 return new ImageTransportSurfaceFBO(manager, stub, handle); |
24 } | 28 } |
25 | 29 |
26 ImageTransportSurfaceFBO::ImageTransportSurfaceFBO( | 30 ImageTransportSurfaceFBO::ImageTransportSurfaceFBO( |
27 GpuChannelManager* manager, | 31 GpuChannelManager* manager, |
28 GpuCommandBufferStub* stub, | 32 GpuCommandBufferStub* stub, |
29 gfx::PluginWindowHandle handle) | 33 gfx::PluginWindowHandle handle) |
30 : backbuffer_suggested_allocation_(true), | 34 : backbuffer_suggested_allocation_(true), |
31 frontbuffer_suggested_allocation_(true), | 35 frontbuffer_suggested_allocation_(true), |
32 fbo_id_(0), | 36 fbo_id_(0), |
33 texture_id_(0), | 37 texture_id_(0), |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 429 } |
426 | 430 |
427 has_complete_framebuffer_ = true; | 431 has_complete_framebuffer_ = true; |
428 storage_provider_->FrameSizeChanged(pixel_size_, scale_factor_); | 432 storage_provider_->FrameSizeChanged(pixel_size_, scale_factor_); |
429 | 433 |
430 glBindTexture(texture_target, previous_texture_id); | 434 glBindTexture(texture_target, previous_texture_id); |
431 // The FBO remains bound for this GL context. | 435 // The FBO remains bound for this GL context. |
432 } | 436 } |
433 | 437 |
434 } // namespace content | 438 } // namespace content |
OLD | NEW |