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

Unified Diff: chrome/plugin/webplugin_accelerated_surface_proxy_mac.cc

Issue 6672048: Move plugin code to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/plugin/webplugin_accelerated_surface_proxy_mac.h ('k') | chrome/plugin/webplugin_delegate_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/webplugin_accelerated_surface_proxy_mac.cc
===================================================================
--- chrome/plugin/webplugin_accelerated_surface_proxy_mac.cc (revision 78372)
+++ chrome/plugin/webplugin_accelerated_surface_proxy_mac.cc (working copy)
@@ -1,79 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import <OpenGL/OpenGL.h>
-
-#include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h"
-
-#include "app/surface/accelerated_surface_mac.h"
-#include "app/surface/transport_dib.h"
-#include "chrome/plugin/webplugin_proxy.h"
-
-WebPluginAcceleratedSurfaceProxy::WebPluginAcceleratedSurfaceProxy(
- WebPluginProxy* plugin_proxy)
- : plugin_proxy_(plugin_proxy),
- window_handle_(NULL) {
- surface_ = new AcceleratedSurface;
- // It's possible for OpenGL to fail to initialze (e.g., if an incompatible
- // mode is forced via flags), so handle that gracefully.
- if (!surface_->Initialize(NULL, true)) {
- delete surface_;
- surface_ = NULL;
- return;
- }
-
- // Only used for 10.5 support, but harmless on 10.6+.
- surface_->SetTransportDIBAllocAndFree(
- NewCallback(plugin_proxy_, &WebPluginProxy::AllocSurfaceDIB),
- NewCallback(plugin_proxy_, &WebPluginProxy::FreeSurfaceDIB));
-}
-
-WebPluginAcceleratedSurfaceProxy::~WebPluginAcceleratedSurfaceProxy() {
- if (surface_) {
- surface_->Destroy();
- delete surface_;
- surface_ = NULL;
- }
-}
-
-void WebPluginAcceleratedSurfaceProxy::SetWindowHandle(
- gfx::PluginWindowHandle window) {
- window_handle_ = window;
-}
-
-void WebPluginAcceleratedSurfaceProxy::SetSize(const gfx::Size& size) {
- if (!surface_)
- return;
-
- uint64 io_surface_id = surface_->SetSurfaceSize(size);
- if (io_surface_id) {
- plugin_proxy_->SetAcceleratedSurface(window_handle_, size, io_surface_id);
- } else {
- TransportDIB::Handle transport_dib = surface_->SetTransportDIBSize(size);
- if (TransportDIB::is_valid(transport_dib)) {
- plugin_proxy_->SetAcceleratedDIB(window_handle_, size, transport_dib);
- }
- }
-}
-
-CGLContextObj WebPluginAcceleratedSurfaceProxy::context() {
- return surface_ ? surface_->context() : NULL;
-}
-
-void WebPluginAcceleratedSurfaceProxy::StartDrawing() {
- if (!surface_)
- return;
-
- surface_->MakeCurrent();
- surface_->Clear(gfx::Rect(surface_->GetSize()));
-}
-
-void WebPluginAcceleratedSurfaceProxy::EndDrawing() {
- if (!surface_)
- return;
-
- surface_->SwapBuffers();
- plugin_proxy_->AcceleratedFrameBuffersDidSwap(
- window_handle_, surface_->GetSurfaceId());
-}
« no previous file with comments | « chrome/plugin/webplugin_accelerated_surface_proxy_mac.h ('k') | chrome/plugin/webplugin_delegate_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698