diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 14:55:40 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 14:55:40 +0000 |
commit | 1cf99aa4097c941fbd3295eee277b40a947978df (patch) | |
tree | 1ea1af795f6e5214870ba5ff463316b558e2e0ad | |
parent | 5a9299c645bfa4fcbbc3b3106af2837e2b9f7ec1 (diff) | |
download | chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.zip chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.tar.gz chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.tar.bz2 |
Revert 90511 - Use pixmaps and EGLImages to transport image data between GPU process and browser. Behind a compile TOUCH_UI flag.
It uses the MAC OSX AcceleratedSurface IPCs to communicate between the GPU process and browser. The major difference between the OSX display path is that I send an ACK back after AcceleratedSurfaceSetIOSurface because the process of binding a texture to the pixmap may destroy the contents of the pixmap.
BUG=none
TEST=by hand on Linux (w/ and w/o TOUCH_UI), Windows, and Mac
Review URL: http://codereview.chromium.org/6987014
TBR=backer@chromium.org
Review URL: http://codereview.chromium.org/7261016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90512 0039d316-1c4b-4281-b951-d872f2087c98
26 files changed, 44 insertions, 600 deletions
diff --git a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc b/chrome/browser/renderer_host/accelerated_surface_container_touch.cc deleted file mode 100644 index 6e0560fc..0000000 --- a/chrome/browser/renderer_host/accelerated_surface_container_touch.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 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. - -#include "accelerated_surface_container_touch.h" - -#include "third_party/angle/include/EGL/egl.h" -#include "third_party/angle/include/EGL/eglext.h" -#include "ui/gfx/gl/gl_bindings.h" -#include "ui/gfx/gl/gl_surface_egl.h" - -AcceleratedSurfaceContainerTouch::AcceleratedSurfaceContainerTouch( - uint64 surface_handle) - : image_(NULL), - texture_(0) { - image_ = eglCreateImageKHR( - gfx::GLSurfaceEGL::GetDisplay(), EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, (void*) surface_handle, NULL); - - glGenTextures(1, &texture_); - - glBindTexture(GL_TEXTURE_2D, texture_); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image_); -} - -AcceleratedSurfaceContainerTouch::~AcceleratedSurfaceContainerTouch() { - glDeleteTextures(1, &texture_); - eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); -} diff --git a/chrome/browser/renderer_host/accelerated_surface_container_touch.h b/chrome/browser/renderer_host/accelerated_surface_container_touch.h deleted file mode 100644 index 5bce137..0000000 --- a/chrome/browser/renderer_host/accelerated_surface_container_touch.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2011 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. - -#ifndef CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ -#define CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ -#pragma once - -#include "base/basictypes.h" -#include "base/memory/ref_counted.h" - -// Helper class for storing image data from the GPU process renderered -// on behalf of the RWHVV. It assumes that GL context that will display -// the image data is current when an instance of this object is created -// or destroyed. -class AcceleratedSurfaceContainerTouch - : public base::RefCounted<AcceleratedSurfaceContainerTouch> { - public: - explicit AcceleratedSurfaceContainerTouch(uint64 surface_handle); - uint32 texture() const { return texture_; } - private: - friend class base::RefCounted<AcceleratedSurfaceContainerTouch>; - - ~AcceleratedSurfaceContainerTouch(); - - void* image_; - uint32 texture_; - DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerTouch); -}; - -#endif // CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index 658ab9c..f4c9c42 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -29,10 +29,6 @@ #include "views/ime/input_method.h" #include "views/widget/widget.h" -#if defined(TOUCH_UI) -#include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" -#endif - static const int kMaxWindowWidth = 4000; static const int kMaxWindowHeight = 4000; @@ -570,7 +566,7 @@ views::View* RenderWidgetHostViewViews::GetOwnerViewOfTextInputClient() { } void RenderWidgetHostViewViews::OnPaint(gfx::Canvas* canvas) { - if (is_hidden_ || !host_ || host_->is_accelerated_compositing_active()) + if (is_hidden_ || !host_) return; // Paint a "hole" in the canvas so that the render of the web page is on @@ -580,6 +576,11 @@ void RenderWidgetHostViewViews::OnPaint(gfx::Canvas* canvas) { bounds().width(), bounds().height(), SkXfermode::kClear_Mode); + // Don't do any painting if the GPU process is rendering directly + // into the View. + if (host_->is_accelerated_compositing_active()) + return; + #if defined(TOOLKIT_USES_GTK) GdkWindow* window = GetInnerNativeView()->window; #endif diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.h b/chrome/browser/renderer_host/render_widget_host_view_views.h index 9d9b1e8..bee05a1 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.h +++ b/chrome/browser/renderer_host/render_widget_host_view_views.h @@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/time.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" @@ -25,7 +25,6 @@ namespace ui { enum TouchStatus; } -class AcceleratedSurfaceContainerTouch; #endif class RenderWidgetHost; @@ -144,13 +143,6 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, base::i18n::TextDirection direction) OVERRIDE; virtual views::View* GetOwnerViewOfTextInputClient() OVERRIDE; -#if defined(TOUCH_UI) - virtual void AcceleratedSurfaceSetIOSurface( - int32 width, int32 height, uint64 surface_id) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped(uint64 surface_id) OVERRIDE; - virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE; -#endif - protected: // Overridden from RenderWidgetHostView / views::View. virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; @@ -235,11 +227,6 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, // Indicates if there is onging composition text. bool has_composition_text_; -#if defined(TOUCH_UI) - std::map<uint64, scoped_refptr<AcceleratedSurfaceContainerTouch> > - accelerated_surface_containers_; -#endif - DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); }; diff --git a/chrome/browser/renderer_host/render_widget_host_view_views_touch.cc b/chrome/browser/renderer_host/render_widget_host_view_views_touch.cc index eb8a0fd..2218a3a 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views_touch.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views_touch.cc @@ -5,7 +5,6 @@ #include "chrome/browser/renderer_host/render_widget_host_view_views.h" #include "base/logging.h" -#include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" #include "content/browser/renderer_host/render_widget_host.h" #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" @@ -188,26 +187,3 @@ RenderWidgetHostView* return reinterpret_cast<RenderWidgetHostView*>(user_data); } -void RenderWidgetHostViewViews::AcceleratedSurfaceSetIOSurface( - int32 width, int32 height, uint64 surface_id) { - // TODO(backer): Currently NO-OPed. Should eventually be something like: - - // context_->MakeCurrent(surface_.get()); - // accelerated_surface_containers_[surface_id] = - // new AcceleratedSurfaceContainer(surface_id); - // glFlush(); -} - -void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( - uint64 surface_id) { - // TODO(backer): Currently NO-OPed. Will eventually tie into the - // browser compositor. -} - -void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { - // TODO(backer): Currently NO-OPed. Should eventually be something like: - - // context_->MakeCurrent(surface_.get()); - // accelerated_surface_containers_.erase(surface_id); - // glFlush(); -} diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index c0cc243..35d421a 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1761,8 +1761,6 @@ 'browser/remove_rows_table_model.h', 'browser/renderer_host/accelerated_plugin_view_mac.h', 'browser/renderer_host/accelerated_plugin_view_mac.mm', - 'browser/renderer_host/accelerated_surface_container_touch.cc', - 'browser/renderer_host/accelerated_surface_container_touch.h', 'browser/renderer_host/chrome_render_message_filter.cc', 'browser/renderer_host/chrome_render_message_filter.h', 'browser/renderer_host/chrome_render_view_host_observer.cc', @@ -3699,9 +3697,6 @@ ['exclude', '^browser/chromeos/login/touch_*'], ['exclude', '^browser/extensions/extension_input_ui_api.cc'], ['exclude', '^browser/extensions/extension_input_ui_api.h'], - ['exclude', '^browser/renderer_host/accelerated_surface_container_touch.cc'], - ['exclude', '^browser/renderer_host/accelerated_surface_container_touch.h'], - ['exclude', '^browser/renderer_host/render_widget_host_view_views_touch.cc'], ['exclude', '^browser/renderer_host/render_widget_host_view_views_touch.cc'], ['exclude', '^browser/ui/touch/*'], ['exclude', '^browser/ui/views/tab_contents/tab_contents_container_views.cc'], @@ -3711,9 +3706,6 @@ ], }], ['touchui==1', { - 'dependencies': [ - '../ui/gfx/gl/gl.gyp:gl', - ], 'sources/': [ ['include', '^browser/ui/touch/*'], ['exclude', '^browser/chromeos/frame/browser_non_client_frame_view_factory_chromeos.cc'], diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 2bd04f1..0abee9f 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -149,19 +149,12 @@ bool GpuProcessHostUIShim::OnControlMessageReceived( OnLogMessage) #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#elif defined(OS_MACOSX) IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, OnAcceleratedSurfaceSetIOSurface) IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, OnAcceleratedSurfaceBuffersSwapped) #endif - -#if defined(TOUCH_UI) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, - OnAcceleratedSurfaceRelease) -#endif IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() @@ -222,9 +215,7 @@ void GpuProcessHostUIShim::OnResizeView(int32 renderer_id, Send(new GpuMsg_ResizeViewACK(renderer_id, command_buffer_route_id)); } -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#elif defined(OS_MACOSX) void GpuProcessHostUIShim::OnAcceleratedSurfaceSetIOSurface( const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params) { @@ -235,17 +226,10 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceSetIOSurface( RenderWidgetHostView* view = host->view(); if (!view) return; -#if defined(OS_MACOSX) view->AcceleratedSurfaceSetIOSurface(params.window, params.width, params.height, params.identifier); -#elif defined(TOUCH_UI) - view->AcceleratedSurfaceSetIOSurface( - params.width, params.height, params.identifier); - Send(new GpuMsg_AcceleratedSurfaceSetIOSurfaceACK( - params.renderer_id, params.route_id, params.identifier)); -#endif } void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( @@ -259,7 +243,6 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( RenderWidgetHostView* view = host->view(); if (!view) return; -#if defined (OS_MACOSX) view->AcceleratedSurfaceBuffersSwapped( // Parameters needed to swap the IOSurface. params.window, @@ -269,30 +252,6 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( params.route_id, host_id_, params.swap_buffers_count); -#elif defined(TOUCH_UI) - view->AcceleratedSurfaceBuffersSwapped(params.surface_id); - Send(new GpuMsg_AcceleratedSurfaceBuffersSwappedACK( - params.renderer_id, params.route_id, params.swap_buffers_count)); -#endif -} - -#endif - -#if defined(TOUCH_UI) - -void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( - const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { - RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, - params.render_view_id); - if (!host) - return; - RenderWidgetHostView* view = host->view(); - if (!view) - return; - view->AcceleratedSurfaceRelease(params.identifier); - - Send(new GpuMsg_AcceleratedSurfaceReleaseACK( - params.renderer_id, params.route_id, params.identifier)); } #endif diff --git a/content/browser/gpu/gpu_process_host_ui_shim.h b/content/browser/gpu/gpu_process_host_ui_shim.h index 7729fa2..02d8d79 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.h +++ b/content/browser/gpu/gpu_process_host_ui_shim.h @@ -25,7 +25,6 @@ class Size; } struct GPUCreateCommandBufferConfig; -struct GpuHostMsg_AcceleratedSurfaceRelease_Params; struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; @@ -98,20 +97,13 @@ class GpuProcessHostUIShim int32 render_view_id, int32 command_buffer_route_id, gfx::Size size); -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#elif defined(OS_MACOSX) void OnAcceleratedSurfaceSetIOSurface( const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); void OnAcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); #endif -#if defined(TOUCH_UI) - void OnAcceleratedSurfaceRelease( - const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); -#endif - // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. int host_id_; }; diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h index 56979b0..9f6191a 100644 --- a/content/browser/renderer_host/render_widget_host_view.h +++ b/content/browser/renderer_host/render_widget_host_view.h @@ -265,13 +265,6 @@ class RenderWidgetHostView { virtual void GpuRenderingStateDidChange() = 0; #endif -#if defined(TOUCH_UI) - virtual void AcceleratedSurfaceSetIOSurface( - int32 width, int32 height, uint64 surface_id) = 0; - virtual void AcceleratedSurfaceBuffersSwapped(uint64 surface_id) = 0; - virtual void AcceleratedSurfaceRelease(uint64 surface_id) = 0; -#endif - #if defined(TOOLKIT_USES_GTK) virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0; virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0; diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index ba4a74b..71bdea7 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -183,25 +183,7 @@ GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { return stubs_.Lookup(route_id); } -#if defined(TOUCH_UI) -void GpuChannel::AcceleratedSurfaceIOSurfaceSet( - int32 route_id, uint64 surface_id) { - GpuCommandBufferStub* stub = stubs_.Lookup(route_id); - if (stub == NULL) - return; - stub->AcceleratedSurfaceIOSurfaceSet(surface_id); -} - -void GpuChannel::AcceleratedSurfaceReleased( - int32 route_id, uint64 surface_id) { - GpuCommandBufferStub* stub = stubs_.Lookup(route_id); - if (stub == NULL) - return; - stub->AcceleratedSurfaceReleased(surface_id); -} -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) void GpuChannel::AcceleratedSurfaceBuffersSwapped( int32 route_id, uint64 swap_buffers_count) { GpuCommandBufferStub* stub = stubs_.Lookup(route_id); @@ -209,9 +191,7 @@ void GpuChannel::AcceleratedSurfaceBuffersSwapped( return; stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count); } -#endif -#if defined(OS_MACOSX) void GpuChannel::DestroyCommandBufferByViewId(int32 render_view_id) { // This responds to a message from the browser process to destroy the command // buffer when the window with a GpuScheduler is closed (see diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h index 6c57a29..c4a658c 100644 --- a/content/common/gpu/gpu_channel.h +++ b/content/common/gpu/gpu_channel.h @@ -90,19 +90,9 @@ class GpuChannel : public IPC::Channel::Listener, GpuCommandBufferStub* LookupCommandBuffer(int32 route_id); -#if defined(TOUCH_UI) - virtual void AcceleratedSurfaceIOSurfaceSet( - int32 route_id, uint64 surface_id); - virtual void AcceleratedSurfaceReleased( - int32 route_id, uint64 surface_id); -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) virtual void AcceleratedSurfaceBuffersSwapped( int32 route_id, uint64 swap_buffers_count); -#endif - -#if defined(OS_MACOSX) void DestroyCommandBufferByViewId(int32 render_view_id); #endif diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc index 299693d..86fdd35 100644 --- a/content/common/gpu/gpu_channel_manager.cc +++ b/content/common/gpu/gpu_channel_manager.cc @@ -49,18 +49,9 @@ bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged) #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK); -#endif -#if defined(TOUCH_UI) - IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceSetIOSurfaceACK, - OnAcceleratedSurfaceSetIOSurfaceACK) - IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceReleaseACK, - OnAcceleratedSurfaceReleaseACK) -#endif -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#elif defined(OS_MACOSX) IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, OnAcceleratedSurfaceBuffersSwappedACK) -#endif -#if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(GpuMsg_DestroyCommandBuffer, OnDestroyCommandBuffer) #endif @@ -147,27 +138,7 @@ void GpuChannelManager::OnResizeViewACK(int32 renderer_id, channel->ViewResized(command_buffer_route_id); } -#if defined(TOUCH_UI) -void GpuChannelManager::OnAcceleratedSurfaceSetIOSurfaceACK( - int renderer_id, int32 route_id, uint64 surface_id) { - GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); - if (iter == gpu_channels_.end()) - return; - scoped_refptr<GpuChannel> channel = iter->second; - channel->AcceleratedSurfaceIOSurfaceSet(route_id, surface_id); -} - -void GpuChannelManager::OnAcceleratedSurfaceReleaseACK( - int renderer_id, int32 route_id, uint64 surface_id) { - GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); - if (iter == gpu_channels_.end()) - return; - scoped_refptr<GpuChannel> channel = iter->second; - channel->AcceleratedSurfaceReleased(route_id, surface_id); -} -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) void GpuChannelManager::OnAcceleratedSurfaceBuffersSwappedACK( int renderer_id, int32 route_id, uint64 swap_buffers_count) { GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); @@ -176,9 +147,7 @@ void GpuChannelManager::OnAcceleratedSurfaceBuffersSwappedACK( scoped_refptr<GpuChannel> channel = iter->second; channel->AcceleratedSurfaceBuffersSwapped(route_id, swap_buffers_count); } -#endif -#if defined(OS_MACOSX) void GpuChannelManager::OnDestroyCommandBuffer( int renderer_id, int32 renderer_view_id) { GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h index 54742d6..e3b68a1 100644 --- a/content/common/gpu/gpu_channel_manager.h +++ b/content/common/gpu/gpu_channel_manager.h @@ -74,20 +74,9 @@ class GpuChannelManager : public IPC::Channel::Listener, int32 renderer_id, const GPUCreateCommandBufferConfig& init_params); void OnResizeViewACK(int32 renderer_id, int32 command_buffer_route_id); - -#if defined(TOUCH_UI) - void OnAcceleratedSurfaceSetIOSurfaceACK( - int renderer_id, int32 route_id, uint64 surface_id); - void OnAcceleratedSurfaceReleaseACK( - int renderer_id, int32 route_id, uint64 surface_id); -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) void OnAcceleratedSurfaceBuffersSwappedACK( int renderer_id, int32 route_id, uint64 swap_buffers_count); -#endif - -#if defined(OS_MACOSX) void OnDestroyCommandBuffer(int renderer_id, int32 renderer_view_id); #endif diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index a6b378e..d767744 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -156,7 +156,7 @@ void GpuCommandBufferStub::OnInitialize( scheduler_->SetCommandProcessedCallback( NewCallback(this, &GpuCommandBufferStub::OnCommandProcessed)); -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) if (handle_) { // This context conceptually puts its output directly on the // screen, rendered by the accelerated plugin layer in @@ -166,7 +166,7 @@ void GpuCommandBufferStub::OnInitialize( NewCallback(this, &GpuCommandBufferStub::SwapBuffersCallback)); } -#endif // defined(OS_MACOSX) || defined(TOUCH_UI) +#endif // defined(OS_MACOSX) // Set up a pathway for resizing the output window or framebuffer at the // right time relative to other GL commands. @@ -426,34 +426,7 @@ void GpuCommandBufferStub::SwapBuffersCallback() { scheduler_->SetScheduled(false); } -#endif // defined(OS_MACOSX) - -#if defined(TOUCH_UI) -void GpuCommandBufferStub::SwapBuffersCallback() { - TRACE_EVENT0("gpu", "GpuCommandBufferStub::SwapBuffersCallback"); - GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); - GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; - params.renderer_id = renderer_id_; - params.render_view_id = render_view_id_; - params.surface_id = scheduler_->GetFrontSurfaceId(); - params.route_id = route_id(); - params.swap_buffers_count = scheduler_->swap_buffers_count(); - gpu_channel_manager->Send( - new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); - - scheduler_->SetScheduled(false); -} -void GpuCommandBufferStub::AcceleratedSurfaceIOSurfaceSet(uint64 surface_id) { - scheduler_->SetScheduled(true); -} - -void GpuCommandBufferStub::AcceleratedSurfaceReleased(uint64 surface_id) { - scheduler_->ReleaseSurface(surface_id); -} -#endif // defined(TOUCH_UI) - -#if defined(OS_MACOSX) || defined(TOUCH_UI) void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( uint64 swap_buffers_count) { TRACE_EVENT1("gpu", @@ -473,7 +446,7 @@ void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( scheduler_->SetScheduled(true); } } -#endif // defined(OS_MACOSX) || defined(TOUCH_UI) +#endif // defined(OS_MACOSX) void GpuCommandBufferStub::CommandBufferWasDestroyed() { TRACE_EVENT0("gpu", "GpuCommandBufferStub::CommandBufferWasDestroyed"); @@ -502,31 +475,6 @@ void GpuCommandBufferStub::ResizeCallback(gfx::Size size) { size)); scheduler_->SetScheduled(false); -#elif defined(TOUCH_UI) - if (scheduler_->GetBackSurfaceId()) { - GpuHostMsg_AcceleratedSurfaceRelease_Params params; - params.renderer_id = renderer_id_; - params.render_view_id = render_view_id_; - params.identifier = scheduler_->GetBackSurfaceId(); - params.route_id = route_id(); - - GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); - gpu_channel_manager->Send( - new GpuHostMsg_AcceleratedSurfaceRelease(params)); - } - scheduler_->CreateBackSurface(size); - GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params params; - params.renderer_id = renderer_id_; - params.render_view_id = render_view_id_; - params.width = size.width(); - params.height = size.height(); - params.identifier = scheduler_->GetBackSurfaceId(); - params.route_id = route_id(); - - GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); - gpu_channel_manager->Send( - new GpuHostMsg_AcceleratedSurfaceSetIOSurface(params)); - scheduler_->SetScheduled(false); #endif } } diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index fa8d7ee..263dc43 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -70,15 +70,10 @@ class GpuCommandBufferStub void ViewResized(); -#if defined(TOUCH_UI) - void AcceleratedSurfaceIOSurfaceSet(uint64 surface_id); - void AcceleratedSurfaceReleased(uint64 surface_id); -#endif // defined(TOUCH_UI) - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) // Called only by the GpuChannel. void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count); -#endif // defined(OS_MACOSX) || defined(TOUCH_UI) +#endif // defined(OS_MACOSX) // Called when the command buffer was destroyed, and the stub should now // unblock itself and handle pending messages. @@ -117,11 +112,8 @@ class GpuCommandBufferStub #if defined(OS_MACOSX) void OnSetWindowSize(const gfx::Size& size); -#endif // defined(OS_MACOSX) - -#if defined(OS_MACOSX) || defined(TOUCH_UI) void SwapBuffersCallback(); -#endif // defined(TOUCH_UI) +#endif // defined(OS_MACOSX) void ResizeCallback(gfx::Size size); void ReportState(); diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 04cf463..ab0fb23 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -46,32 +46,6 @@ IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) IPC_STRUCT_END() #endif -#if defined(TOUCH_UI) -IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) - IPC_STRUCT_MEMBER(int32, renderer_id) - IPC_STRUCT_MEMBER(int32, render_view_id) - IPC_STRUCT_MEMBER(int32, width) - IPC_STRUCT_MEMBER(int32, height) - IPC_STRUCT_MEMBER(uint64, identifier) - IPC_STRUCT_MEMBER(int32, route_id) -IPC_STRUCT_END() - -IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) - IPC_STRUCT_MEMBER(int32, renderer_id) - IPC_STRUCT_MEMBER(int32, render_view_id) - IPC_STRUCT_MEMBER(uint64, surface_id) - IPC_STRUCT_MEMBER(int32, route_id) - IPC_STRUCT_MEMBER(uint64, swap_buffers_count) -IPC_STRUCT_END() - -IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) - IPC_STRUCT_MEMBER(int32, renderer_id) - IPC_STRUCT_MEMBER(int32, render_view_id) - IPC_STRUCT_MEMBER(uint64, identifier) - IPC_STRUCT_MEMBER(int32, route_id) -IPC_STRUCT_END() -#endif - IPC_STRUCT_TRAITS_BEGIN(DxDiagNode) IPC_STRUCT_TRAITS_MEMBER(values) IPC_STRUCT_TRAITS_MEMBER(children) @@ -147,23 +121,7 @@ IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) IPC_MESSAGE_CONTROL2(GpuMsg_ResizeViewACK, int32 /* renderer_id */, int32 /* command_buffer_id */) -#endif - -#if defined(TOUCH_UI) -// Tells the GPU process that it's safe to start rendering to the surface. -IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceSetIOSurfaceACK, - int /* renderer_id */, - int32 /* route_id */, - uint64 /* surface_id */); - -// Tells the GPU process the surface has been released. -IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceReleaseACK, - int /* renderer_id */, - int32 /* route_id */, - uint64 /* surface_id */); -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#elif defined(OS_MACOSX) // Tells the GPU process that the browser process handled the swap // buffers request with the given number. Note that it is possible // for the browser process to coalesce frames; it is not guaranteed @@ -173,9 +131,7 @@ IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, int /* renderer_id */, int32 /* route_id */, uint64 /* swap_buffers_count */) -#endif -#if defined(OS_MACOSX) // Requests the GPU process to destroy the command buffer and remove the // associated route. Further messages to this command buffer will result in a // channel error. @@ -247,13 +203,12 @@ IPC_MESSAGE_CONTROL4(GpuHostMsg_ResizeView, int32 /* render_view_id */, int32 /* command_buffer_route_id */, gfx::Size /* size */) -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) -// This message is sent from the GPU process to the browser to indicate that a -// new backing store was allocated. The renderer ID and render view ID are -// needed in order to uniquely identify the RenderWidgetHostView on the -// browser side. +#elif defined(OS_MACOSX) +// This message, used on Mac OS X 10.6 and later (where IOSurface is +// supported), is sent from the GPU process to the browser to indicate that a +// new backing store was allocated for the given "window" (fake +// PluginWindowHandle). The renderer ID and render view ID are needed in +// order to uniquely identify the RenderWidgetHostView on the browser side. IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) @@ -264,14 +219,6 @@ IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) #endif -#if defined(TOUCH_UI) -// Tells the browser to release whatever resources are associated with -// the given surface. The browser must send an ACK once this operation -// is complete. -IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceRelease, - GpuHostMsg_AcceleratedSurfaceRelease_Params) -#endif - //------------------------------------------------------------------------------ // GPU Channel Messages // These are messages from a renderer process to the GPU process. diff --git a/gpu/command_buffer/common/gl_mock.h b/gpu/command_buffer/common/gl_mock.h index 43e877b..b91cb5b 100644 --- a/gpu/command_buffer/common/gl_mock.h +++ b/gpu/command_buffer/common/gl_mock.h @@ -135,9 +135,6 @@ class MockGLInterface : public GLInterface { MOCK_METHOD4(DrawElements, void( GLenum mode, GLsizei count, GLenum type, const void* indices)); - MOCK_METHOD2(EGLImageTargetTexture2DOES, void( - GLenum target, GLeglImageOES image)); - MOCK_METHOD1(Enable, void(GLenum cap)); MOCK_METHOD1(EnableVertexAttribArray, void(GLuint index)); diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc index a67fd3a..d4ac593 100644 --- a/gpu/command_buffer/service/gpu_scheduler.cc +++ b/gpu/command_buffer/service/gpu_scheduler.cc @@ -25,7 +25,7 @@ GpuScheduler::GpuScheduler(CommandBuffer* command_buffer, : command_buffer_(command_buffer), commands_per_update_(100), unscheduled_count_(0), -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) swap_buffers_count_(0), acknowledged_swap_buffers_count_(0), #endif @@ -46,7 +46,7 @@ GpuScheduler::GpuScheduler(CommandBuffer* command_buffer, : command_buffer_(command_buffer), commands_per_update_(commands_per_update), unscheduled_count_(0), -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) swap_buffers_count_(0), acknowledged_swap_buffers_count_(0), #endif @@ -139,7 +139,7 @@ bool GpuScheduler::SetParent(GpuScheduler* parent_scheduler, return decoder_->SetParent(NULL, 0); } -#if defined(OS_MACOSX) || defined(TOUCH_UI) +#if defined(OS_MACOSX) namespace { const unsigned int kMaxOutstandingSwapBuffersCallsPerOnscreenContext = 1; } @@ -178,11 +178,6 @@ void GpuScheduler::ProcessCommands() { #if defined(OS_MACOSX) bool do_rate_limiting = surface_.get() != NULL; -#elif defined(TOUCH_UI) - bool do_rate_limiting = back_surface_.get() != NULL; -#endif - -#if defined(OS_MACOSX) || defined(TOUCH_UI) // Don't swamp the browser process with SwapBuffers calls it can't handle. if (do_rate_limiting && swap_buffers_count_ - acknowledged_swap_buffers_count_ >= diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h index a5d10ae..31b6a95 100644 --- a/gpu/command_buffer/service/gpu_scheduler.h +++ b/gpu/command_buffer/service/gpu_scheduler.h @@ -5,7 +5,6 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ -#include <map> #include <queue> #include <vector> @@ -24,8 +23,6 @@ #if defined(OS_MACOSX) #include "ui/gfx/surface/accelerated_surface_mac.h" -#elif defined(TOUCH_UI) -#include "ui/gfx/surface/accelerated_surface_linux.h" #endif namespace gfx { @@ -97,19 +94,6 @@ class GpuScheduler : public CommandBufferEngine { // Asynchronously resizes an offscreen frame buffer. void ResizeOffscreenFrameBuffer(const gfx::Size& size); -#if defined(OS_MACOSX) || defined(TOUCH_UI) - // To prevent the GPU process from overloading the browser process, - // we need to track the number of swap buffers calls issued and - // acknowledged per on-screen context, and keep the GPU from getting - // too far ahead of the browser. Note that this - // is also predicated on a flow control mechanism between the - // renderer and GPU processes. - uint64 swap_buffers_count() const; - uint64 acknowledged_swap_buffers_count() const; - void set_acknowledged_swap_buffers_count( - uint64 acknowledged_swap_buffers_count); -#endif - #if defined(OS_MACOSX) // Needed only on Mac OS X, which does not render into an on-screen // window and therefore requires the backing store to be resized @@ -123,23 +107,22 @@ class GpuScheduler : public CommandBufferEngine { virtual void SetTransportDIBAllocAndFree( Callback2<size_t, TransportDIB::Handle*>::Type* allocator, Callback1<TransportDIB::Id>::Type* deallocator); - // Returns the id of the current surface that is being rendered to - // (or 0 if no such surface has been created). + // Returns the id of the current IOSurface, or 0. virtual uint64 GetSurfaceId(); + // To prevent the GPU process from overloading the browser process, + // we need to track the number of swap buffers calls issued and + // acknowledged per on-screen (IOSurface-backed) context, and keep + // the GPU from getting too far ahead of the browser. Note that this + // is also predicated on a flow control mechanism between the + // renderer and GPU processes. + uint64 swap_buffers_count() const; + uint64 acknowledged_swap_buffers_count() const; + void set_acknowledged_swap_buffers_count( + uint64 acknowledged_swap_buffers_count); void DidDestroySurface(); #endif -#if defined(TOUCH_UI) - virtual void CreateBackSurface(const gfx::Size& size); - // Should not be back_surface_ or front_surface_. - virtual void ReleaseSurface(uint64 surface_id); - - // Returns the id of the surface (or 0 if no such surface has been created). - virtual uint64 GetBackSurfaceId(); - virtual uint64 GetFrontSurfaceId(); -#endif - // Sets a callback that is called when a glResizeCHROMIUM command // is processed. void SetResizeCallback(Callback1<gfx::Size>::Type* callback); @@ -200,18 +183,10 @@ class GpuScheduler : public CommandBufferEngine { scoped_ptr<Callback0::Type> scheduled_callback_; -#if defined(OS_MACOSX) || defined(TOUCH_UI) - uint64 swap_buffers_count_; - uint64 acknowledged_swap_buffers_count_; -#endif - #if defined(OS_MACOSX) scoped_ptr<AcceleratedSurface> surface_; -#elif defined(TOUCH_UI) - std::map<uint64, scoped_refptr<AcceleratedSurface> > - surfaces_; - scoped_refptr<AcceleratedSurface> back_surface_; - scoped_refptr<AcceleratedSurface> front_surface_; + uint64 swap_buffers_count_; + uint64 acknowledged_swap_buffers_count_; #endif ScopedRunnableMethodFactory<GpuScheduler> method_factory_; diff --git a/gpu/command_buffer/service/gpu_scheduler_linux.cc b/gpu/command_buffer/service/gpu_scheduler_linux.cc index 1c6c8e9..6adaba6 100644 --- a/gpu/command_buffer/service/gpu_scheduler_linux.cc +++ b/gpu/command_buffer/service/gpu_scheduler_linux.cc @@ -7,13 +7,6 @@ #include "ui/gfx/gl/gl_share_group.h" #include "ui/gfx/gl/gl_surface.h" -#if defined(TOUCH_UI) -#include "third_party/angle/include/EGL/egl.h" -#include "third_party/angle/include/EGL/eglext.h" -#include "ui/gfx/gl/gl_surface_egl.h" -#include "ui/gfx/gl/gl_bindings.h" -#endif - using ::base::SharedMemory; namespace gpu { @@ -27,14 +20,10 @@ bool GpuScheduler::Initialize( gfx::GLShareGroup* share_group) { // Create either a view or pbuffer based GLSurface. scoped_refptr<gfx::GLSurface> surface; -#if defined(TOUCH_UI) - surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); -#else if (window) surface = gfx::GLSurface::CreateViewGLSurface(window); else surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); -#endif if (!surface.get()) { LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; @@ -64,75 +53,9 @@ void GpuScheduler::Destroy() { } void GpuScheduler::WillSwapBuffers() { -#if defined(TOUCH_UI) - front_surface_.swap(back_surface_); - DCHECK_NE(front_surface_.get(), static_cast<AcceleratedSurface*>(NULL)); - - gfx::Size expected_size = front_surface_->size(); - if (!back_surface_.get() || back_surface_->size() != expected_size) { - wrapped_resize_callback_->Run(expected_size); - } else { - glFramebufferTexture2DEXT(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, - back_surface_->texture(), - 0); - } - ++swap_buffers_count_; - glFlush(); -#endif if (wrapped_swap_buffers_callback_.get()) { wrapped_swap_buffers_callback_->Run(); } } -#if defined(TOUCH_UI) -uint64 GpuScheduler::GetBackSurfaceId() { - if (!back_surface_.get()) - return 0; - return back_surface_->pixmap(); -} - -uint64 GpuScheduler::GetFrontSurfaceId() { - if (!front_surface_.get()) - return 0; - return front_surface_->pixmap(); -} - -uint64 GpuScheduler::swap_buffers_count() const { - return swap_buffers_count_; -} - -uint64 GpuScheduler::acknowledged_swap_buffers_count() const { - return acknowledged_swap_buffers_count_; -} - -void GpuScheduler::set_acknowledged_swap_buffers_count( - uint64 acknowledged_swap_buffers_count) { - acknowledged_swap_buffers_count_ = acknowledged_swap_buffers_count; -} - -void GpuScheduler::CreateBackSurface(const gfx::Size& size) { - decoder()->ResizeOffscreenFrameBuffer(size); - decoder()->UpdateOffscreenFrameBufferSize(); - - back_surface_ = new AcceleratedSurface(size); - surfaces_[back_surface_->pixmap()] = back_surface_; - - glFramebufferTexture2DEXT(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, - back_surface_->texture(), - 0); - glFlush(); -} - -void GpuScheduler::ReleaseSurface(uint64 surface_id) { - DCHECK_NE(surfaces_[surface_id].get(), back_surface_.get()); - DCHECK_NE(surfaces_[surface_id].get(), front_surface_.get()); - surfaces_.erase(surface_id); -} - -#endif - } // namespace gpu diff --git a/ui/gfx/gl/generate_bindings.py b/ui/gfx/gl/generate_bindings.py index b083229..99a93c46 100644 --- a/ui/gfx/gl/generate_bindings.py +++ b/ui/gfx/gl/generate_bindings.py @@ -84,8 +84,6 @@ GL_FUNCTIONS = [ ['void', ['glDrawArrays'], 'GLenum mode, GLint first, GLsizei count'], ['void', ['glDrawElements'], 'GLenum mode, GLsizei count, GLenum type, const void* indices'], -['void', ['glEGLImageTargetTexture2DOES'], - 'GLenum target, GLeglImageOES image'], ['void', ['glEnable'], 'GLenum cap'], ['void', ['glEnableVertexAttribArray'], 'GLuint index'], ['void', ['glFinish'], 'void'], @@ -293,11 +291,6 @@ EGL_FUNCTIONS = [ 'EGLint config_size, EGLint* num_config'], ['EGLBoolean', ['eglGetConfigAttrib'], 'EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value'], -['EGLImageKHR', ['eglCreateImageKHR'], - 'EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, ' - 'const EGLint* attrib_list'], -['EGLBoolean', ['eglDestroyImageKHR'], - 'EGLDisplay dpy, EGLImageKHR image'], ['EGLSurface', ['eglCreateWindowSurface'], 'EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, ' 'const EGLint* attrib_list'], diff --git a/ui/gfx/gl/gl_bindings.h b/ui/gfx/gl/gl_bindings.h index 34f9772..e7d6ad9 100644 --- a/ui/gfx/gl/gl_bindings.h +++ b/ui/gfx/gl/gl_bindings.h @@ -54,11 +54,9 @@ typedef int EGLint; typedef void *EGLConfig; typedef void *EGLContext; typedef void *EGLDisplay; -typedef void *EGLImageKHR; typedef void *EGLSurface; typedef void *EGLClientBuffer; typedef void (*__eglMustCastToProperFunctionPointerType)(void); -typedef void* GLeglImageOES; #if defined(OS_WIN) typedef HDC EGLNativeDisplayType; diff --git a/ui/gfx/gl/gl_interface.h b/ui/gfx/gl/gl_interface.h index 55ea9d1..4795625 100644 --- a/ui/gfx/gl/gl_interface.h +++ b/ui/gfx/gl/gl_interface.h @@ -168,9 +168,6 @@ class GLInterface { GLenum type, const void* indices) = 0; - virtual void EGLImageTargetTexture2DOES( - GLenum target, GLeglImageOES image) = 0; - virtual void Enable(GLenum cap) = 0; virtual void EnableVertexAttribArray(GLuint index) = 0; diff --git a/ui/gfx/surface/accelerated_surface_linux.cc b/ui/gfx/surface/accelerated_surface_linux.cc deleted file mode 100644 index 9a42c68..0000000 --- a/ui/gfx/surface/accelerated_surface_linux.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2011 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. - -#include "ui/gfx/surface/accelerated_surface_linux.h" - -#include <X11/Xlib.h> - -#include "third_party/angle/include/EGL/egl.h" -#include "third_party/angle/include/EGL/eglext.h" -#include "ui/gfx/gl/gl_surface_egl.h" -#include "ui/gfx/gl/gl_bindings.h" - -AcceleratedSurface::AcceleratedSurface(const gfx::Size& size) - : size_(size) { - Display* dpy = gfx::GLSurfaceEGL::GetNativeDisplay(); - EGLDisplay edpy = gfx::GLSurfaceEGL::GetDisplay(); - - XID window = XDefaultRootWindow(dpy); - XWindowAttributes gwa; - XGetWindowAttributes(dpy, window, &gwa); - pixmap_ = XCreatePixmap( - dpy, window, size_.width(), size_.height(), gwa.depth); - - image_ = eglCreateImageKHR( - edpy, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (void*) pixmap_, NULL); - - glGenTextures(1, &texture_); - - GLint current_texture = 0; - glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture); - - glBindTexture(GL_TEXTURE_2D, texture_); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image_); - - glBindTexture(GL_TEXTURE_2D, current_texture); -} - -AcceleratedSurface::~AcceleratedSurface() { - glDeleteTextures(1, &texture_); - eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); - XFreePixmap(gfx::GLSurfaceEGL::GetNativeDisplay(), pixmap_); -} diff --git a/ui/gfx/surface/accelerated_surface_linux.h b/ui/gfx/surface/accelerated_surface_linux.h deleted file mode 100644 index b905712..0000000 --- a/ui/gfx/surface/accelerated_surface_linux.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 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. - -#ifndef UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ -#define UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ -#pragma once - -#include "base/memory/ref_counted.h" -#include "ui/gfx/size.h" - -// The GL context associated with the surface must be current when -// an instance is created or destroyed. -class AcceleratedSurface : public base::RefCounted<AcceleratedSurface> { - public: - AcceleratedSurface(const gfx::Size& size); - const gfx::Size& size() const { return size_; } - uint32 pixmap() const { return pixmap_; } - uint32 texture() const { return texture_; } - - private: - ~AcceleratedSurface(); - - gfx::Size size_; - void* image_; - uint32 pixmap_; - uint32 texture_; - - friend class base::RefCounted<AcceleratedSurface>; - DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); -}; - -#endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ diff --git a/ui/gfx/surface/surface.gyp b/ui/gfx/surface/surface.gyp index 960e148..e4c2893 100644 --- a/ui/gfx/surface/surface.gyp +++ b/ui/gfx/surface/surface.gyp @@ -16,9 +16,6 @@ ['include', '_(gtk|linux|posix|skia|x)\\.cc$'], ['include', '/(gtk|x11)_[^/]*\\.cc$'], ], - 'include_dirs': [ - '<(DEPTH)/third_party/angle/include', - ], }], ['OS=="mac"', {'sources/': [ ['include', '/cocoa/'], @@ -47,8 +44,6 @@ '<(DEPTH)/ui/ui.gyp:ui_gfx', ], 'sources': [ - 'accelerated_surface_linux.cc', - 'accelerated_surface_linux.h', 'accelerated_surface_mac.cc', 'accelerated_surface_mac.h', 'io_surface_support_mac.cc', |