diff options
73 files changed, 555 insertions, 103 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi index b417256..0f6f363 100644 --- a/app/app_base.gypi +++ b/app/app_base.gypi @@ -50,6 +50,9 @@ 'gtk_signal.h', 'gtk_util.cc', 'gtk_util.h', + 'x11_util.cc', + 'x11_util.h', + 'x11_util_internal.h', ], }], ], @@ -163,6 +166,14 @@ 'sql/statement.h', 'sql/transaction.cc', 'sql/transaction.h', + 'surface/accelerated_surface_mac.cc', + 'surface/accelerated_surface_mac.h', + 'surface/io_surface_support_mac.cc', + 'surface/io_surface_support_mac.h', + 'surface/transport_dib.h', + 'surface/transport_dib_linux.cc', + 'surface/transport_dib_mac.cc', + 'surface/transport_dib_win.cc', 'table_model.cc', 'table_model.h', 'table_model_observer.h', @@ -172,6 +183,9 @@ 'theme_provider.h', 'throb_animation.cc', 'throb_animation.h', + 'x11_util.cc', + 'x11_util.h', + 'x11_util_internal.h', ], 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { diff --git a/chrome/common/accelerated_surface_mac.cc b/app/surface/accelerated_surface_mac.cc index 0e74428..f50d528 100644 --- a/chrome/common/accelerated_surface_mac.cc +++ b/app/surface/accelerated_surface_mac.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/accelerated_surface_mac.h" +#include "app/surface/accelerated_surface_mac.h" +#include "app/surface/io_surface_support_mac.h" #include "base/logging.h" -#include "chrome/common/io_surface_support_mac.h" #include "gfx/rect.h" AcceleratedSurface::AcceleratedSurface() diff --git a/chrome/common/accelerated_surface_mac.h b/app/surface/accelerated_surface_mac.h index e8c27af..32cd0df 100644 --- a/chrome/common/accelerated_surface_mac.h +++ b/app/surface/accelerated_surface_mac.h @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_ACCELERATED_SURFACE_MAC_H_ -#define CHROME_COMMON_ACCELERATED_SURFACE_MAC_H_ +#ifndef APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ +#define APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ #include <CoreFoundation/CoreFoundation.h> #include <OpenGL/OpenGL.h> +#include "app/surface/transport_dib.h" #include "base/callback.h" #include "base/scoped_cftyperef.h" #include "base/scoped_ptr.h" -#include "chrome/common/transport_dib.h" namespace gfx { class Rect; @@ -105,4 +105,4 @@ class AcceleratedSurface { scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_; }; -#endif // CHROME_COMMON_ACCELERATED_SURFACE_MAC_H_ +#endif // APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ diff --git a/chrome/common/io_surface_support_mac.cc b/app/surface/io_surface_support_mac.cc index 80b2539..fed66602 100644 --- a/chrome/common/io_surface_support_mac.cc +++ b/app/surface/io_surface_support_mac.cc @@ -5,7 +5,7 @@ #include <dlfcn.h> #include "base/singleton.h" -#include "chrome/common/io_surface_support_mac.h" +#include "app/surface/io_surface_support_mac.h" typedef CFTypeRef (*IOSurfaceCreateProcPtr)(CFDictionaryRef properties); typedef uint32 (*IOSurfaceGetIDProcPtr)(CFTypeRef io_surface); diff --git a/chrome/common/io_surface_support_mac.h b/app/surface/io_surface_support_mac.h index 6ad116f..7386490 100644 --- a/chrome/common/io_surface_support_mac.h +++ b/app/surface/io_surface_support_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IO_SURFACE_SUPPORT_MAC_H_ -#define CHROME_COMMON_IO_SURFACE_SUPPORT_MAC_H_ +#ifndef APP_SURFACE_IO_SURFACE_SUPPORT_MAC_H_ +#define APP_SURFACE_IO_SURFACE_SUPPORT_MAC_H_ #include <CoreFoundation/CoreFoundation.h> #include <mach/mach.h> @@ -62,5 +62,5 @@ class IOSurfaceSupport { DISALLOW_COPY_AND_ASSIGN(IOSurfaceSupport); }; -#endif // CHROME_COMMON_IO_SURFACE_SUPPORT_MAC_H_ +#endif // APP_SURFACE_IO_SURFACE_SUPPORT_MAC_H_ diff --git a/chrome/common/transport_dib.h b/app/surface/transport_dib.h index 4f8051e..7a60f08 100644 --- a/chrome/common/transport_dib.h +++ b/app/surface/transport_dib.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_TRANSPORT_DIB_H_ -#define CHROME_COMMON_TRANSPORT_DIB_H_ +#ifndef APP_SURFACE_TRANSPORT_DIB_H_ +#define APP_SURFACE_TRANSPORT_DIB_H_ #include "base/basictypes.h" @@ -14,7 +14,7 @@ #if defined(OS_WIN) #include <windows.h> #elif defined(USE_X11) -#include "chrome/common/x11_util.h" +#include "app/x11_util.h" #endif namespace gfx { @@ -153,4 +153,4 @@ class TransportDIB { class MessageLoop; -#endif // CHROME_COMMON_TRANSPORT_DIB_H_ +#endif // APP_SURFACE_TRANSPORT_DIB_H_ diff --git a/chrome/common/transport_dib_linux.cc b/app/surface/transport_dib_linux.cc index 9b153af..6c41a0c 100644 --- a/chrome/common/transport_dib_linux.cc +++ b/app/surface/transport_dib_linux.cc @@ -7,9 +7,9 @@ #include <sys/ipc.h> #include <sys/shm.h> +#include "app/surface/transport_dib.h" +#include "app/x11_util.h" #include "base/logging.h" -#include "chrome/common/transport_dib.h" -#include "chrome/common/x11_util.h" #include "gfx/size.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/common/transport_dib_mac.cc b/app/surface/transport_dib_mac.cc index 9634d83..cc56ab6 100644 --- a/chrome/common/transport_dib_mac.cc +++ b/app/surface/transport_dib_mac.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/transport_dib.h" +#include "app/surface/transport_dib.h" #include <unistd.h> #include <sys/stat.h> diff --git a/chrome/common/transport_dib_win.cc b/app/surface/transport_dib_win.cc index 3b22038..2a92fb1 100644 --- a/chrome/common/transport_dib_win.cc +++ b/app/surface/transport_dib_win.cc @@ -5,9 +5,9 @@ #include <limits> #include <windows.h> +#include "app/surface/transport_dib.h" #include "base/logging.h" #include "base/sys_info.h" -#include "chrome/common/transport_dib.h" #include "skia/ext/platform_canvas.h" TransportDIB::TransportDIB() { diff --git a/chrome/common/x11_util.cc b/app/x11_util.cc index 8d052c6..38799ad 100644 --- a/chrome/common/x11_util.cc +++ b/app/x11_util.cc @@ -6,7 +6,7 @@ // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support // remains woefully incomplete. -#include "chrome/common/x11_util.h" +#include "app/x11_util.h" #include <gdk/gdk.h> #include <gdk/gdkx.h> @@ -21,7 +21,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/thread.h" -#include "chrome/common/x11_util_internal.h" +#include "app/x11_util_internal.h" #include "gfx/size.h" namespace x11_util { diff --git a/chrome/common/x11_util.h b/app/x11_util.h index 2ee111c..1c8685f1 100644 --- a/chrome/common/x11_util.h +++ b/app/x11_util.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_X11_UTIL_H_ -#define CHROME_COMMON_X11_UTIL_H_ +#ifndef APP_X11_UTIL_H_ +#define APP_X11_UTIL_H_ // This file declares utility functions for X11 (Linux only). // @@ -170,4 +170,4 @@ bool ChangeWindowDesktop(XID window, XID destination); } // namespace x11_util -#endif // CHROME_COMMON_X11_UTIL_H_ +#endif // APP_X11_UTIL_H_ diff --git a/chrome/common/x11_util_internal.h b/app/x11_util_internal.h index 8042530..81f2820 100644 --- a/chrome/common/x11_util_internal.h +++ b/app/x11_util_internal.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_X11_UTIL_INTERNAL_H_ -#define CHROME_COMMON_X11_UTIL_INTERNAL_H_ +#ifndef APP_X11_UTIL_INTERNAL_H_ +#define APP_X11_UTIL_INTERNAL_H_ // This file declares utility functions for X11 (Linux only). // @@ -32,4 +32,4 @@ namespace x11_util { XRenderPictFormat* GetRenderVisualFormat(Display* dpy, Visual* visual); }; -#endif // CHROME_COMMON_X11_UTIL_INTERNAL_H_ +#endif // APP_X11_UTIL_INTERNAL_H_ diff --git a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc b/chrome/browser/chromeos/frame/normal_browser_frame_view.cc index f5887bc..5315f80 100644 --- a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc +++ b/chrome/browser/chromeos/frame/normal_browser_frame_view.cc @@ -9,6 +9,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "app/theme_provider.h" +#include "app/x11_util.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "chrome/browser/browser_theme_provider.h" @@ -18,7 +19,6 @@ #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/tabs/tab_strip.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/x11_util.h" #include "gfx/path.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc index 4008342..9eaec03 100644 --- a/chrome/browser/chromeos/frame/panel_controller.cc +++ b/chrome/browser/chromeos/frame/panel_controller.cc @@ -7,13 +7,13 @@ #include <vector> #include "app/resource_bundle.h" +#include "app/x11_util.h" #include "base/logging.h" #include "base/singleton.h" #include "base/scoped_ptr.h" #include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/chromeos/wm_ipc.h" -#include "chrome/common/x11_util.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index 17b0368..0c9c792 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -4,12 +4,12 @@ #include "chrome/browser/chromeos/login/background_view.h" +#include "app/x11_util.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" #include "chrome/browser/chromeos/status/clock_menu_button.h" #include "chrome/browser/chromeos/status/network_menu_button.h" #include "chrome/browser/chromeos/status/status_area_view.h" #include "chrome/browser/chromeos/wm_ipc.h" -#include "chrome/common/x11_util.h" #include "views/screen.h" #include "views/widget/widget_gtk.h" diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc index 99f71f5..7702bfc 100644 --- a/chrome/browser/chromeos/wm_ipc.cc +++ b/chrome/browser/chromeos/wm_ipc.cc @@ -9,10 +9,10 @@ extern "C" { #include <X11/Xlib.h> } +#include "app/x11_util.h" #include "base/logging.h" #include "base/singleton.h" #include "base/scoped_ptr.h" -#include "chrome/common/x11_util.h" namespace chromeos { diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 822dff0..f24e094 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -10,6 +10,7 @@ #include <map> #include "app/active_window_watcher_x.h" +#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "build/build_config.h" @@ -17,7 +18,6 @@ #include "chrome/browser/pref_member.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/common/notification_registrar.h" -#include "chrome/common/x11_util.h" #include "gfx/rect.h" class BookmarkBarGtk; diff --git a/chrome/browser/gtk/gtk_util.cc b/chrome/browser/gtk/gtk_util.cc index c9512b2..ea46705 100644 --- a/chrome/browser/gtk/gtk_util.cc +++ b/chrome/browser/gtk/gtk_util.cc @@ -13,6 +13,7 @@ #include "app/gtk_util.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "app/x11_util.h" #include "base/linux_util.h" #include "base/logging.h" #include "chrome/browser/browser_list.h" @@ -20,7 +21,6 @@ #include "chrome/browser/gtk/cairo_cached_surface.h" #include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/common/renderer_preferences.h" -#include "chrome/common/x11_util.h" #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" diff --git a/chrome/browser/gtk/gtk_util.h b/chrome/browser/gtk/gtk_util.h index b2149b3..541464b 100644 --- a/chrome/browser/gtk/gtk_util.h +++ b/chrome/browser/gtk/gtk_util.h @@ -9,7 +9,7 @@ #include <string> #include <vector> -#include "chrome/common/x11_util.h" +#include "app/x11_util.h" #include "gfx/point.h" #include "gfx/rect.h" #include "webkit/glue/window_open_disposition.h" diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h index 46905df..69602a8 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h +++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h @@ -9,12 +9,12 @@ #include <set> +#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "chrome/browser/dock_info.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/common/notification_registrar.h" -#include "chrome/common/x11_util.h" class DraggedTabGtk; class TabGtk; diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 25a32048..c11e3f4 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -10,6 +10,7 @@ #include "app/gfx/canvas_paint.h" #include "app/l10n_util.h" +#include "app/x11_util.h" #include "chrome/browser/browser_theme_provider.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/gtk/tabs/tab_renderer_gtk.h" @@ -18,7 +19,6 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tabs/tab_strip_model.h" -#include "chrome/common/x11_util.h" #include "gfx/gtk_util.h" #include "third_party/skia/include/core/SkShader.h" diff --git a/chrome/browser/renderer_host/accelerated_surface_container_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc index 66e8b4c..8d3827c 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_mac.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc @@ -4,10 +4,10 @@ #include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" +#include "app/surface/io_surface_support_mac.h" #include "base/logging.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" AcceleratedSurfaceContainerMac::AcceleratedSurfaceContainerMac() : x_(0), diff --git a/chrome/browser/renderer_host/accelerated_surface_container_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_mac.h index 393487f..5f2d12e 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.h @@ -28,9 +28,9 @@ #include <CoreFoundation/CoreFoundation.h> #include <OpenGL/OpenGL.h> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" diff --git a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h index 8bc44b5..2456186 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h @@ -9,8 +9,8 @@ #include <map> #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" namespace webkit_glue { diff --git a/chrome/browser/renderer_host/backing_store.h b/chrome/browser/renderer_host/backing_store.h index d405025..34739c8 100644 --- a/chrome/browser/renderer_host/backing_store.h +++ b/chrome/browser/renderer_host/backing_store.h @@ -7,9 +7,9 @@ #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/process.h" -#include "chrome/common/transport_dib.h" #include "gfx/rect.h" #include "gfx/size.h" diff --git a/chrome/browser/renderer_host/backing_store_mac.mm b/chrome/browser/renderer_host/backing_store_mac.mm index 1324593..d5cc992 100644 --- a/chrome/browser/renderer_host/backing_store_mac.mm +++ b/chrome/browser/renderer_host/backing_store_mac.mm @@ -6,12 +6,12 @@ #include "chrome/browser/renderer_host/backing_store_mac.h" +#include "app/surface/transport_dib.h" #include "base/logging.h" #include "base/mac_util.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" -#include "chrome/common/transport_dib.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" diff --git a/chrome/browser/renderer_host/backing_store_manager.h b/chrome/browser/renderer_host/backing_store_manager.h index ca187ab..660b08a 100644 --- a/chrome/browser/renderer_host/backing_store_manager.h +++ b/chrome/browser/renderer_host/backing_store_manager.h @@ -7,9 +7,9 @@ #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/process.h" -#include "chrome/common/transport_dib.h" #include "gfx/rect.h" #include "gfx/size.h" diff --git a/chrome/browser/renderer_host/backing_store_win.cc b/chrome/browser/renderer_host/backing_store_win.cc index c1e77f0..e41ad43 100644 --- a/chrome/browser/renderer_host/backing_store_win.cc +++ b/chrome/browser/renderer_host/backing_store_win.cc @@ -4,11 +4,11 @@ #include "chrome/browser/renderer_host/backing_store_win.h" +#include "app/surface/transport_dib.h" #include "base/command_line.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/transport_dib.h" #include "gfx/gdi_util.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc index 788e351..d88dca7 100644 --- a/chrome/browser/renderer_host/backing_store_x.cc +++ b/chrome/browser/renderer_host/backing_store_x.cc @@ -17,14 +17,14 @@ #include <algorithm> #include <utility> +#include "app/surface/transport_dib.h" +#include "app/x11_util.h" +#include "app/x11_util_internal.h" #include "base/compiler_specific.h" #include "base/histogram.h" #include "base/logging.h" #include "base/time.h" #include "chrome/browser/renderer_host/render_process_host.h" -#include "chrome/common/transport_dib.h" -#include "chrome/common/x11_util.h" -#include "chrome/common/x11_util_internal.h" #include "gfx/rect.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/renderer_host/backing_store_x.h b/chrome/browser/renderer_host/backing_store_x.h index e5b3281..0570789 100644 --- a/chrome/browser/renderer_host/backing_store_x.h +++ b/chrome/browser/renderer_host/backing_store_x.h @@ -5,10 +5,10 @@ #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ +#include "app/x11_util.h" #include "base/basictypes.h" #include "build/build_config.h" #include "chrome/browser/renderer_host/backing_store.h" -#include "chrome/common/x11_util.h" typedef struct _GdkDrawable GdkDrawable; class SkBitmap; diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h index d9acccb..277a53e 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.h +++ b/chrome/browser/renderer_host/browser_render_process_host.h @@ -11,10 +11,10 @@ #include <queue> #include <string> +#include "app/surface/transport_dib.h" #include "base/process.h" #include "base/scoped_ptr.h" #include "base/timer.h" -#include "chrome/common/transport_dib.h" #include "chrome/browser/child_process_launcher.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/common/notification_registrar.h" diff --git a/chrome/browser/renderer_host/render_process_host.h b/chrome/browser/renderer_host/render_process_host.h index 9835776..1ceeb42 100644 --- a/chrome/browser/renderer_host/render_process_host.h +++ b/chrome/browser/renderer_host/render_process_host.h @@ -8,11 +8,11 @@ #include <set> #include <string> +#include "app/surface/transport_dib.h" #include "base/id_map.h" #include "base/process.h" #include "base/scoped_ptr.h" #include "base/time.h" -#include "chrome/common/transport_dib.h" #include "chrome/common/visitedlink_common.h" #include "ipc/ipc_sync_channel.h" diff --git a/chrome/browser/renderer_host/render_widget_helper.h b/chrome/browser/renderer_host/render_widget_helper.h index d7e863e..1fa5973 100644 --- a/chrome/browser/renderer_host/render_widget_helper.h +++ b/chrome/browser/renderer_host/render_widget_helper.h @@ -7,13 +7,13 @@ #include <map> +#include "app/surface/transport_dib.h" #include "base/atomic_sequence_num.h" #include "base/hash_tables.h" #include "base/process.h" #include "base/ref_counted.h" #include "base/lock.h" #include "base/waitable_event.h" -#include "chrome/common/transport_dib.h" namespace IPC { class Message; diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 3309fbb..5c95535 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -7,6 +7,7 @@ #include <deque> +#include "app/surface/transport_dib.h" #include "base/process.h" #include "base/scoped_ptr.h" #include "base/string16.h" @@ -14,7 +15,6 @@ #include "chrome/common/edit_command.h" #include "chrome/common/native_web_keyboard_event.h" #include "chrome/common/property_bag.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gfx/size.h" #include "ipc/ipc_channel.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index ad8a341..ee2fb78 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -9,8 +9,8 @@ #include <OpenGL/OpenGL.h> #endif +#include "app/surface/transport_dib.h" #include "base/shared_memory.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/webplugin.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 0c10ef3..e6c476e9 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -19,6 +19,7 @@ #include <string> #include "app/l10n_util.h" +#include "app/x11_util.h" #include "base/command_line.h" #include "base/logging.h" #include "base/message_loop.h" @@ -34,7 +35,6 @@ #include "chrome/browser/renderer_host/video_layer_x.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/native_web_keyboard_event.h" -#include "chrome/common/x11_util.h" #include "gfx/gtk_util.h" #include "third_party/WebKit/WebKit/chromium/public/gtk/WebInputEventFactory.h" #include "webkit/glue/webcursor_gtk_data.h" 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 1c04b36..c671881 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -6,6 +6,7 @@ #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" +#include "app/surface/io_surface_support_mac.h" #import "base/chrome_application_mac.h" #include "base/histogram.h" #import "base/scoped_nsobject.h" @@ -23,7 +24,6 @@ #include "chrome/common/edit_command.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/render_messages.h" -#include "chrome/common/io_surface_support_mac.h" #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/WebKit/chromium/public/mac/WebInputEventFactory.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index 419a1ab..c903f6e 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -13,6 +13,7 @@ #include <vector> #include "app/clipboard/clipboard.h" +#include "app/surface/transport_dib.h" #include "base/callback.h" #include "base/file_path.h" #include "base/process.h" @@ -27,7 +28,6 @@ #include "chrome/common/nacl_types.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/render_messages.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "ipc/ipc_channel_proxy.h" diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc index 93b5f47..3a64462 100644 --- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc +++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc @@ -9,6 +9,7 @@ #include "app/clipboard/clipboard.h" #include "app/l10n_util.h" +#include "app/x11_util.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/singleton.h" @@ -18,7 +19,6 @@ #endif #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" -#include "chrome/common/x11_util.h" #include "gfx/gtk_native_view_id_manager.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/renderer_host/video_layer.h b/chrome/browser/renderer_host/video_layer.h index 66618cf..69f0702 100644 --- a/chrome/browser/renderer_host/video_layer.h +++ b/chrome/browser/renderer_host/video_layer.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_ #define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_ +#include "app/surface/transport_dib.h" #include "base/scoped_ptr.h" -#include "chrome/common/transport_dib.h" #include "gfx/size.h" class RenderProcessHost; diff --git a/chrome/browser/renderer_host/video_layer_x.cc b/chrome/browser/renderer_host/video_layer_x.cc index ddd2c21..c204b95 100644 --- a/chrome/browser/renderer_host/video_layer_x.cc +++ b/chrome/browser/renderer_host/video_layer_x.cc @@ -4,8 +4,8 @@ #include "chrome/browser/renderer_host/video_layer_x.h" +#include "app/x11_util_internal.h" #include "chrome/browser/renderer_host/render_process_host.h" -#include "chrome/common/x11_util_internal.h" #include "media/base/yuv_convert.h" VideoLayerX::VideoLayerX(RenderWidgetHost* widget, diff --git a/chrome/browser/renderer_host/video_layer_x.h b/chrome/browser/renderer_host/video_layer_x.h index ef97f30..a3c51b3 100644 --- a/chrome/browser/renderer_host/video_layer_x.h +++ b/chrome/browser/renderer_host/video_layer_x.h @@ -2,11 +2,11 @@ // 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_VIDEO_LAYER_X_ -#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_ +#ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ +#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ +#include "app/x11_util.h" #include "chrome/browser/renderer_host/video_layer.h" -#include "chrome/common/x11_util.h" // Implements a YUV data layer using X to hold the RGB data. class VideoLayerX : public VideoLayer { @@ -48,4 +48,4 @@ class VideoLayerX : public VideoLayer { DISALLOW_COPY_AND_ASSIGN(VideoLayerX); }; -#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_ +#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ diff --git a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc index 753848b..38a40f0 100644 --- a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc +++ b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "chrome/browser/renderer_host/backing_store_manager.h" #include "chrome/browser/renderer_host/mock_render_process_host.h" @@ -9,7 +10,6 @@ #include "chrome/browser/tab_contents/thumbnail_generator.h" #include "chrome/common/notification_service.h" #include "chrome/common/render_messages.h" -#include "chrome/common/transport_dib.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/browser/views/bug_report_view.cc b/chrome/browser/views/bug_report_view.cc index 8dc597c..4558fe5 100644 --- a/chrome/browser/views/bug_report_view.cc +++ b/chrome/browser/views/bug_report_view.cc @@ -31,7 +31,7 @@ #include "views/window/window.h" #if defined(OS_LINUX) -#include "chrome/common/x11_util.h" +#include "app/x11_util.h" #else #include "app/win_util.h" #endif diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 0a4fea0..761f521 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -23,8 +23,6 @@ # .cc, .h, and .mm files under chrome/common that are used on all # platforms, including both 32-bit and 64-bit Windows. # Test files are not included. - 'common/accelerated_surface_mac.cc', - 'common/accelerated_surface_mac.h', 'common/app_mode_constants_mac.h', 'common/app_mode_constants_mac.mm', 'common/bindings_policy.h', @@ -53,8 +51,6 @@ 'common/geoposition.h', 'common/gpu_messages.h', 'common/gpu_messages_internal.h', - 'common/io_surface_support_mac.cc', - 'common/io_surface_support_mac.h', 'common/logging_chrome.cc', 'common/logging_chrome.h', 'common/main_function_params.h', @@ -250,9 +246,6 @@ 'common/sqlite_utils.h', 'common/thumbnail_score.cc', 'common/thumbnail_score.h', - 'common/transport_dib_linux.cc', - 'common/transport_dib_mac.cc', - 'common/transport_dib_win.cc', 'common/url_constants.cc', 'common/url_constants.h', 'common/utility_messages.h', @@ -268,9 +261,6 @@ 'common/worker_messages_internal.h', 'common/worker_thread_ticker.cc', 'common/worker_thread_ticker.h', - 'common/x11_util.cc', - 'common/x11_util.h', - 'common/x11_util_internal.h', 'common/zip.cc', # Requires zlib directly. 'common/zip.h', ], diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 87270be..72f84ee 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -13,11 +13,11 @@ #include <vector> +#include "app/surface/transport_dib.h" #include "chrome/common/content_settings.h" #include "chrome/common/geoposition.h" #include "chrome/common/page_zoom.h" #include "chrome/common/thumbnail_score.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "ipc/ipc_message_utils.h" #include "net/base/upload_data.h" diff --git a/chrome/common/gpu_messages.h b/chrome/common/gpu_messages.h index 0e101fb..f3e16a3 100644 --- a/chrome/common/gpu_messages.h +++ b/chrome/common/gpu_messages.h @@ -7,11 +7,11 @@ #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/process.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/gpu_native_window_handle.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "gfx/size.h" diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 0046696..f795336 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -10,6 +10,7 @@ #include <vector> #include "app/clipboard/clipboard.h" +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/platform_file.h" #include "base/ref_counted.h" @@ -25,7 +26,6 @@ #include "chrome/common/page_transition_types.h" #include "chrome/common/renderer_preferences.h" #include "chrome/common/resource_response.h" -#include "chrome/common/transport_dib.h" #include "chrome/common/view_types.h" #include "chrome/common/webkit_param_traits.h" #include "gfx/native_widget_types.h" diff --git a/chrome/gpu/gpu_backing_store_glx.cc b/chrome/gpu/gpu_backing_store_glx.cc index 015e913..5f022cc 100644 --- a/chrome/gpu/gpu_backing_store_glx.cc +++ b/chrome/gpu/gpu_backing_store_glx.cc @@ -6,9 +6,9 @@ #include <GL/glew.h> +#include "app/surface/transport_dib.h" #include "base/scoped_ptr.h" #include "chrome/common/gpu_messages.h" -#include "chrome/common/transport_dib.h" #include "chrome/gpu/gpu_backing_store_glx_context.h" #include "chrome/gpu/gpu_thread.h" #include "chrome/gpu/gpu_view_x.h" diff --git a/chrome/gpu/gpu_backing_store_glx.h b/chrome/gpu/gpu_backing_store_glx.h index b0c1d65..3098523 100644 --- a/chrome/gpu/gpu_backing_store_glx.h +++ b/chrome/gpu/gpu_backing_store_glx.h @@ -5,10 +5,10 @@ #ifndef CHROME_GPU_GPU_BACKING_STORE_GLX_H_ #define CHROME_GPU_GPU_BACKING_STORE_GLX_H_ +#include "app/surface/transport_dib.h" +#include "app/x11_util.h" #include "base/basictypes.h" #include "base/process.h" -#include "chrome/common/transport_dib.h" -#include "chrome/common/x11_util.h" #include "ipc/ipc_channel.h" class GpuViewX; diff --git a/chrome/gpu/gpu_backing_store_glx_context.cc b/chrome/gpu/gpu_backing_store_glx_context.cc index 1b9f04a..eeeb9fb 100644 --- a/chrome/gpu/gpu_backing_store_glx_context.cc +++ b/chrome/gpu/gpu_backing_store_glx_context.cc @@ -4,8 +4,8 @@ #include "chrome/gpu/gpu_backing_store_glx_context.h" +#include "app/x11_util.h" #include "base/scoped_ptr.h" -#include "chrome/common/x11_util.h" #include "chrome/gpu/gpu_thread.h" // Must be last. diff --git a/chrome/gpu/gpu_backing_store_win.h b/chrome/gpu/gpu_backing_store_win.h index 42395a0..db06f60 100644 --- a/chrome/gpu/gpu_backing_store_win.h +++ b/chrome/gpu/gpu_backing_store_win.h @@ -9,8 +9,8 @@ #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gfx/size.h" #include "ipc/ipc_channel.h" diff --git a/chrome/gpu/gpu_video_layer_glx.h b/chrome/gpu/gpu_video_layer_glx.h index bcfb42f4..f46478f 100644 --- a/chrome/gpu/gpu_video_layer_glx.h +++ b/chrome/gpu/gpu_video_layer_glx.h @@ -5,10 +5,10 @@ #ifndef CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_ #define CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_ +#include "app/surface/transport_dib.h" +#include "app/x11_util.h" #include "base/basictypes.h" #include "base/process.h" -#include "chrome/common/transport_dib.h" -#include "chrome/common/x11_util.h" #include "ipc/ipc_channel.h" class GpuViewX; diff --git a/chrome/plugin/command_buffer_stub.h b/chrome/plugin/command_buffer_stub.h index 9d946a7..026110f 100644 --- a/chrome/plugin/command_buffer_stub.h +++ b/chrome/plugin/command_buffer_stub.h @@ -7,8 +7,8 @@ #if defined(ENABLE_GPU) +#include "app/surface/transport_dib.h" #include "base/ref_counted.h" -#include "chrome/common/transport_dib.h" #include "gfx/native_widget_types.h" #include "gpu/command_buffer/common/command_buffer.h" #include "gpu/command_buffer/service/command_buffer_service.h" diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 8ec442b..5a7be5d 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -9,10 +9,10 @@ #include <string> #include <vector> +#include "app/surface/transport_dib.h" #include "base/ref_counted.h" #include "base/shared_memory.h" #include "base/task.h" -#include "chrome/common/transport_dib.h" #include "chrome/plugin/command_buffer_stub.h" #include "gfx/rect.h" #include "googleurl/src/gurl.h" diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 9329d6c..4338dca 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -7,6 +7,7 @@ #include <string> +#include "app/surface/transport_dib.h" #include "base/hash_tables.h" #include "base/ref_counted.h" #if defined(OS_MACOSX) @@ -17,7 +18,6 @@ #include "base/shared_memory.h" #include "base/timer.h" #include "chrome/common/chrome_plugin_api.h" -#include "chrome/common/transport_dib.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message.h" #include "webkit/glue/webplugin.h" diff --git a/chrome/renderer/media/ipc_video_renderer.h b/chrome/renderer/media/ipc_video_renderer.h index 62fe048..070166b 100644 --- a/chrome/renderer/media/ipc_video_renderer.h +++ b/chrome/renderer/media/ipc_video_renderer.h @@ -10,8 +10,8 @@ #ifndef CHROME_RENDERER_MEDIA_IPC_VIDEO_RENDERER_H_ #define CHROME_RENDERER_MEDIA_IPC_VIDEO_RENDERER_H_ +#include "app/surface/transport_dib.h" #include "base/waitable_event.h" -#include "chrome/common/transport_dib.h" #include "gfx/rect.h" #include "gfx/size.h" #include "ipc/ipc_message.h" @@ -40,7 +40,7 @@ class IPCVideoRenderer : public webkit_glue::WebVideoRenderer { // TODO(scherkus): remove this mega-hack, see http://crbug.com/28207 class FactoryFactory : public webkit_glue::WebVideoRendererFactoryFactory { public: - FactoryFactory(int routing_id) + explicit FactoryFactory(int routing_id) : webkit_glue::WebVideoRendererFactoryFactory(), routing_id_(routing_id) { } diff --git a/chrome/renderer/mock_render_process.cc b/chrome/renderer/mock_render_process.cc index ed375ae..dc1c159 100644 --- a/chrome/renderer/mock_render_process.cc +++ b/chrome/renderer/mock_render_process.cc @@ -4,7 +4,7 @@ #include "chrome/renderer/mock_render_process.h" -#include "chrome/common/transport_dib.h" +#include "app/surface/transport_dib.h" #include "gfx/rect.h" MockRenderProcess::MockRenderProcess() diff --git a/chrome/renderer/nacl_desc_wrapper_chrome.cc b/chrome/renderer/nacl_desc_wrapper_chrome.cc index 86653b7..a4efc70 100644 --- a/chrome/renderer/nacl_desc_wrapper_chrome.cc +++ b/chrome/renderer/nacl_desc_wrapper_chrome.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/surface/transport_dib.h" #include "base/shared_memory.h" #include "base/sync_socket.h" -#include "chrome/common/transport_dib.h" #include "native_client/src/trusted/desc/nacl_desc_base.h" #include "native_client/src/trusted/desc/nacl_desc_sync_socket.h" #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" diff --git a/chrome/renderer/pepper_devices.h b/chrome/renderer/pepper_devices.h index 229b2ec..596b35f 100644 --- a/chrome/renderer/pepper_devices.h +++ b/chrome/renderer/pepper_devices.h @@ -5,12 +5,12 @@ #ifndef CHROME_RENDERER_PEPPER_DEVICES_H_ #define CHROME_RENDERER_PEPPER_DEVICES_H_ +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/shared_memory.h" #include "base/simple_thread.h" #include "chrome/common/render_messages.h" -#include "chrome/common/transport_dib.h" #include "chrome/renderer/audio_message_filter.h" #include "gfx/rect.h" #include "third_party/npapi/bindings/npapi.h" diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index f5d72c8..07e642e 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -12,6 +12,7 @@ #include "chrome/renderer/render_process.h" +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/compiler_specific.h" @@ -26,7 +27,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" #include "chrome/common/nacl_types.h" -#include "chrome/common/transport_dib.h" #include "chrome/renderer/render_view.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message_utils.h" diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index a508e77..45fb57a 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -12,6 +12,7 @@ #include "chrome/renderer/render_process_impl.h" +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/compiler_specific.h" @@ -26,7 +27,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" #include "chrome/common/nacl_types.h" -#include "chrome/common/transport_dib.h" #include "chrome/renderer/render_view.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message_utils.h" diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index b70783c..3695545 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -11,6 +11,7 @@ #include <queue> #include <vector> +#include "app/surface/transport_dib.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/id_map.h" @@ -27,7 +28,6 @@ #include "chrome/common/page_zoom.h" #include "chrome/common/render_messages.h" #include "chrome/common/renderer_preferences.h" -#include "chrome/common/transport_dib.h" #include "chrome/common/view_types.h" #include "chrome/renderer/automation/dom_automation_controller.h" #include "chrome/renderer/dom_ui_bindings.h" diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index c335d54..5872150 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/render_widget.h" +#include "app/surface/transport_dib.h" #include "base/command_line.h" #include "base/logging.h" #include "base/message_loop.h" @@ -11,7 +12,6 @@ #include "build/build_config.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" -#include "chrome/common/transport_dib.h" #include "chrome/renderer/render_process.h" #include "chrome/renderer/render_thread.h" #include "gfx/point.h" diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index 72e36bc..9078c56 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -8,10 +8,10 @@ #include <string> #include <vector> +#include "app/surface/transport_dib.h" #include "base/file_path.h" #include "base/ref_counted.h" #include "base/weak_ptr.h" -#include "chrome/common/transport_dib.h" #include "chrome/renderer/plugin_channel_host.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" @@ -6,10 +6,9 @@ include_rules = [ "+../common", "+../service", + # For IOSurface and TransportDIB support on OS X, and X11 utilities. + "+app", + # For gfx::PluginWindowHandle "+gfx", - - # For IOSurfaceSupport on Mac OS X, service-side code only. - # Can consider moving these files if this dependency is undesirable. - "+chrome/common", ] diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 441ffa1..4b448918 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -31,7 +31,7 @@ // XWindowWrapper is stubbed out for unit-tests. #include "gpu/command_buffer/service/x_utils.h" #elif defined(OS_MACOSX) -#include "chrome/common/accelerated_surface_mac.h" +#include "app/surface/accelerated_surface_mac.h" #endif namespace gpu { diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index fae1af0..26c6239 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -13,7 +13,7 @@ #endif #include "base/callback.h" #if defined(OS_MACOSX) -#include "chrome/common/transport_dib.h" +#include "app/surface/transport_dib.h" #endif #include "gpu/command_buffer/service/common_decoder.h" diff --git a/webkit/glue/plugins/mac_accelerated_surface_container.cc b/webkit/glue/plugins/mac_accelerated_surface_container.cc new file mode 100644 index 0000000..7d9ae67 --- /dev/null +++ b/webkit/glue/plugins/mac_accelerated_surface_container.cc @@ -0,0 +1,158 @@ +// 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. + +#include "webkit/glue/plugins/mac_accelerated_surface_container.h" + +#include "app/surface/io_surface_support_mac.h" +#include "base/logging.h" +#include "webkit/glue/webplugin.h" +#include "webkit/glue/plugins/mac_accelerated_surface_container_manager.h" + +MacAcceleratedSurfaceContainer::MacAcceleratedSurfaceContainer() + : x_(0), + y_(0), + surface_(NULL), + width_(0), + height_(0), + texture_(0) { +} + +MacAcceleratedSurfaceContainer::~MacAcceleratedSurfaceContainer() { + ReleaseIOSurface(); +} + +void MacAcceleratedSurfaceContainer::ReleaseIOSurface() { + if (surface_) { + CFRelease(surface_); + surface_ = NULL; + } +} + +void MacAcceleratedSurfaceContainer::SetSizeAndIOSurface( + int32 width, + int32 height, + uint64 io_surface_identifier, + MacAcceleratedSurfaceContainerManager* manager) { + ReleaseIOSurface(); + IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); + if (io_surface_support) { + surface_ = io_surface_support->IOSurfaceLookup( + static_cast<uint32>(io_surface_identifier)); + EnqueueTextureForDeletion(manager); + width_ = width; + height_ = height; + } +} + +void MacAcceleratedSurfaceContainer::SetSizeAndTransportDIB( + int32 width, + int32 height, + TransportDIB::Handle transport_dib, + MacAcceleratedSurfaceContainerManager* manager) { + if (TransportDIB::is_valid(transport_dib)) { + transport_dib_.reset(TransportDIB::Map(transport_dib)); + EnqueueTextureForDeletion(manager); + width_ = width; + height_ = height; + } +} + +void MacAcceleratedSurfaceContainer::MoveTo( + const webkit_glue::WebPluginGeometry& geom) { + x_ = geom.window_rect.x(); + y_ = geom.window_rect.y(); + // TODO(kbr): may need to pay attention to cutout rects. + clipRect_ = geom.clip_rect; +} + +void MacAcceleratedSurfaceContainer::Draw(CGLContextObj context) { + IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); + GLenum target = GL_TEXTURE_RECTANGLE_ARB; + if (!texture_) { + if ((io_surface_support && !surface_) || + (!io_surface_support && !transport_dib_.get())) + return; + glGenTextures(1, &texture_); + glBindTexture(target, texture_); + glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // When using an IOSurface, the texture does not need to be repeatedly + // uploaded, so bind the IOSurface once during texture gen in this case. + if (io_surface_support) { + DCHECK(surface_); + // Don't think we need to identify a plane. + GLuint plane = 0; + io_surface_support->CGLTexImageIOSurface2D(context, + target, + GL_RGBA, + width_, + height_, + GL_BGRA, + GL_UNSIGNED_INT_8_8_8_8_REV, + surface_, + plane); + } else { + // Reserve space on the card for the actual texture upload, done with the + // glTexSubImage2D() call, below. + glTexImage2D(target, + 0, // mipmap level 0 + GL_RGBA, // internal format + width_, + height_, + 0, // no border + GL_BGRA, // The GPU plugin read BGRA pixels + GL_UNSIGNED_INT_8_8_8_8_REV, + NULL); // No data, this call just reserves room. + } + } + + // If using TransportDIBs, the texture needs to be uploaded every frame. + if (transport_dib_.get() != NULL) { + void* pixel_memory = transport_dib_->memory(); + if (pixel_memory) { + glBindTexture(target, texture_); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // Needed for NPOT textures. + glTexSubImage2D(target, + 0, // mipmap level 0 + 0, // x-offset + 0, // y-offset + width_, + height_, + GL_BGRA, // The GPU plugin gave us BGRA pixels + GL_UNSIGNED_INT_8_8_8_8_REV, + pixel_memory); + } + } + + if (texture_) { + // TODO(kbr): convert this to use only OpenGL ES 2.0 functionality + glBindTexture(target, texture_); + glEnable(target); + glBegin(GL_TRIANGLE_STRIP); + // TODO(kbr): may need to pay attention to cutout rects. + int clipX = clipRect_.x(); + int clipY = clipRect_.y(); + int clipWidth = clipRect_.width(); + int clipHeight = clipRect_.height(); + int x = x_ + clipX; + int y = y_ + clipY; + glTexCoord2f(clipX, height_ - clipY); + glVertex3f(x, y, 0); + glTexCoord2f(clipX + clipWidth, height_ - clipY); + glVertex3f(x + clipWidth, y, 0); + glTexCoord2f(clipX, height_ - clipY - clipHeight); + glVertex3f(x, y + clipHeight, 0); + glTexCoord2f(clipX + clipWidth, height_ - clipY - clipHeight); + glVertex3f(x + clipWidth, y + clipHeight, 0); + glEnd(); + glDisable(target); + } +} + +void MacAcceleratedSurfaceContainer::EnqueueTextureForDeletion( + MacAcceleratedSurfaceContainerManager* manager) { + manager->EnqueueTextureForDeletion(texture_); + texture_ = 0; +} + diff --git a/webkit/glue/plugins/mac_accelerated_surface_container.h b/webkit/glue/plugins/mac_accelerated_surface_container.h new file mode 100644 index 0000000..0fd1793 --- /dev/null +++ b/webkit/glue/plugins/mac_accelerated_surface_container.h @@ -0,0 +1,110 @@ +// 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. + +#ifndef WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_H_ +#define WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_H_ + +// The "GPU plugin" is currently implemented as a special kind of +// NPAPI plugin to provide high-performance on-screen 3D rendering for +// Pepper 3D. +// +// On Windows and X11 platforms the GPU plugin relies on cross-process +// parenting of windows, which is not supported via any public APIs in +// the Mac OS X window system. +// +// To achieve full hardware acceleration we use the new IOSurface APIs +// introduced in Mac OS X 10.6. The GPU plugin's process produces an +// IOSurface and renders into it using OpenGL. It uses the +// IOSurfaceGetID and IOSurfaceLookup APIs to pass a reference to this +// surface to the browser process for on-screen rendering. The GPU +// plugin essentially looks like a windowless plugin; the browser +// process gets all of the mouse events, because the plugin process +// does not have an on-screen window. +// +// This class encapsulates some of the management of these data +// structures, in conjunction with the MacAcceleratedSurfaceContainerManager. + +#include <CoreFoundation/CoreFoundation.h> +#include <OpenGL/OpenGL.h> + +#include "app/gfx/native_widget_types.h" +#include "app/surface/transport_dib.h" +#include "base/basictypes.h" +#include "base/scoped_ptr.h" +#include "base/gfx/rect.h" + +namespace webkit_glue { +struct WebPluginGeometry; +} + +class MacAcceleratedSurfaceContainerManager; + +class MacAcceleratedSurfaceContainer { + public: + MacAcceleratedSurfaceContainer(); + virtual ~MacAcceleratedSurfaceContainer(); + + // 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, + MacAcceleratedSurfaceContainerManager* manager); + void SetSizeAndTransportDIB(int32 width, + int32 height, + TransportDIB::Handle transport_dib, + MacAcceleratedSurfaceContainerManager* manager); + + // 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 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(MacAcceleratedSurfaceContainerManager* manager); + + private: + // The x and y coordinates of the plugin window on the web page. + int x_; + int y_; + + void ReleaseIOSurface(); + + // The IOSurfaceRef, if any, that has been handed from the GPU + // plugin process back to the browser process for drawing. + // This is held as a CFTypeRef because we can't refer to the + // IOSurfaceRef type when building on 10.5. + CFTypeRef surface_; + + // The TransportDIB which is used in pre-10.6 systems where the IOSurface + // API is not supported. This is a weak reference to the actual TransportDIB + // whic is owned by the GPU process. + scoped_ptr<TransportDIB> transport_dib_; + + // The width and height of the surface. + int32 width_; + int32 height_; + + // The clip rectangle, relative to the (x_, y_) origin. + gfx::Rect clipRect_; + + // The "live" OpenGL texture referring to this IOSurfaceRef. Note + // that per the CGLTexImageIOSurface2D API we do not need to + // explicitly update this texture's contents once created. All we + // need to do is ensure it is re-bound before attempting to draw + // with it. + GLuint texture_; + + DISALLOW_COPY_AND_ASSIGN(MacAcceleratedSurfaceContainer); +}; + +#endif // WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_H_ + diff --git a/webkit/glue/plugins/mac_accelerated_surface_container_manager.cc b/webkit/glue/plugins/mac_accelerated_surface_container_manager.cc new file mode 100644 index 0000000..a149661 --- /dev/null +++ b/webkit/glue/plugins/mac_accelerated_surface_container_manager.cc @@ -0,0 +1,103 @@ +// 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. + +#include "webkit/glue/plugins/mac_accelerated_surface_container_manager.h" + +#include "base/logging.h" +#include "webkit/glue/webplugin.h" +#include "webkit/glue/plugins/mac_accelerated_surface_container.h" + +MacAcceleratedSurfaceContainerManager::MacAcceleratedSurfaceContainerManager() + : current_id_(0) { +} + +gfx::PluginWindowHandle +MacAcceleratedSurfaceContainerManager::AllocateFakePluginWindowHandle() { + MacAcceleratedSurfaceContainer* container = + new MacAcceleratedSurfaceContainer(); + gfx::PluginWindowHandle res = + static_cast<gfx::PluginWindowHandle>(++current_id_); + plugin_window_to_container_map_.insert(std::make_pair(res, container)); + return res; +} + +void MacAcceleratedSurfaceContainerManager::DestroyFakePluginWindowHandle( + gfx::PluginWindowHandle id) { + MacAcceleratedSurfaceContainer* container = MapIDToContainer(id); + if (container) + delete container; + plugin_window_to_container_map_.erase(id); +} + +void MacAcceleratedSurfaceContainerManager::SetSizeAndIOSurface( + gfx::PluginWindowHandle id, + int32 width, + int32 height, + uint64 io_surface_identifier) { + MacAcceleratedSurfaceContainer* container = MapIDToContainer(id); + if (container) + container->SetSizeAndIOSurface(width, height, + io_surface_identifier, this); +} + +void MacAcceleratedSurfaceContainerManager::SetSizeAndTransportDIB( + gfx::PluginWindowHandle id, + int32 width, + int32 height, + TransportDIB::Handle transport_dib) { + MacAcceleratedSurfaceContainer* container = MapIDToContainer(id); + if (container) + container->SetSizeAndTransportDIB(width, height, + transport_dib, this); +} + +void MacAcceleratedSurfaceContainerManager::MovePluginContainer( + const webkit_glue::WebPluginGeometry& move) { + MacAcceleratedSurfaceContainer* container = MapIDToContainer(move.window); + if (container) + container->MoveTo(move); +} + +void MacAcceleratedSurfaceContainerManager::Draw(CGLContextObj context) { + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + GLenum target = GL_TEXTURE_RECTANGLE_ARB; + glTexEnvi(target, GL_TEXTURE_ENV_MODE, GL_REPLACE); + + for (PluginWindowToContainerMap::const_iterator i = + plugin_window_to_container_map_.begin(); + i != plugin_window_to_container_map_.end(); ++i) { + MacAcceleratedSurfaceContainer* container = i->second; + container->Draw(context); + } + + // Unbind any texture from the texture target to ensure that the + // next time through we will have to re-bind the texture and thereby + // pick up modifications from the other process. + glBindTexture(target, 0); + + glFlush(); +} + +void MacAcceleratedSurfaceContainerManager::EnqueueTextureForDeletion( + GLuint texture) { + if (texture) { + textures_pending_deletion_.push_back(texture); + } +} + +MacAcceleratedSurfaceContainer* + MacAcceleratedSurfaceContainerManager::MapIDToContainer( + gfx::PluginWindowHandle id) { + PluginWindowToContainerMap::const_iterator i = + plugin_window_to_container_map_.find(id); + if (i != plugin_window_to_container_map_.end()) + return i->second; + + LOG(ERROR) << "Request for plugin container for unknown window id " << id; + + return NULL; +} + diff --git a/webkit/glue/plugins/mac_accelerated_surface_container_manager.h b/webkit/glue/plugins/mac_accelerated_surface_container_manager.h new file mode 100644 index 0000000..da86e361 --- /dev/null +++ b/webkit/glue/plugins/mac_accelerated_surface_container_manager.h @@ -0,0 +1,78 @@ +// 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. + +#ifndef WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_MANAGER_H_ +#define WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_MANAGER_H_ + +#include <OpenGL/OpenGL.h> +#include <map> +#include <vector> + +#include "app/gfx/native_widget_types.h" +#include "app/surface/transport_dib.h" +#include "base/basictypes.h" + +namespace webkit_glue { +struct WebPluginGeometry; +} + +class MacAcceleratedSurfaceContainer; + +// Helper class that manages the backing store and on-screen rendering +// of instances of the GPU plugin on the Mac. +class MacAcceleratedSurfaceContainerManager { + public: + MacAcceleratedSurfaceContainerManager(); + + // Allocates a new "fake" PluginWindowHandle, which is used as the + // key for the other operations. + gfx::PluginWindowHandle AllocateFakePluginWindowHandle(); + + // Destroys a fake PluginWindowHandle and associated storage. + void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle id); + + // Sets the size and backing store of the plugin instance. 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(gfx::PluginWindowHandle id, + int32 width, + int32 height, + uint64 io_surface_identifier); + void SetSizeAndTransportDIB(gfx::PluginWindowHandle id, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); + + // Takes an update from WebKit about a plugin's position and size and moves + // the plugin accordingly. + void MovePluginContainer(const webkit_glue::WebPluginGeometry& move); + + // Draws all of the managed plugin containers into the given OpenGL + // context, which must already be current. + void Draw(CGLContextObj context); + + // Called by the container to enqueue its OpenGL texture objects for + // deletion. + void EnqueueTextureForDeletion(GLuint texture); + + private: + uint32 current_id_; + + // Maps a "fake" plugin window handle to the corresponding container. + MacAcceleratedSurfaceContainer* MapIDToContainer(gfx::PluginWindowHandle id); + + // A map that associates plugin window handles with their containers. + typedef std::map<gfx::PluginWindowHandle, MacAcceleratedSurfaceContainer*> + 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(MacAcceleratedSurfaceContainerManager); +}; + +#endif // WEBKIT_GLUE_PLUGINS_MAC_ACCELERATED_SURFACE_CONTAINER_MANAGER_H_ + diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index 99fadde..e72bb825 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -22,7 +22,7 @@ #include "webkit/glue/webplugin_delegate.h" #if defined(OS_MACOSX) -#include "chrome/common/accelerated_surface_mac.h" +#include "app/surface/accelerated_surface_mac.h" #endif #if defined(USE_X11) |