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

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

Issue 8601002: base::Bind fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_thread.cc ('k') | content/plugin/webplugin_proxy.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/callback_old.h" 9 #include "base/bind.h"
10 #include "content/plugin/webplugin_proxy.h" 10 #include "content/plugin/webplugin_proxy.h"
11 #include "ui/gfx/surface/accelerated_surface_mac.h" 11 #include "ui/gfx/surface/accelerated_surface_mac.h"
12 #include "ui/gfx/surface/transport_dib.h" 12 #include "ui/gfx/surface/transport_dib.h"
13 13
14 WebPluginAcceleratedSurfaceProxy::WebPluginAcceleratedSurfaceProxy( 14 WebPluginAcceleratedSurfaceProxy::WebPluginAcceleratedSurfaceProxy(
15 WebPluginProxy* plugin_proxy, 15 WebPluginProxy* plugin_proxy,
16 gfx::GpuPreference gpu_preference) 16 gfx::GpuPreference gpu_preference)
17 : plugin_proxy_(plugin_proxy), 17 : plugin_proxy_(plugin_proxy),
18 window_handle_(NULL) { 18 window_handle_(NULL) {
19 surface_ = new AcceleratedSurface; 19 surface_ = new AcceleratedSurface;
20 // It's possible for OpenGL to fail to initialze (e.g., if an incompatible 20 // It's possible for OpenGL to fail to initialze (e.g., if an incompatible
21 // mode is forced via flags), so handle that gracefully. 21 // mode is forced via flags), so handle that gracefully.
22 if (!surface_->Initialize(NULL, true, gpu_preference)) { 22 if (!surface_->Initialize(NULL, true, gpu_preference)) {
23 delete surface_; 23 delete surface_;
24 surface_ = NULL; 24 surface_ = NULL;
25 return; 25 return;
26 } 26 }
27 27
28 // Only used for 10.5 support, but harmless on 10.6+. 28 // Only used for 10.5 support, but harmless on 10.6+.
29 surface_->SetTransportDIBAllocAndFree( 29 surface_->SetTransportDIBAllocAndFree(
30 NewCallback(plugin_proxy_, &WebPluginProxy::AllocSurfaceDIB), 30 base::Bind(&WebPluginProxy::AllocSurfaceDIB,
31 NewCallback(plugin_proxy_, &WebPluginProxy::FreeSurfaceDIB)); 31 base::Unretained(plugin_proxy)),
32 base::Bind(&WebPluginProxy::FreeSurfaceDIB,
33 base::Unretained(plugin_proxy)));
32 } 34 }
33 35
34 WebPluginAcceleratedSurfaceProxy::~WebPluginAcceleratedSurfaceProxy() { 36 WebPluginAcceleratedSurfaceProxy::~WebPluginAcceleratedSurfaceProxy() {
35 if (surface_) { 37 if (surface_) {
36 surface_->Destroy(); 38 surface_->Destroy();
37 delete surface_; 39 delete surface_;
38 surface_ = NULL; 40 surface_ = NULL;
39 } 41 }
40 } 42 }
41 43
(...skipping 30 matching lines...) Expand all
72 } 74 }
73 75
74 void WebPluginAcceleratedSurfaceProxy::EndDrawing() { 76 void WebPluginAcceleratedSurfaceProxy::EndDrawing() {
75 if (!surface_) 77 if (!surface_)
76 return; 78 return;
77 79
78 surface_->SwapBuffers(); 80 surface_->SwapBuffers();
79 plugin_proxy_->AcceleratedFrameBuffersDidSwap( 81 plugin_proxy_->AcceleratedFrameBuffersDidSwap(
80 window_handle_, surface_->GetSurfaceId()); 82 window_handle_, surface_->GetSurfaceId());
81 } 83 }
OLDNEW
« no previous file with comments | « content/plugin/plugin_thread.cc ('k') | content/plugin/webplugin_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698