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

Side by Side Diff: content/plugin/webplugin_accelerated_surface_proxy_mac.cc

Issue 301973010: Remove IOSurfaceSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « content/content_common.gypi ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import <OpenGL/OpenGL.h> 5 #import <OpenGL/OpenGL.h>
6 6
7 #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h" 7 #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "content/plugin/webplugin_proxy.h" 11 #include "content/plugin/webplugin_proxy.h"
12 #include "content/public/common/content_switches.h" 12 #include "content/public/common/content_switches.h"
13 #include "ui/gl/io_surface_support_mac.h"
14 #include "ui/surface/accelerated_surface_mac.h" 13 #include "ui/surface/accelerated_surface_mac.h"
15 #include "ui/surface/transport_dib.h" 14 #include "ui/surface/transport_dib.h"
16 15
17 namespace content { 16 namespace content {
18 17
19 WebPluginAcceleratedSurfaceProxy* WebPluginAcceleratedSurfaceProxy::Create( 18 WebPluginAcceleratedSurfaceProxy* WebPluginAcceleratedSurfaceProxy::Create(
20 WebPluginProxy* plugin_proxy, 19 WebPluginProxy* plugin_proxy,
21 gfx::GpuPreference gpu_preference) { 20 gfx::GpuPreference gpu_preference) {
22 // This code path shouldn't be taken if CA plugins are disabled 21 // This code path shouldn't be taken if CA plugins are disabled
23 // because the CA drawing model shouldn't be advertised. 22 // because the CA drawing model shouldn't be advertised.
24 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( 23 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
25 switches::kDisableCoreAnimationPlugins)); 24 switches::kDisableCoreAnimationPlugins));
26 25
27 // Require IOSurface support for drawing Core Animation plugins.
28 if (!IOSurfaceSupport::Initialize())
29 return NULL;
30
31 AcceleratedSurface* surface = new AcceleratedSurface; 26 AcceleratedSurface* surface = new AcceleratedSurface;
32 // It's possible for OpenGL to fail to initialize (e.g., if an incompatible 27 // It's possible for OpenGL to fail to initialize (e.g., if an incompatible
33 // mode is forced via flags), so handle that gracefully. 28 // mode is forced via flags), so handle that gracefully.
34 if (!surface->Initialize(NULL, true, gpu_preference)) { 29 if (!surface->Initialize(NULL, true, gpu_preference)) {
35 delete surface; 30 delete surface;
36 return NULL; 31 return NULL;
37 } 32 }
38 33
39 return new WebPluginAcceleratedSurfaceProxy(plugin_proxy, surface); 34 return new WebPluginAcceleratedSurfaceProxy(plugin_proxy, surface);
40 } 35 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 73
79 void WebPluginAcceleratedSurfaceProxy::EndDrawing() { 74 void WebPluginAcceleratedSurfaceProxy::EndDrawing() {
80 if (!surface_) 75 if (!surface_)
81 return; 76 return;
82 77
83 surface_->SwapBuffers(); 78 surface_->SwapBuffers();
84 plugin_proxy_->AcceleratedPluginSwappedIOSurface(); 79 plugin_proxy_->AcceleratedPluginSwappedIOSurface();
85 } 80 }
86 81
87 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698