OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" | 7 #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h" |
8 | 8 |
9 #include "app/surface/accelerated_surface_mac.h" | 9 #include "app/surface/accelerated_surface_mac.h" |
10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
11 #include "chrome/plugin/webplugin_proxy.h" | 11 #include "content/plugin/webplugin_proxy.h" |
12 | 12 |
13 WebPluginAcceleratedSurfaceProxy::WebPluginAcceleratedSurfaceProxy( | 13 WebPluginAcceleratedSurfaceProxy::WebPluginAcceleratedSurfaceProxy( |
14 WebPluginProxy* plugin_proxy) | 14 WebPluginProxy* plugin_proxy) |
15 : plugin_proxy_(plugin_proxy), | 15 : plugin_proxy_(plugin_proxy), |
16 window_handle_(NULL) { | 16 window_handle_(NULL) { |
17 surface_ = new AcceleratedSurface; | 17 surface_ = new AcceleratedSurface; |
18 // It's possible for OpenGL to fail to initialze (e.g., if an incompatible | 18 // It's possible for OpenGL to fail to initialze (e.g., if an incompatible |
19 // mode is forced via flags), so handle that gracefully. | 19 // mode is forced via flags), so handle that gracefully. |
20 if (!surface_->Initialize(NULL, true)) { | 20 if (!surface_->Initialize(NULL, true)) { |
21 delete surface_; | 21 delete surface_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 void WebPluginAcceleratedSurfaceProxy::EndDrawing() { | 72 void WebPluginAcceleratedSurfaceProxy::EndDrawing() { |
73 if (!surface_) | 73 if (!surface_) |
74 return; | 74 return; |
75 | 75 |
76 surface_->SwapBuffers(); | 76 surface_->SwapBuffers(); |
77 plugin_proxy_->AcceleratedFrameBuffersDidSwap( | 77 plugin_proxy_->AcceleratedFrameBuffersDidSwap( |
78 window_handle_, surface_->GetSurfaceId()); | 78 window_handle_, surface_->GetSurfaceId()); |
79 } | 79 } |
OLD | NEW |