| Index: content/plugin/webplugin_proxy.cc
|
| diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc
|
| index c87aac263f99807d9089eca8fa780d1f54134eb4..090f369b5bfe935c108eb91b82ca2252c3f5cc0f 100644
|
| --- a/content/plugin/webplugin_proxy.cc
|
| +++ b/content/plugin/webplugin_proxy.cc
|
| @@ -32,10 +32,6 @@
|
| #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h"
|
| #endif
|
|
|
| -#if defined(USE_X11)
|
| -#include "ui/base/x/x11_util_internal.h"
|
| -#endif
|
| -
|
| #if defined(OS_WIN)
|
| #include "content/common/plugin_process_messages.h"
|
| #include "content/public/common/sandbox_init.h"
|
| @@ -67,36 +63,9 @@ WebPluginProxy::WebPluginProxy(
|
| windowless_buffer_index_(0),
|
| host_render_view_routing_id_(host_render_view_routing_id),
|
| weak_factory_(this) {
|
| -#if defined(USE_X11)
|
| - windowless_shm_pixmaps_[0] = None;
|
| - windowless_shm_pixmaps_[1] = None;
|
| - use_shm_pixmap_ = false;
|
| -
|
| - // If the X server supports SHM pixmaps
|
| - // and the color depth and masks match,
|
| - // then consider using SHM pixmaps for windowless plugin painting.
|
| - XDisplay* display = gfx::GetXDisplay();
|
| - if (ui::QuerySharedMemorySupport(display) == ui::SHARED_MEMORY_PIXMAP &&
|
| - gfx::BitsPerPixelForPixmapDepth(
|
| - display, DefaultDepth(display, DefaultScreen(display))) == 32) {
|
| - Visual* vis = DefaultVisual(display, DefaultScreen(display));
|
| -
|
| - if (vis->red_mask == 0xff0000 &&
|
| - vis->green_mask == 0xff00 &&
|
| - vis->blue_mask == 0xff)
|
| - use_shm_pixmap_ = true;
|
| - }
|
| -#endif
|
| }
|
|
|
| WebPluginProxy::~WebPluginProxy() {
|
| -#if defined(USE_X11)
|
| - if (windowless_shm_pixmaps_[0] != None)
|
| - XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[0]);
|
| - if (windowless_shm_pixmaps_[1] != None)
|
| - XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[1]);
|
| -#endif
|
| -
|
| #if defined(OS_MACOSX)
|
| // Destroy the surface early, since it may send messages during cleanup.
|
| if (accelerated_surface_)
|
| @@ -126,8 +95,6 @@ void WebPluginProxy::WillDestroyWindow(gfx::PluginWindowHandle window) {
|
| PluginThread::current()->Send(
|
| new PluginProcessHostMsg_PluginWindowDestroyed(
|
| window, ::GetParent(window)));
|
| -#elif defined(USE_X11)
|
| - // Nothing to do.
|
| #else
|
| NOTIMPLEMENTED();
|
| #endif
|
| @@ -384,10 +351,6 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
|
| // See above comment about windowless_context_ changing.
|
| // http::/crbug.com/139462
|
| skia::RefPtr<skia::PlatformCanvas> saved_canvas = windowless_canvas();
|
| -#if defined(USE_X11)
|
| - scoped_refptr<SharedTransportDIB> local_dib_ref(
|
| - windowless_dibs_[windowless_buffer_index_]);
|
| -#endif
|
|
|
| saved_canvas->save();
|
|
|
| @@ -437,9 +400,6 @@ void WebPluginProxy::UpdateGeometry(
|
|
|
| DCHECK(0 <= windowless_buffer_index && windowless_buffer_index <= 1);
|
| windowless_buffer_index_ = windowless_buffer_index;
|
| -#if defined(USE_X11)
|
| - delegate_->SetWindowlessShmPixmap(windowless_shm_pixmap());
|
| -#endif
|
|
|
| #if defined(OS_MACOSX)
|
| delegate_->UpdateGeometryAndContext(
|
| @@ -533,72 +493,6 @@ void WebPluginProxy::SetWindowlessBuffers(
|
| &windowless_contexts_[1]);
|
| }
|
|
|
| -#elif defined(TOOLKIT_GTK)
|
| -
|
| -void WebPluginProxy::CreateDIBAndCanvasFromHandle(
|
| - const TransportDIB::Handle& dib_handle,
|
| - const gfx::Rect& window_rect,
|
| - scoped_refptr<SharedTransportDIB>* dib_out,
|
| - skia::RefPtr<skia::PlatformCanvas>* canvas) {
|
| - TransportDIB* dib = TransportDIB::Map(dib_handle);
|
| - // dib may be NULL if the renderer has already destroyed the TransportDIB by
|
| - // the time we receive the handle, e.g. in case of multiple resizes.
|
| - if (dib) {
|
| - *canvas = skia::AdoptRef(
|
| - dib->GetPlatformCanvas(window_rect.width(), window_rect.height()));
|
| - } else {
|
| - canvas->clear();
|
| - }
|
| - *dib_out = new SharedTransportDIB(dib);
|
| -}
|
| -
|
| -void WebPluginProxy::CreateShmPixmapFromDIB(
|
| - TransportDIB* dib,
|
| - const gfx::Rect& window_rect,
|
| - XID* pixmap_out) {
|
| - if (dib) {
|
| - XDisplay* display = gfx::GetXDisplay();
|
| - XID root_window = ui::GetX11RootWindow();
|
| - XShmSegmentInfo shminfo = {0};
|
| -
|
| - if (*pixmap_out != None)
|
| - XFreePixmap(display, *pixmap_out);
|
| -
|
| - shminfo.shmseg = dib->MapToX(display);
|
| - // Create a shared memory pixmap based on the image buffer.
|
| - *pixmap_out = XShmCreatePixmap(display, root_window,
|
| - NULL, &shminfo,
|
| - window_rect.width(), window_rect.height(),
|
| - DefaultDepth(display,
|
| - DefaultScreen(display)));
|
| - }
|
| -}
|
| -
|
| -void WebPluginProxy::SetWindowlessBuffers(
|
| - const TransportDIB::Handle& windowless_buffer0,
|
| - const TransportDIB::Handle& windowless_buffer1,
|
| - const gfx::Rect& window_rect) {
|
| - CreateDIBAndCanvasFromHandle(windowless_buffer0,
|
| - window_rect,
|
| - &windowless_dibs_[0],
|
| - &windowless_canvases_[0]);
|
| - CreateDIBAndCanvasFromHandle(windowless_buffer1,
|
| - window_rect,
|
| - &windowless_dibs_[1],
|
| - &windowless_canvases_[1]);
|
| -
|
| - // If SHM pixmaps support is available, create SHM pixmaps to pass to the
|
| - // delegate for windowless plugin painting.
|
| - if (delegate_->IsWindowless() && use_shm_pixmap_) {
|
| - CreateShmPixmapFromDIB(windowless_dibs_[0]->dib(),
|
| - window_rect,
|
| - &windowless_shm_pixmaps_[0]);
|
| - CreateShmPixmapFromDIB(windowless_dibs_[1]->dib(),
|
| - window_rect,
|
| - &windowless_shm_pixmaps_[1]);
|
| - }
|
| -}
|
| -
|
| #else
|
|
|
| void WebPluginProxy::SetWindowlessBuffers(
|
|
|