Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: content/common/gpu/image_transport_surface_fbo_mac.mm

Issue 1251783002: Mac Overlays: Wire up overlays on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@part22
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698