diff options
Diffstat (limited to 'chrome/browser/renderer_host')
11 files changed, 143 insertions, 137 deletions
diff --git a/chrome/browser/renderer_host/gpu_plugin_container_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc index a2b69f4..66e8b4c 100644 --- a/chrome/browser/renderer_host/gpu_plugin_container_mac.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/renderer_host/gpu_plugin_container_mac.h" +#include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" #include "base/logging.h" -#include "chrome/browser/renderer_host/gpu_plugin_container_manager_mac.h" -#include "chrome/common/io_surface_support_mac.h" #include "webkit/glue/webplugin.h" +#include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h" +#include "chrome/common/io_surface_support_mac.h" -MacGPUPluginContainer::MacGPUPluginContainer() +AcceleratedSurfaceContainerMac::AcceleratedSurfaceContainerMac() : x_(0), y_(0), surface_(NULL), @@ -18,22 +18,22 @@ MacGPUPluginContainer::MacGPUPluginContainer() texture_(0) { } -MacGPUPluginContainer::~MacGPUPluginContainer() { +AcceleratedSurfaceContainerMac::~AcceleratedSurfaceContainerMac() { ReleaseIOSurface(); } -void MacGPUPluginContainer::ReleaseIOSurface() { +void AcceleratedSurfaceContainerMac::ReleaseIOSurface() { if (surface_) { CFRelease(surface_); surface_ = NULL; } } -void MacGPUPluginContainer::SetSizeAndIOSurface( +void AcceleratedSurfaceContainerMac::SetSizeAndIOSurface( int32 width, int32 height, uint64 io_surface_identifier, - MacGPUPluginContainerManager* manager) { + AcceleratedSurfaceContainerManagerMac* manager) { ReleaseIOSurface(); IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); if (io_surface_support) { @@ -45,11 +45,11 @@ void MacGPUPluginContainer::SetSizeAndIOSurface( } } -void MacGPUPluginContainer::SetSizeAndTransportDIB( +void AcceleratedSurfaceContainerMac::SetSizeAndTransportDIB( int32 width, int32 height, TransportDIB::Handle transport_dib, - MacGPUPluginContainerManager* manager) { + AcceleratedSurfaceContainerManagerMac* manager) { if (TransportDIB::is_valid(transport_dib)) { transport_dib_.reset(TransportDIB::Map(transport_dib)); EnqueueTextureForDeletion(manager); @@ -58,7 +58,7 @@ void MacGPUPluginContainer::SetSizeAndTransportDIB( } } -void MacGPUPluginContainer::MoveTo( +void AcceleratedSurfaceContainerMac::MoveTo( const webkit_glue::WebPluginGeometry& geom) { x_ = geom.window_rect.x(); y_ = geom.window_rect.y(); @@ -66,7 +66,7 @@ void MacGPUPluginContainer::MoveTo( clipRect_ = geom.clip_rect; } -void MacGPUPluginContainer::Draw(CGLContextObj context) { +void AcceleratedSurfaceContainerMac::Draw(CGLContextObj context) { IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); GLenum target = GL_TEXTURE_RECTANGLE_ARB; if (!texture_) { @@ -150,8 +150,8 @@ void MacGPUPluginContainer::Draw(CGLContextObj context) { } } -void MacGPUPluginContainer::EnqueueTextureForDeletion( - MacGPUPluginContainerManager* manager) { +void AcceleratedSurfaceContainerMac::EnqueueTextureForDeletion( + AcceleratedSurfaceContainerManagerMac* manager) { manager->EnqueueTextureForDeletion(texture_); texture_ = 0; } diff --git a/chrome/browser/renderer_host/gpu_plugin_container_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_mac.h index b985147..d9a7495 100644 --- a/chrome/browser/renderer_host/gpu_plugin_container_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.h @@ -23,7 +23,7 @@ // does not have an on-screen window. // // This class encapsulates some of the management of these data -// structures, in conjunction with the MacGPUPluginContainerManager. +// structures, in conjunction with the AcceleratedSurfaceContainerManagerMac. #include <CoreFoundation/CoreFoundation.h> #include <OpenGL/OpenGL.h> @@ -38,44 +38,41 @@ namespace webkit_glue { struct WebPluginGeometry; } -class MacGPUPluginContainerManager; +class AcceleratedSurfaceContainerManagerMac; -class MacGPUPluginContainer { +class AcceleratedSurfaceContainerMac { public: - MacGPUPluginContainer(); - virtual ~MacGPUPluginContainer(); + AcceleratedSurfaceContainerMac(); + virtual ~AcceleratedSurfaceContainerMac(); - // Sets the backing store and size of this plugin container. There are two - // versions: the IOSurface version is used on systems where the IOSurface - // API is supported (Mac OS X 10.6 and later); the TransportDIB is used on - // Mac OS X 10.5 and earlier. + // Sets the backing store and size of this accelerated surface container. + // There are two versions: the IOSurface version is used on systems where the + // IOSurface API is supported (Mac OS X 10.6 and later); the TransportDIB is + // used on Mac OS X 10.5 and earlier. void SetSizeAndIOSurface(int32 width, int32 height, uint64 io_surface_identifier, - MacGPUPluginContainerManager* manager); + AcceleratedSurfaceContainerManagerMac* manager); void SetSizeAndTransportDIB(int32 width, int32 height, TransportDIB::Handle transport_dib, - MacGPUPluginContainerManager* manager); + AcceleratedSurfaceContainerManagerMac* manager); - // Tells the plugin container that it has moved relative to the + // Tells the accelerated surface container that it has moved relative to the // origin of the window, for example because of a scroll event. void MoveTo(const webkit_glue::WebPluginGeometry& geom); - // Draws this plugin's contents, texture mapped onto a quad in the - // given OpenGL context. TODO(kbr): figure out and define exactly - // how the coordinate system will work out. + // Draws this accelerated surface's contents, texture mapped onto a quad in + // the given OpenGL context. TODO(kbr): figure out and define exactly how the + // coordinate system will work out. void Draw(CGLContextObj context); // Enqueue our texture for later deletion. Call this before deleting // this object. - void EnqueueTextureForDeletion(MacGPUPluginContainerManager* manager); + void EnqueueTextureForDeletion( + AcceleratedSurfaceContainerManagerMac* manager); private: - // We currently only have a viable implementation of this class on - // Snow Leopard. We need to think about fallback strategies that - // will work on Leopard. - // The x and y coordinates of the plugin window on the web page. int x_; int y_; @@ -107,7 +104,7 @@ class MacGPUPluginContainer { // with it. GLuint texture_; - DISALLOW_COPY_AND_ASSIGN(MacGPUPluginContainer); + DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); }; #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ diff --git a/chrome/browser/renderer_host/gpu_plugin_container_manager_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc index 8eae393..f7c39e5 100644 --- a/chrome/browser/renderer_host/gpu_plugin_container_manager_mac.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc @@ -2,63 +2,64 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/renderer_host/gpu_plugin_container_manager_mac.h" +#include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h" #include "base/logging.h" -#include "chrome/browser/renderer_host/gpu_plugin_container_mac.h" +#include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" #include "webkit/glue/webplugin.h" -MacGPUPluginContainerManager::MacGPUPluginContainerManager() +AcceleratedSurfaceContainerManagerMac::AcceleratedSurfaceContainerManagerMac() : current_id_(0) { } gfx::PluginWindowHandle -MacGPUPluginContainerManager::AllocateFakePluginWindowHandle() { - MacGPUPluginContainer* container = new MacGPUPluginContainer(); +AcceleratedSurfaceContainerManagerMac::AllocateFakePluginWindowHandle() { + AcceleratedSurfaceContainerMac* container = + new AcceleratedSurfaceContainerMac(); gfx::PluginWindowHandle res = static_cast<gfx::PluginWindowHandle>(++current_id_); plugin_window_to_container_map_.insert(std::make_pair(res, container)); return res; } -void MacGPUPluginContainerManager::DestroyFakePluginWindowHandle( +void AcceleratedSurfaceContainerManagerMac::DestroyFakePluginWindowHandle( gfx::PluginWindowHandle id) { - MacGPUPluginContainer* container = MapIDToContainer(id); + AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); if (container) delete container; plugin_window_to_container_map_.erase(id); } -void MacGPUPluginContainerManager::SetSizeAndIOSurface( +void AcceleratedSurfaceContainerManagerMac::SetSizeAndIOSurface( gfx::PluginWindowHandle id, int32 width, int32 height, uint64 io_surface_identifier) { - MacGPUPluginContainer* container = MapIDToContainer(id); + AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); if (container) container->SetSizeAndIOSurface(width, height, io_surface_identifier, this); } -void MacGPUPluginContainerManager::SetSizeAndTransportDIB( +void AcceleratedSurfaceContainerManagerMac::SetSizeAndTransportDIB( gfx::PluginWindowHandle id, int32 width, int32 height, TransportDIB::Handle transport_dib) { - MacGPUPluginContainer* container = MapIDToContainer(id); + AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); if (container) container->SetSizeAndTransportDIB(width, height, transport_dib, this); } -void MacGPUPluginContainerManager::MovePluginContainer( +void AcceleratedSurfaceContainerManagerMac::MovePluginContainer( const webkit_glue::WebPluginGeometry& move) { - MacGPUPluginContainer* container = MapIDToContainer(move.window); + AcceleratedSurfaceContainerMac* container = MapIDToContainer(move.window); if (container) container->MoveTo(move); } -void MacGPUPluginContainerManager::Draw(CGLContextObj context) { +void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context) { glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -68,7 +69,7 @@ void MacGPUPluginContainerManager::Draw(CGLContextObj context) { for (PluginWindowToContainerMap::const_iterator i = plugin_window_to_container_map_.begin(); i != plugin_window_to_container_map_.end(); ++i) { - MacGPUPluginContainer* container = i->second; + AcceleratedSurfaceContainerMac* container = i->second; container->Draw(context); } @@ -80,14 +81,16 @@ void MacGPUPluginContainerManager::Draw(CGLContextObj context) { glFlush(); } -void MacGPUPluginContainerManager::EnqueueTextureForDeletion(GLuint texture) { +void AcceleratedSurfaceContainerManagerMac::EnqueueTextureForDeletion( + GLuint texture) { if (texture) { textures_pending_deletion_.push_back(texture); } } -MacGPUPluginContainer* MacGPUPluginContainerManager::MapIDToContainer( - gfx::PluginWindowHandle id) { +AcceleratedSurfaceContainerMac* + AcceleratedSurfaceContainerManagerMac::MapIDToContainer( + gfx::PluginWindowHandle id) { PluginWindowToContainerMap::const_iterator i = plugin_window_to_container_map_.find(id); if (i != plugin_window_to_container_map_.end()) @@ -97,4 +100,3 @@ MacGPUPluginContainer* MacGPUPluginContainerManager::MapIDToContainer( return NULL; } - diff --git a/chrome/browser/renderer_host/gpu_plugin_container_manager_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h index 89e8620..95bf054 100644 --- a/chrome/browser/renderer_host/gpu_plugin_container_manager_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h @@ -17,13 +17,13 @@ namespace webkit_glue { struct WebPluginGeometry; } -class MacGPUPluginContainer; +class AcceleratedSurfaceContainerMac; // Helper class that manages the backing store and on-screen rendering // of instances of the GPU plugin on the Mac. -class MacGPUPluginContainerManager { +class AcceleratedSurfaceContainerManagerMac { public: - MacGPUPluginContainerManager(); + AcceleratedSurfaceContainerManagerMac(); // Allocates a new "fake" PluginWindowHandle, which is used as the // key for the other operations. @@ -37,9 +37,9 @@ class MacGPUPluginContainerManager { // API is supported (Mac OS X 10.6 and later); the TransportDIB is used on // Mac OS X 10.5 and earlier. void SetSizeAndIOSurface(gfx::PluginWindowHandle id, - int32 width, - int32 height, - uint64 io_surface_identifier); + int32 width, + int32 height, + uint64 io_surface_identifier); void SetSizeAndTransportDIB(gfx::PluginWindowHandle id, int32 width, int32 height, @@ -61,17 +61,17 @@ class MacGPUPluginContainerManager { uint32 current_id_; // Maps a "fake" plugin window handle to the corresponding container. - MacGPUPluginContainer* MapIDToContainer(gfx::PluginWindowHandle id); + AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id); // A map that associates plugin window handles with their containers. - typedef std::map<gfx::PluginWindowHandle, MacGPUPluginContainer*> + typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> PluginWindowToContainerMap; PluginWindowToContainerMap plugin_window_to_container_map_; // A list of OpenGL textures waiting to be deleted std::vector<GLuint> textures_pending_deletion_; - DISALLOW_COPY_AND_ASSIGN(MacGPUPluginContainerManager); + DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); }; #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 2bee3e6..e1e69ea 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -151,17 +151,16 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) - // The following messages are only used on 10.6 and later IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, OnAllocateFakePluginWindowHandle) IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyFakePluginWindowHandle, OnDestroyFakePluginWindowHandle) - IPC_MESSAGE_HANDLER(ViewHostMsg_GPUPluginSetIOSurface, - OnGPUPluginSetIOSurface) - IPC_MESSAGE_HANDLER(ViewHostMsg_GPUPluginSetTransportDIB, - OnGPUPluginSetTransportDIB) - IPC_MESSAGE_HANDLER(ViewHostMsg_GPUPluginBuffersSwapped, - OnGPUPluginBuffersSwapped) + IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetIOSurface, + OnAcceleratedSurfaceSetIOSurface) + IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, + OnAcceleratedSurfaceSetTransportDIB) + IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, + OnAcceleratedSurfaceBuffersSwapped) #endif IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP_EX() @@ -940,29 +939,31 @@ void RenderWidgetHost::OnDestroyFakePluginWindowHandle( } } -void RenderWidgetHost::OnGPUPluginSetIOSurface(gfx::PluginWindowHandle window, - int32 width, - int32 height, - uint64 mach_port) { +void RenderWidgetHost::OnAcceleratedSurfaceSetIOSurface( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + uint64 mach_port) { if (view_) { - view_->GPUPluginSetIOSurface(window, width, height, mach_port); + view_->AcceleratedSurfaceSetIOSurface(window, width, height, mach_port); } } -void RenderWidgetHost::OnGPUPluginSetTransportDIB( +void RenderWidgetHost::OnAcceleratedSurfaceSetTransportDIB( gfx::PluginWindowHandle window, int32 width, int32 height, TransportDIB::Handle transport_dib) { if (view_) { - view_->GPUPluginSetTransportDIB(window, width, height, transport_dib); + view_->AcceleratedSurfaceSetTransportDIB(window, width, height, + transport_dib); } } -void RenderWidgetHost::OnGPUPluginBuffersSwapped( +void RenderWidgetHost::OnAcceleratedSurfaceBuffersSwapped( gfx::PluginWindowHandle window) { if (view_) { - view_->GPUPluginBuffersSwapped(window); + view_->AcceleratedSurfaceBuffersSwapped(window); } } #endif diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 235a6f4..35b7851 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -458,18 +458,17 @@ class RenderWidgetHost : public IPC::Channel::Listener, WebKit::WebScreenInfo* results); void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); - // The following handlers are only used on 10.6 and later void OnAllocateFakePluginWindowHandle(gfx::PluginWindowHandle* id); void OnDestroyFakePluginWindowHandle(gfx::PluginWindowHandle id); - void OnGPUPluginSetIOSurface(gfx::PluginWindowHandle window, - int32 width, - int32 height, - uint64 mach_port); - void OnGPUPluginSetTransportDIB(gfx::PluginWindowHandle window, - int32 width, - int32 height, - TransportDIB::Handle transport_dib); - void OnGPUPluginBuffersSwapped(gfx::PluginWindowHandle window); + void OnAcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, + int32 width, + int32 height, + uint64 mach_port); + void OnAcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); + void OnAcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); #endif // Paints the given bitmap to the current backing store at the given location. diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index 339c6aa..b98351a 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -184,21 +184,24 @@ class RenderWidgetHostView { // Informs the view that its containing window's frame changed. virtual void WindowFrameChanged() = 0; - // Methods associated with GPU plugin instances + // Methods associated with GPU-accelerated plug-in instances. virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle() = 0; virtual void DestroyFakePluginWindowHandle( gfx::PluginWindowHandle window) = 0; - virtual void GPUPluginSetIOSurface(gfx::PluginWindowHandle window, - int32 width, - int32 height, - uint64 io_surface_identifier) = 0; - virtual void GPUPluginSetTransportDIB(gfx::PluginWindowHandle window, - int32 width, - int32 height, - TransportDIB::Handle transport_dib) = 0; - virtual void GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) = 0; - // Draws the current GPU plugin instances into the given context. - virtual void DrawGPUPluginInstances(CGLContextObj context) = 0; + virtual void AcceleratedSurfaceSetIOSurface( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + uint64 io_surface_identifier) = 0; + virtual void AcceleratedSurfaceSetTransportDIB( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib) = 0; + virtual void AcceleratedSurfaceBuffersSwapped( + gfx::PluginWindowHandle window) = 0; + // Draws the current GPU-accelerated plug-in instances into the given context. + virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context) = 0; #endif #if defined(OS_LINUX) diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h index 6433653..f95a418 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.h +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h @@ -13,7 +13,7 @@ #include "base/task.h" #include "base/time.h" #include "chrome/browser/cocoa/base_view.h" -#include "chrome/browser/renderer_host/gpu_plugin_container_manager_mac.h" +#include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webmenuitem.h" @@ -123,20 +123,21 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { virtual void SetBackground(const SkBitmap& background); virtual bool ContainsNativeView(gfx::NativeView native_view) const; - // Methods associated with GPU plugin instances + // Methods associated with GPU-accelerated plug-in instances. virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(); virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); - virtual void GPUPluginSetIOSurface(gfx::PluginWindowHandle window, - int32 width, - int32 height, - uint64 io_surface_identifier); - virtual void GPUPluginSetTransportDIB(gfx::PluginWindowHandle window, - int32 width, - int32 height, - TransportDIB::Handle transport_dib); - virtual void GPUPluginBuffersSwapped(gfx::PluginWindowHandle window); - // Draws the current GPU plugin instances into the given context. - virtual void DrawGPUPluginInstances(CGLContextObj context); + virtual void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, + int32 width, + int32 height, + uint64 io_surface_identifier); + virtual void AcceleratedSurfaceSetTransportDIB( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); + virtual void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); + // Draws the current GPU-accelerated plug-in instances into the given context. + virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context); virtual void SetVisuallyDeemphasized(bool deemphasized); void KillSelf(); @@ -250,8 +251,8 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { // Used for positioning a popup menu. BaseView* parent_view_; - // Helper class for managing instances of the GPU plugin. - MacGPUPluginContainerManager plugin_container_manager_; + // Helper class for managing instances of accelerated plug-ins. + AcceleratedSurfaceContainerManagerMac plugin_container_manager_; DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); }; diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index 0d20f6b..40e9c66 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -59,8 +59,8 @@ const size_t kMaxTooltipLength = 1024; // GPUPluginLayer -------------------------------------------------------------- -// This subclass of CAOpenGLLayer hosts the output of the GPU plugins -// on the page. +// This subclass of CAOpenGLLayer hosts the output of the GPU-accelerated +// plugins on the page. @interface GPUPluginLayer : CAOpenGLLayer { RenderWidgetHostViewMac* renderWidgetHostView_; // weak @@ -82,7 +82,7 @@ const size_t kMaxTooltipLength = 1024; pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp { - renderWidgetHostView_->DrawGPUPluginInstances(glContext); + renderWidgetHostView_->DrawAcceleratedSurfaceInstances(glContext); [super drawInCGLContext:glContext pixelFormat:pixelFormat forLayerTime:timeInterval @@ -546,7 +546,7 @@ void RenderWidgetHostViewMac::DestroyFakePluginWindowHandle( plugin_container_manager_.DestroyFakePluginWindowHandle(window); } -void RenderWidgetHostViewMac::GPUPluginSetIOSurface( +void RenderWidgetHostViewMac::AcceleratedSurfaceSetIOSurface( gfx::PluginWindowHandle window, int32 width, int32 height, @@ -557,7 +557,7 @@ void RenderWidgetHostViewMac::GPUPluginSetIOSurface( io_surface_identifier); } -void RenderWidgetHostViewMac::GPUPluginSetTransportDIB( +void RenderWidgetHostViewMac::AcceleratedSurfaceSetTransportDIB( gfx::PluginWindowHandle window, int32 width, int32 height, @@ -568,12 +568,13 @@ void RenderWidgetHostViewMac::GPUPluginSetTransportDIB( transport_dib); } -void RenderWidgetHostViewMac::GPUPluginBuffersSwapped( +void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( gfx::PluginWindowHandle window) { [gpu_plugin_layer_.get() setNeedsDisplay]; } -void RenderWidgetHostViewMac::DrawGPUPluginInstances(CGLContextObj context) { +void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstances( + CGLContextObj context) { CGLSetCurrentContext(context); gfx::Rect rect = GetWindowRect(); glMatrixMode(GL_PROJECTION); diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc index 1269c7b..275576c 100644 --- a/chrome/browser/renderer_host/test/test_render_view_host.cc +++ b/chrome/browser/renderer_host/test/test_render_view_host.cc @@ -107,25 +107,26 @@ void TestRenderWidgetHostView::DestroyFakePluginWindowHandle( gfx::PluginWindowHandle window) { } -void TestRenderWidgetHostView::GPUPluginSetIOSurface( +void TestRenderWidgetHostView::AcceleratedSurfaceSetIOSurface( gfx::PluginWindowHandle window, int32 width, int32 height, uint64 io_surface_identifier) { } -void TestRenderWidgetHostView::GPUPluginSetTransportDIB( +void TestRenderWidgetHostView::AcceleratedSurfaceSetTransportDIB( gfx::PluginWindowHandle window, int32 width, int32 height, TransportDIB::Handle transport_dib) { } -void TestRenderWidgetHostView::GPUPluginBuffersSwapped( +void TestRenderWidgetHostView::AcceleratedSurfaceBuffersSwapped( gfx::PluginWindowHandle window) { } -void TestRenderWidgetHostView::DrawGPUPluginInstances(CGLContextObj context) { +void TestRenderWidgetHostView::DrawAcceleratedSurfaceInstances( + CGLContextObj context) { } #endif diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h index 2d8025b..3939ad9 100644 --- a/chrome/browser/renderer_host/test/test_render_view_host.h +++ b/chrome/browser/renderer_host/test/test_render_view_host.h @@ -82,16 +82,17 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { virtual void WindowFrameChanged() {} virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(); virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); - virtual void GPUPluginSetIOSurface(gfx::PluginWindowHandle window, - int32 width, - int32 height, - uint64 io_surface_identifier); - virtual void GPUPluginSetTransportDIB(gfx::PluginWindowHandle window, - int32 width, - int32 height, - TransportDIB::Handle transport_dib); - virtual void GPUPluginBuffersSwapped(gfx::PluginWindowHandle window); - virtual void DrawGPUPluginInstances(CGLContextObj context); + virtual void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, + int32 width, + int32 height, + uint64 io_surface_identifier); + virtual void AcceleratedSurfaceSetTransportDIB( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); + virtual void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); + virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context); #endif virtual void SetVisuallyDeemphasized(bool deemphasized) { } |