summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 17:05:31 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 17:05:31 +0000
commit77128dec2b067b305b9f749aa8a703af0159b350 (patch)
treef6b237cb5cee5152dfd29a88747691936100dd26
parentb61f4dbfaf2459e54203656e2d80588fbad1c931 (diff)
downloadchromium_src-77128dec2b067b305b9f749aa8a703af0159b350.zip
chromium_src-77128dec2b067b305b9f749aa8a703af0159b350.tar.gz
chromium_src-77128dec2b067b305b9f749aa8a703af0159b350.tar.bz2
Deleted code associated with --enable-gpu-rendering and
--enable-video-layering flags. With the introduction of accelerated compositing to Chromium this code is now obsolete, and it is causing problems and bug reports when users experiment with these flags. Tested on Linux in the following configurations: - Compositor on, CSS 3D content - Compositor on, HTML5 video content - Compositor off, HTML5 video content Also ran patch successfully through the try bots. BUG=54932 TEST=none Review URL: http://codereview.chromium.org/4399003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65383 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gpu_process_host_ui_shim.cc7
-rw-r--r--chrome/browser/gpu_process_host_ui_shim.h5
-rw-r--r--chrome/browser/renderer_host/backing_store.h9
-rw-r--r--chrome/browser/renderer_host/backing_store_mac.h3
-rw-r--r--chrome/browser/renderer_host/backing_store_mac.mm7
-rw-r--r--chrome/browser/renderer_host/backing_store_manager.cc9
-rw-r--r--chrome/browser/renderer_host/backing_store_manager.h8
-rw-r--r--chrome/browser/renderer_host/backing_store_proxy.cc101
-rw-r--r--chrome/browser/renderer_host/backing_store_proxy.h54
-rw-r--r--chrome/browser/renderer_host/backing_store_win.cc7
-rw-r--r--chrome/browser/renderer_host/backing_store_win.h3
-rw-r--r--chrome/browser/renderer_host/backing_store_x.cc7
-rw-r--r--chrome/browser/renderer_host/backing_store_x.h3
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/browser/renderer_host/gpu_view_host.cc50
-rw-r--r--chrome/browser/renderer_host/gpu_view_host.h50
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc65
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h23
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view.h4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc54
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h8
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.h1
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm6
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_views.cc55
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_views.h8
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc23
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h6
-rw-r--r--chrome/browser/renderer_host/test/test_backing_store.cc3
-rw-r--r--chrome/browser/renderer_host/test/test_backing_store.h3
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc6
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h1
-rw-r--r--chrome/browser/renderer_host/video_layer.cc13
-rw-r--r--chrome/browser/renderer_host/video_layer.h51
-rw-r--r--chrome/browser/renderer_host/video_layer_proxy.cc59
-rw-r--r--chrome/browser/renderer_host/video_layer_proxy.h44
-rw-r--r--chrome/browser/renderer_host/video_layer_x.cc110
-rw-r--r--chrome/browser/renderer_host/video_layer_x.h56
-rw-r--r--chrome/chrome.gyp12
-rw-r--r--chrome/chrome_browser.gypi10
-rw-r--r--chrome/chrome_renderer.gypi2
-rw-r--r--chrome/common/chrome_switches.cc7
-rw-r--r--chrome/common/chrome_switches.h2
-rw-r--r--chrome/common/gpu_messages.h1
-rw-r--r--chrome/common/gpu_messages_internal.h49
-rw-r--r--chrome/common/gpu_native_window_handle.h42
-rw-r--r--chrome/common/gpu_param_traits.h1
-rw-r--r--chrome/common/render_messages.h1
-rw-r--r--chrome/common/render_messages_internal.h14
-rw-r--r--chrome/gpu/gpu_backing_store_glx.cc230
-rw-r--r--chrome/gpu/gpu_backing_store_glx.h67
-rw-r--r--chrome/gpu/gpu_backing_store_glx_context.cc123
-rw-r--r--chrome/gpu/gpu_backing_store_glx_context.h62
-rw-r--r--chrome/gpu/gpu_backing_store_win.cc185
-rw-r--r--chrome/gpu/gpu_backing_store_win.h75
-rw-r--r--chrome/gpu/gpu_config.h8
-rw-r--r--chrome/gpu/gpu_thread.cc38
-rw-r--r--chrome/gpu/gpu_thread.h18
-rw-r--r--chrome/gpu/gpu_video_layer_glx.cc332
-rw-r--r--chrome/gpu/gpu_video_layer_glx.h79
-rw-r--r--chrome/gpu/gpu_view_win.cc132
-rw-r--r--chrome/gpu/gpu_view_win.h72
-rw-r--r--chrome/gpu/gpu_view_x.cc115
-rw-r--r--chrome/gpu/gpu_view_x.h65
-rw-r--r--chrome/renderer/media/ipc_video_renderer.cc162
-rw-r--r--chrome/renderer/media/ipc_video_renderer.h79
-rw-r--r--chrome/renderer/render_view.cc18
-rw-r--r--chrome/renderer/render_widget.cc10
67 files changed, 24 insertions, 2910 deletions
diff --git a/chrome/browser/gpu_process_host_ui_shim.cc b/chrome/browser/gpu_process_host_ui_shim.cc
index 71db44b..682eb1a 100644
--- a/chrome/browser/gpu_process_host_ui_shim.cc
+++ b/chrome/browser/gpu_process_host_ui_shim.cc
@@ -36,13 +36,6 @@ GpuProcessHostUIShim* GpuProcessHostUIShim::Get() {
return Singleton<GpuProcessHostUIShim>::get();
}
-int32 GpuProcessHostUIShim::NewRenderWidgetHostView(
- GpuNativeWindowHandle parent) {
- int32 routing_id = GetNextRoutingId();
- Send(new GpuMsg_NewRenderWidgetHostView(parent, routing_id));
- return routing_id;
-}
-
bool GpuProcessHostUIShim::Send(IPC::Message* msg) {
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
diff --git a/chrome/browser/gpu_process_host_ui_shim.h b/chrome/browser/gpu_process_host_ui_shim.h
index 3e5d93b..e2f09ae 100644
--- a/chrome/browser/gpu_process_host_ui_shim.h
+++ b/chrome/browser/gpu_process_host_ui_shim.h
@@ -12,7 +12,6 @@
// shuttling messages between the browser and GPU processes.
#include "base/singleton.h"
-#include "chrome/common/gpu_native_window_handle.h"
#include "chrome/common/message_router.h"
#include "ipc/ipc_channel.h"
#include "gfx/native_widget_types.h"
@@ -25,10 +24,6 @@ class GpuProcessHostUIShim : public IPC::Channel::Sender,
int32 GetNextRoutingId();
- // Creates the new remote view and returns the routing ID for the view, or 0
- // on failure.
- int32 NewRenderWidgetHostView(GpuNativeWindowHandle parent);
-
// IPC::Channel::Sender implementation.
virtual bool Send(IPC::Message* msg);
diff --git a/chrome/browser/renderer_host/backing_store.h b/chrome/browser/renderer_host/backing_store.h
index 53d0288..57d5078 100644
--- a/chrome/browser/renderer_host/backing_store.h
+++ b/chrome/browser/renderer_host/backing_store.h
@@ -40,18 +40,11 @@ class BackingStore {
// Paints the bitmap from the renderer onto the backing store. bitmap_rect
// gives the location of bitmap, and copy_rects specifies the subregion(s) of
// the backingstore to be painted from the bitmap.
- //
- // The value placed into |*painted_synchronously| indicates if the paint was
- // completed synchronously and the TransportDIB can be freed. False means that
- // the backing store may still be using the transport DIB and it will manage
- // notifying the RenderWidgetHost that it's done with it via
- // DonePaintingToBackingStore().
virtual void PaintToBackingStore(
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) = 0;
+ const std::vector<gfx::Rect>& copy_rects) = 0;
// Extracts the gives subset of the backing store and copies it to the given
// PlatformCanvas. The PlatformCanvas should not be initialized. This function
diff --git a/chrome/browser/renderer_host/backing_store_mac.h b/chrome/browser/renderer_host/backing_store_mac.h
index 2c75400d..9c4cc6d 100644
--- a/chrome/browser/renderer_host/backing_store_mac.h
+++ b/chrome/browser/renderer_host/backing_store_mac.h
@@ -28,8 +28,7 @@ class BackingStoreMac : public BackingStore {
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously);
+ const std::vector<gfx::Rect>& copy_rects);
virtual bool CopyFromBackingStore(const gfx::Rect& rect,
skia::PlatformCanvas* output);
virtual void ScrollBackingStore(int dx, int dy,
diff --git a/chrome/browser/renderer_host/backing_store_mac.mm b/chrome/browser/renderer_host/backing_store_mac.mm
index bea378f..5754839 100644
--- a/chrome/browser/renderer_host/backing_store_mac.mm
+++ b/chrome/browser/renderer_host/backing_store_mac.mm
@@ -56,12 +56,7 @@ void BackingStoreMac::PaintToBackingStore(
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) {
- // Our paints are always synchronous and the caller can free the TransportDIB,
- // even on failure.
- *painted_synchronously = true;
-
+ const std::vector<gfx::Rect>& copy_rects) {
DCHECK_NE(static_cast<bool>(cg_layer()), static_cast<bool>(cg_bitmap()));
TransportDIB* dib = process->GetTransportDIB(bitmap);
diff --git a/chrome/browser/renderer_host/backing_store_manager.cc b/chrome/browser/renderer_host/backing_store_manager.cc
index 4325f31..755a772 100644
--- a/chrome/browser/renderer_host/backing_store_manager.cc
+++ b/chrome/browser/renderer_host/backing_store_manager.cc
@@ -196,11 +196,7 @@ void BackingStoreManager::PrepareBackingStore(
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
const std::vector<gfx::Rect>& copy_rects,
- bool* needs_full_paint,
- bool* painted_synchronously) {
- // Default to declaring we're done using the transport DIB so it can be freed.
- *painted_synchronously = true;
-
+ bool* needs_full_paint) {
BackingStore* backing_store = GetBackingStore(host, backing_store_size);
if (!backing_store) {
// We need to get Webkit to generate a new paint here, as we
@@ -218,8 +214,7 @@ void BackingStoreManager::PrepareBackingStore(
}
backing_store->PaintToBackingStore(host->process(), bitmap,
- bitmap_rect, copy_rects,
- painted_synchronously);
+ bitmap_rect, copy_rects);
}
// static
diff --git a/chrome/browser/renderer_host/backing_store_manager.h b/chrome/browser/renderer_host/backing_store_manager.h
index 1ab78cc..3db86b0 100644
--- a/chrome/browser/renderer_host/backing_store_manager.h
+++ b/chrome/browser/renderer_host/backing_store_manager.h
@@ -43,19 +43,13 @@ class BackingStoreManager {
// needs_full_paint
// Set if we need to send out a request to paint the view
// to the renderer.
- // painted_synchronously
- // Will be set by the function if the request was processed synchronously,
- // and the bitmap is done being used. False means that the backing store
- // will paint the bitmap at a later time and that the TransportDIB can't be
- // freed (it will be the backing store's job to free it later).
static void PrepareBackingStore(
RenderWidgetHost* host,
const gfx::Size& backing_store_size,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
const std::vector<gfx::Rect>& copy_rects,
- bool* needs_full_paint,
- bool* painted_synchronously);
+ bool* needs_full_paint);
// Returns a matching backing store for the host.
// Returns NULL if we fail to find one.
diff --git a/chrome/browser/renderer_host/backing_store_proxy.cc b/chrome/browser/renderer_host/backing_store_proxy.cc
deleted file mode 100644
index 3d2fd8e..0000000
--- a/chrome/browser/renderer_host/backing_store_proxy.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/backing_store_proxy.h"
-
-#include "build/build_config.h"
-#include "chrome/browser/gpu_process_host_ui_shim.h"
-#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/browser/renderer_host/render_widget_host.h"
-#include "chrome/common/gpu_messages.h"
-#include "chrome/common/render_messages.h"
-#include "gfx/rect.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
-BackingStoreProxy::BackingStoreProxy(RenderWidgetHost* widget,
- const gfx::Size& size,
- GpuProcessHostUIShim* process_shim,
- int32 routing_id)
- : BackingStore(widget, size),
- process_shim_(process_shim),
- routing_id_(routing_id),
- waiting_for_paint_ack_(false) {
- process_shim_->AddRoute(routing_id_, this);
-}
-
-BackingStoreProxy::~BackingStoreProxy() {
- process_shim_->RemoveRoute(routing_id_);
-}
-
-void BackingStoreProxy::PaintToBackingStore(
- RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) {
- DCHECK(!waiting_for_paint_ack_);
-
- base::ProcessId process_id;
-#if defined(OS_WIN)
- process_id = ::GetProcessId(process->GetHandle());
-#elif defined(OS_POSIX)
- process_id = process->GetHandle();
-#endif
-
- if (process_shim_->Send(new GpuMsg_PaintToBackingStore(
- routing_id_, process_id, bitmap, bitmap_rect, copy_rects))) {
- // Message sent successfully, so the caller can not destroy the
- // TransportDIB. OnDonePaintingToBackingStore will free it later.
- *painted_synchronously = false;
- waiting_for_paint_ack_ = true;
- } else {
- // On error, we're done with the TransportDIB and the caller can free it.
- *painted_synchronously = true;
- }
-}
-
-bool BackingStoreProxy::CopyFromBackingStore(const gfx::Rect& rect,
- skia::PlatformCanvas* output) {
- NOTIMPLEMENTED();
- return false;
-}
-
-void BackingStoreProxy::ScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size) {
- process_shim_->Send(new GpuMsg_ScrollBackingStore(routing_id_, dx, dy,
- clip_rect, view_size));
-}
-
-void BackingStoreProxy::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(BackingStoreProxy, msg)
- IPC_MESSAGE_HANDLER(GpuHostMsg_PaintToBackingStore_ACK,
- OnPaintToBackingStoreACK)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void BackingStoreProxy::OnChannelConnected(int32 peer_pid) {
-}
-
-void BackingStoreProxy::OnChannelError() {
- if (waiting_for_paint_ack_) {
- // If the GPU process dies while painting, the renderer will be waiting for
- // the paint ACK before painting any more. Since no ack is coming, we
- // manually declare that we're done with the transport DIB here so it can
- // continue.
- OnPaintToBackingStoreACK();
- }
-
- // TODO(brettw): does this mean we aren't getting any more messages and we
- // should delete outselves?
-}
-
-void BackingStoreProxy::OnPaintToBackingStoreACK() {
- DCHECK(waiting_for_paint_ack_);
- render_widget_host()->DonePaintingToBackingStore();
- waiting_for_paint_ack_ = false;
-}
diff --git a/chrome/browser/renderer_host/backing_store_proxy.h b/chrome/browser/renderer_host/backing_store_proxy.h
deleted file mode 100644
index 610f7ef..0000000
--- a/chrome/browser/renderer_host/backing_store_proxy.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_
-#define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "chrome/browser/renderer_host/backing_store.h"
-#include "ipc/ipc_channel.h"
-
-class GpuProcessHostUIShim;
-
-class BackingStoreProxy : public BackingStore,
- public IPC::Channel::Listener {
- public:
- BackingStoreProxy(RenderWidgetHost* widget, const gfx::Size& size,
- GpuProcessHostUIShim* process_shim, int32 routing_id);
- virtual ~BackingStoreProxy();
-
- // BackingStore implementation.
- virtual void PaintToBackingStore(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously);
- virtual bool CopyFromBackingStore(const gfx::Rect& rect,
- skia::PlatformCanvas* output);
- virtual void ScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size);
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- private:
- // Message handlers.
- void OnPaintToBackingStoreACK();
-
- GpuProcessHostUIShim* process_shim_;
- int32 routing_id_;
-
- // Set to true when we're waiting for the GPU process to do a paint and send
- // back a "done" message. In this case, the renderer will be waiting for our
- // message that we're done using the backing store.
- bool waiting_for_paint_ack_;
-
- DISALLOW_COPY_AND_ASSIGN(BackingStoreProxy);
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_PROXY_H_
diff --git a/chrome/browser/renderer_host/backing_store_win.cc b/chrome/browser/renderer_host/backing_store_win.cc
index 94d9cbf..2013104 100644
--- a/chrome/browser/renderer_host/backing_store_win.cc
+++ b/chrome/browser/renderer_host/backing_store_win.cc
@@ -116,12 +116,7 @@ void BackingStoreWin::PaintToBackingStore(
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) {
- // Our paints are always synchronous and the TransportDIB can be freed when
- // we're done (even on error).
- *painted_synchronously = true;
-
+ const std::vector<gfx::Rect>& copy_rects) {
if (!backing_store_dib_) {
backing_store_dib_ = CreateDIB(hdc_, size().width(),
size().height(), color_depth_);
diff --git a/chrome/browser/renderer_host/backing_store_win.h b/chrome/browser/renderer_host/backing_store_win.h
index 221e0aa..ce4c419 100644
--- a/chrome/browser/renderer_host/backing_store_win.h
+++ b/chrome/browser/renderer_host/backing_store_win.h
@@ -26,8 +26,7 @@ class BackingStoreWin : public BackingStore {
virtual void PaintToBackingStore(RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously);
+ const std::vector<gfx::Rect>& copy_rects);
virtual bool CopyFromBackingStore(const gfx::Rect& rect,
skia::PlatformCanvas* output);
virtual void ScrollBackingStore(int dx, int dy,
diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc
index a79a8fc..9fc7e5c 100644
--- a/chrome/browser/renderer_host/backing_store_x.cc
+++ b/chrome/browser/renderer_host/backing_store_x.cc
@@ -160,12 +160,7 @@ void BackingStoreX::PaintToBackingStore(
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) {
- // Our paints are always synchronous and the caller can free the TransportDIB
- // when we're done, even on error.
- *painted_synchronously = true;
-
+ const std::vector<gfx::Rect>& copy_rects) {
if (!display_)
return;
diff --git a/chrome/browser/renderer_host/backing_store_x.h b/chrome/browser/renderer_host/backing_store_x.h
index 283c19f..e6a73a7 100644
--- a/chrome/browser/renderer_host/backing_store_x.h
+++ b/chrome/browser/renderer_host/backing_store_x.h
@@ -53,8 +53,7 @@ class BackingStoreX : public BackingStore {
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously);
+ const std::vector<gfx::Rect>& copy_rects);
virtual bool CopyFromBackingStore(const gfx::Rect& rect,
skia::PlatformCanvas* output);
virtual void ScrollBackingStore(int dx, int dy,
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 6874758..af37c6b 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -594,7 +594,6 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kEnableOpenMax,
switches::kVideoThreads,
switches::kEnableVideoFullscreen,
- switches::kEnableVideoLayering,
switches::kEnableVideoLogging,
switches::kEnableTouch,
// We propagate the Chrome Frame command line here as well in case the
diff --git a/chrome/browser/renderer_host/gpu_view_host.cc b/chrome/browser/renderer_host/gpu_view_host.cc
deleted file mode 100644
index fa8c19c..0000000
--- a/chrome/browser/renderer_host/gpu_view_host.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/gpu_view_host.h"
-
-#include "chrome/browser/gpu_process_host_ui_shim.h"
-#include "chrome/browser/renderer_host/backing_store_proxy.h"
-#include "chrome/browser/renderer_host/video_layer_proxy.h"
-#include "chrome/common/gpu_messages.h"
-
-GpuViewHost::GpuViewHost(RenderWidgetHost* widget, GpuNativeWindowHandle parent)
- : widget_(widget),
- process_shim_(GpuProcessHostUIShim::Get()),
- routing_id_(0) {
- if (!process_shim_) {
- // TODO(brettw) handle error.
- return;
- }
- routing_id_ = process_shim_->NewRenderWidgetHostView(parent);
-}
-
-GpuViewHost::~GpuViewHost() {
-}
-
-BackingStore* GpuViewHost::CreateBackingStore(const gfx::Size& size) {
- int32 backing_store_routing_id = process_shim_->GetNextRoutingId();
- BackingStoreProxy* result =
- new BackingStoreProxy(widget_, size,
- process_shim_, backing_store_routing_id);
- process_shim_->Send(new GpuMsg_NewBackingStore(routing_id_,
- backing_store_routing_id,
- size));
- return result;
-}
-
-VideoLayer* GpuViewHost::CreateVideoLayer(const gfx::Size& size) {
- int32 video_layer_routing_id = process_shim_->GetNextRoutingId();
- VideoLayerProxy* result =
- new VideoLayerProxy(widget_, size,
- process_shim_, video_layer_routing_id);
- process_shim_->Send(new GpuMsg_NewVideoLayer(routing_id_,
- video_layer_routing_id,
- size));
- return result;
-}
-
-void GpuViewHost::OnWindowPainted() {
- process_shim_->Send(new GpuMsg_WindowPainted(routing_id_));
-}
diff --git a/chrome/browser/renderer_host/gpu_view_host.h b/chrome/browser/renderer_host/gpu_view_host.h
deleted file mode 100644
index c37409c..0000000
--- a/chrome/browser/renderer_host/gpu_view_host.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_RENDERER_HOST_GPU_VIEW_HOST_H_
-#define CHROME_BROWSER_RENDERER_HOST_GPU_VIEW_HOST_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "chrome/common/gpu_native_window_handle.h"
-
-class BackingStore;
-class GpuProcessHostUIShim;
-class RenderWidgetHost;
-class VideoLayer;
-
-namespace gfx {
-class Size;
-}
-
-// A proxy for the GPU process' window for rendering pages.
-class GpuViewHost {
- public:
- GpuViewHost(RenderWidgetHost* widget, GpuNativeWindowHandle parent);
- ~GpuViewHost();
-
- // Creates a new backing store in the GPU process and returns ownership of
- // the new pointer to the caller.
- BackingStore* CreateBackingStore(const gfx::Size& size);
-
- // Creates a new video layer in the GPU process and returns ownership of the
- // new pointer to the caller.
- VideoLayer* CreateVideoLayer(const gfx::Size& size);
-
- // Notification that the RenderWidgetHost has been asked to paint the window.
- // Depending on the backing store, the GPU backing store may have to repaint
- // at this time. On Linux this is needed because the GPU process paints
- // directly into the RWH's X window.
- void OnWindowPainted();
-
- private:
- RenderWidgetHost* widget_;
-
- GpuProcessHostUIShim* process_shim_;
- int32 routing_id_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuViewHost);
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_GPU_VIEW_HOST_H_
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index 9d89fd8..6f586ee 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/renderer_host/render_widget_host_painting_observer.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
-#include "chrome/browser/renderer_host/video_layer.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "chrome/common/notification_service.h"
@@ -150,9 +149,6 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove)
IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnMsgPaintAtSizeAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect)
- IPC_MESSAGE_HANDLER(ViewHostMsg_CreateVideo, OnMsgCreateVideo)
- IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateVideo, OnMsgUpdateVideo)
- IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyVideo, OnMsgDestroyVideo)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur)
@@ -792,7 +788,6 @@ void RenderWidgetHost::OnMsgUpdateRect(
DCHECK(!params.bitmap_rect.IsEmpty());
DCHECK(!params.view_size.IsEmpty());
- bool painted_synchronously = true; // Default to sending a paint ACK below.
if (!is_gpu_rendering_active_) {
const size_t size = params.bitmap_rect.height() *
params.bitmap_rect.width() * 4;
@@ -816,8 +811,7 @@ void RenderWidgetHost::OnMsgUpdateRect(
// renderer-supplied bits. The view will read out of the backing store
// later to actually draw to the screen.
PaintBackingStoreRect(params.bitmap, params.bitmap_rect,
- params.copy_rects, params.view_size,
- &painted_synchronously);
+ params.copy_rects, params.view_size);
}
}
}
@@ -825,10 +819,8 @@ void RenderWidgetHost::OnMsgUpdateRect(
// ACK early so we can prefetch the next PaintRect if there is a next one.
// This must be done AFTER we're done painting with the bitmap supplied by the
// renderer. This ACK is a signal to the renderer that the backing store can
- // be re-used, so the bitmap may be invalid after this call. If the backing
- // store is painting asynchronously, it will manage issuing this IPC.
- if (painted_synchronously)
- Send(new ViewMsg_UpdateRect_ACK(routing_id_));
+ // be re-used, so the bitmap may be invalid after this call.
+ Send(new ViewMsg_UpdateRect_ACK(routing_id_));
// We don't need to update the view if the view is hidden. We must do this
// early return after the ACK is sent, however, or the renderer will not send
@@ -871,27 +863,6 @@ void RenderWidgetHost::OnMsgUpdateRect(
UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta);
}
-void RenderWidgetHost::OnMsgCreateVideo(const gfx::Size& size) {
- DCHECK(!video_layer_.get());
-
- video_layer_.reset(view_->AllocVideoLayer(size));
-
- // TODO(scherkus): support actual video ids!
- Send(new ViewMsg_CreateVideo_ACK(routing_id_, -1));
-}
-
-void RenderWidgetHost::OnMsgUpdateVideo(TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect) {
- PaintVideoLayer(bitmap, bitmap_rect);
-
- // TODO(scherkus): support actual video ids!
- Send(new ViewMsg_UpdateVideo_ACK(routing_id_, -1));
-}
-
-void RenderWidgetHost::OnMsgDestroyVideo() {
- video_layer_.reset();
-}
-
void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) {
// Log the time delta for processing an input event.
TimeDelta delta = TimeTicks::Now() - input_event_start_time_;
@@ -1077,12 +1048,7 @@ void RenderWidgetHost::PaintBackingStoreRect(
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
const std::vector<gfx::Rect>& copy_rects,
- const gfx::Size& view_size,
- bool* painted_synchronously) {
- // On failure, we need to be sure our caller knows we're done with the
- // backing store.
- *painted_synchronously = true;
-
+ const gfx::Size& view_size) {
// The view may be destroyed already.
if (!view_)
return;
@@ -1097,8 +1063,7 @@ void RenderWidgetHost::PaintBackingStoreRect(
bool needs_full_paint = false;
BackingStoreManager::PrepareBackingStore(this, view_size, bitmap, bitmap_rect,
- copy_rects, &needs_full_paint,
- painted_synchronously);
+ copy_rects, &needs_full_paint);
if (needs_full_paint) {
repaint_start_time_ = TimeTicks::Now();
repaint_ack_pending_ = true;
@@ -1126,26 +1091,6 @@ void RenderWidgetHost::ScrollBackingStoreRect(int dx, int dy,
backing_store->ScrollBackingStore(dx, dy, clip_rect, view_size);
}
-void RenderWidgetHost::PaintVideoLayer(TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect) {
- if (is_hidden_ || !video_layer_.get())
- return;
-
- video_layer_->CopyTransportDIB(process(), bitmap, bitmap_rect);
-
- // Don't update the view if we're hidden or if the view has been destroyed.
- if (is_hidden_ || !view_)
- return;
-
- // Trigger a paint for the updated video layer bitmap.
- std::vector<gfx::Rect> copy_rects;
- copy_rects.push_back(bitmap_rect);
-
- view_being_painted_ = true;
- view_->DidUpdateBackingStore(gfx::Rect(), 0, 0, copy_rects);
- view_being_painted_ = false;
-}
-
void RenderWidgetHost::ToggleSpellPanel(bool is_currently_visible) {
Send(new ViewMsg_ToggleSpellPanel(routing_id(), is_currently_visible));
}
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index fe8ad85..42bdbde 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -42,7 +42,6 @@ class RenderProcessHost;
class RenderWidgetHostView;
class RenderWidgetHostPaintingObserver;
class TransportDIB;
-class VideoLayer;
class WebCursor;
struct ViewHostMsg_ShowPopup_Params;
struct ViewHostMsg_UpdateRect_Params;
@@ -248,9 +247,6 @@ class RenderWidgetHost : public IPC::Channel::Listener,
// block briefly waiting for an ack from the renderer.
void ScheduleComposite();
- // Returns the video layer if it exists, NULL otherwise.
- VideoLayer* video_layer() const { return video_layer_.get(); }
-
// Starts a hang monitor timeout. If there's already a hang monitor timeout
// the new one will only fire if it has a shorter delay than the time
// left on the existing timeouts.
@@ -479,9 +475,6 @@ class RenderWidgetHost : public IPC::Channel::Listener,
void OnMsgRequestMove(const gfx::Rect& pos);
void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size);
void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
- void OnMsgCreateVideo(const gfx::Size& size);
- void OnMsgUpdateVideo(TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect);
- void OnMsgDestroyVideo();
void OnMsgInputEventAck(const IPC::Message& message);
virtual void OnMsgFocus();
virtual void OnMsgBlur();
@@ -519,15 +512,10 @@ class RenderWidgetHost : public IPC::Channel::Listener,
#endif
// Paints the given bitmap to the current backing store at the given location.
- // |*painted_synchronously| will be true if the message was processed
- // synchronously, and the bitmap is done being used. False means that the
- // backing store will paint the bitmap at a later time and that the DIB can't
- // be freed (it will be the backing store's job to free it later).
void PaintBackingStoreRect(TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
const std::vector<gfx::Rect>& copy_rects,
- const gfx::Size& view_size,
- bool* painted_synchronously);
+ const gfx::Size& view_size);
// Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The
// |dib| and its corresponding location |bitmap_rect| in the backing store
@@ -535,12 +523,6 @@ class RenderWidgetHost : public IPC::Channel::Listener,
void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect,
const gfx::Size& view_size);
- // Paints the entire given bitmap into the current video layer, if it exists.
- // |bitmap_rect| specifies the destination size and absolute location of the
- // bitmap on the backing store.
- void PaintVideoLayer(TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect);
-
// Called by OnMsgInputEventAck() to process a keyboard event ack message.
void ProcessKeyboardEventAck(int type, bool processed);
@@ -690,9 +672,6 @@ class RenderWidgetHost : public IPC::Channel::Listener,
// changed.
bool suppress_next_char_events_;
- // Optional video YUV layer for used for out-of-process compositing.
- scoped_ptr<VideoLayer> video_layer_;
-
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
};
diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h
index 352de02..d7fa9c3 100644
--- a/chrome/browser/renderer_host/render_widget_host_view.h
+++ b/chrome/browser/renderer_host/render_widget_host_view.h
@@ -30,7 +30,6 @@ class Message;
class BackingStore;
class RenderProcessHost;
class RenderWidgetHost;
-class VideoLayer;
class WebCursor;
struct NativeWebKeyboardEvent;
struct ViewHostMsg_AccessibilityNotification_Params;
@@ -173,9 +172,6 @@ class RenderWidgetHostView {
// Allocate a backing store for this view
virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0;
- // Allocate a video layer for this view.
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size) = 0;
-
#if defined(OS_MACOSX)
// Tells the view whether or not to accept first responder status. If |flag|
// is true, the view does not accept first responder status and instead
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 36a7d37..bbbe456 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -29,13 +29,11 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/renderer_host/backing_store_x.h"
-#include "chrome/browser/renderer_host/gpu_view_host.h"
#include "chrome/browser/renderer_host/gtk_im_context_wrapper.h"
#include "chrome/browser/renderer_host/gtk_key_bindings_handler.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
-#include "chrome/browser/renderer_host/video_layer_x.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "gfx/gtk_preserve_window.h"
@@ -474,7 +472,6 @@ RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
: host_(widget_host),
- enable_gpu_rendering_(false),
about_to_validate_and_paint_(false),
is_hidden_(false),
is_loading_(false),
@@ -488,11 +485,6 @@ RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
dragged_at_horizontal_edge_(0),
dragged_at_vertical_edge_(0) {
host_->set_view(this);
-
- // Enable experimental out-of-process GPU rendering.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- enable_gpu_rendering_ =
- command_line->HasSwitch(switches::kEnableGPURendering);
}
RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() {
@@ -752,38 +744,11 @@ bool RenderWidgetHostViewGtk::IsPopup() {
BackingStore* RenderWidgetHostViewGtk::AllocBackingStore(
const gfx::Size& size) {
- if (enable_gpu_rendering_) {
- // Use a special GPU accelerated backing store.
- if (!gpu_view_host_.get()) {
- // Here we lazily make the GpuViewHost. This must be allocated when we
- // have a native view realized, which happens sometime after creation
- // when our owner puts us in the parent window.
- DCHECK(GetNativeView());
- XID window_xid = x11_util::GetX11WindowFromGtkWidget(GetNativeView());
- gpu_view_host_.reset(new GpuViewHost(host_, window_xid));
- }
- return gpu_view_host_->CreateBackingStore(size);
- }
-
return new BackingStoreX(host_, size,
x11_util::GetVisualFromGtkWidget(view_.get()),
gtk_widget_get_visual(view_.get())->depth);
}
-VideoLayer* RenderWidgetHostViewGtk::AllocVideoLayer(const gfx::Size& size) {
- if (enable_gpu_rendering_) {
- // TODO(scherkus): is it possible for a video layer to be allocated before a
- // backing store?
- DCHECK(gpu_view_host_.get())
- << "AllocVideoLayer() called before AllocBackingStore()";
- return gpu_view_host_->CreateVideoLayer(size);
- }
-
- return new VideoLayerX(host_, size,
- x11_util::GetVisualFromGtkWidget(view_.get()),
- gtk_widget_get_visual(view_.get())->depth);
-}
-
void RenderWidgetHostViewGtk::SetBackground(const SkBitmap& background) {
RenderWidgetHostView::SetBackground(background);
host_->Send(new ViewMsg_SetBackground(host_->routing_id(), background));
@@ -842,17 +807,6 @@ void RenderWidgetHostViewGtk::ModifyEventForEdgeDragging(
}
void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
- if (enable_gpu_rendering_) {
- // When we're proxying painting, we don't actually display the web page
- // ourselves.
- if (gpu_view_host_.get())
- gpu_view_host_->OnWindowPainted();
-
- // Erase the background. This will prevent a flash of black when resizing
- // or exposing the window. White is usually better than black.
- return;
- }
-
// If the GPU process is rendering directly into the View,
// call the compositor directly.
RenderWidgetHost* render_widget_host = GetRenderWidgetHost();
@@ -884,14 +838,6 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
// we don't need to double buffer.
backing_store->XShowRect(
paint_rect, x11_util::GetX11WindowFromGtkWidget(view_.get()));
-
- // Paint the video layer using XCopyArea.
- // TODO(scherkus): implement VideoLayerX::CairoShow() for grey
- // blending.
- VideoLayerX* video_layer = static_cast<VideoLayerX*>(
- host_->video_layer());
- if (video_layer)
- video_layer->XShow(x11_util::GetX11WindowFromGtkWidget(view_.get()));
} else {
// If the grey blend is showing, we make two drawing calls. Use double
// buffering to prevent flicker. Use CairoShowRect because XShowRect
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index 099da46..1817569 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -21,7 +21,6 @@
#include "webkit/glue/webcursor.h"
class RenderWidgetHost;
-class GpuViewHost;
class GtkIMContextWrapper;
class GtkKeyBindingsHandler;
#if !defined(TOOLKIT_VIEWS)
@@ -82,7 +81,6 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
virtual void SelectionChanged(const std::string& text);
virtual void ShowingContextMenu(bool showing);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size);
virtual void SetBackground(const SkBitmap& background);
virtual void CreatePluginContainer(gfx::PluginWindowHandle id);
virtual void DestroyPluginContainer(gfx::PluginWindowHandle id);
@@ -138,12 +136,6 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// The native UI widget.
OwnedWidgetGtk view_;
- // Cached value of --enable-gpu-rendering for out-of-process painting.
- bool enable_gpu_rendering_;
-
- // Non-NULL when we're doing out-of-process painting.
- scoped_ptr<GpuViewHost> gpu_view_host_;
-
// This is true when we are currently painting and thus should handle extra
// paint requests by expanding the invalid rect rather than actually
// painting.
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h
index 44807b2..154c0c5 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h
@@ -206,7 +206,6 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView {
virtual void SetTooltipText(const std::wstring& tooltip_text);
virtual void SelectionChanged(const std::string& text);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size);
virtual void SetTakesFocusOnlyOnMouseDown(bool flag);
virtual gfx::Rect GetWindowRect();
virtual gfx::Rect GetRootWindowRect();
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 92b8ea1..d8cd696 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -809,12 +809,6 @@ BackingStore* RenderWidgetHostViewMac::AllocBackingStore(
return new BackingStoreMac(render_widget_host_, size);
}
-VideoLayer* RenderWidgetHostViewMac::AllocVideoLayer(
- const gfx::Size& size) {
- NOTIMPLEMENTED();
- return NULL;
-}
-
// Sets whether or not to accept first responder status.
void RenderWidgetHostViewMac::SetTakesFocusOnlyOnMouseDown(bool flag) {
[cocoa_view_ setTakesFocusOnlyOnMouseDown:flag];
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 93b795b..014c7fd 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -18,9 +18,7 @@
#include "base/task.h"
#include "base/time.h"
#include "chrome/browser/renderer_host/backing_store_x.h"
-#include "chrome/browser/renderer_host/gpu_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
-#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/render_messages.h"
@@ -61,7 +59,6 @@ RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
RenderWidgetHostViewViews::RenderWidgetHostViewViews(RenderWidgetHost* host)
: host_(host),
- enable_gpu_rendering_(false),
about_to_validate_and_paint_(false),
is_hidden_(false),
is_loading_(false),
@@ -69,11 +66,6 @@ RenderWidgetHostViewViews::RenderWidgetHostViewViews(RenderWidgetHost* host)
visually_deemphasized_(false) {
SetFocusable(true);
host_->set_view(this);
-
- // Enable experimental out-of-process GPU rendering.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- enable_gpu_rendering_ =
- command_line->HasSwitch(switches::kEnableGPURendering);
}
RenderWidgetHostViewViews::~RenderWidgetHostViewViews() {
@@ -267,19 +259,6 @@ bool RenderWidgetHostViewViews::IsPopup() {
BackingStore* RenderWidgetHostViewViews::AllocBackingStore(
const gfx::Size& size) {
- if (enable_gpu_rendering_) {
- // Use a special GPU accelerated backing store.
- if (!gpu_view_host_.get()) {
- // Here we lazily make the GpuViewHost. This must be allocated when we
- // have a native view realized, which happens sometime after creation
- // when our owner puts us in the parent window.
- DCHECK(GetNativeView());
- XID window_xid = x11_util::GetX11WindowFromGtkWidget(GetNativeView());
- gpu_view_host_.reset(new GpuViewHost(host_, window_xid));
- }
- return gpu_view_host_->CreateBackingStore(size);
- }
-
return new BackingStoreX(host_, size,
x11_util::GetVisualFromGtkWidget(native_view()),
gtk_widget_get_visual(native_view())->depth);
@@ -289,37 +268,12 @@ gfx::NativeView RenderWidgetHostViewViews::native_view() const {
return GetWidget()->GetNativeView();
}
-VideoLayer* RenderWidgetHostViewViews::AllocVideoLayer(const gfx::Size& size) {
- if (enable_gpu_rendering_) {
- // TODO(scherkus): is it possible for a video layer to be allocated before a
- // backing store?
- DCHECK(gpu_view_host_.get())
- << "AllocVideoLayer() called before AllocBackingStore()";
- return gpu_view_host_->CreateVideoLayer(size);
- }
-
- return new VideoLayerX(host_, size,
- x11_util::GetVisualFromGtkWidget(native_view()),
- gtk_widget_get_visual(native_view())->depth);
-}
-
void RenderWidgetHostViewViews::SetBackground(const SkBitmap& background) {
RenderWidgetHostView::SetBackground(background);
host_->Send(new ViewMsg_SetBackground(host_->routing_id(), background));
}
void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) {
- if (enable_gpu_rendering_) {
- // When we're proxying painting, we don't actually display the web page
- // ourselves.
- if (gpu_view_host_.get())
- gpu_view_host_->OnWindowPainted();
-
- // Erase the background. This will prevent a flash of black when resizing
- // or exposing the window. White is usually better than black.
- return;
- }
-
// Don't do any painting if the GPU process is rendering directly
// into the View.
RenderWidgetHost* render_widget_host = GetRenderWidgetHost();
@@ -352,15 +306,6 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) {
// we don't need to double buffer.
backing_store->XShowRect(
paint_rect, x11_util::GetX11WindowFromGtkWidget(native_view()));
-
- // Paint the video layer using XCopyArea.
- // TODO(scherkus): implement VideoLayerX::CairoShow() for grey
- // blending.
- VideoLayerX* video_layer = static_cast<VideoLayerX*>(
- host_->video_layer());
- if (video_layer)
- video_layer->XShow(
- x11_util::GetX11WindowFromGtkWidget(native_view()));
} else {
// If the grey blend is showing, we make two drawing calls. Use double
// buffering to prevent flicker. Use CairoShowRect because XShowRect
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 6ba5d4a..0ef343e 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.h
@@ -20,7 +20,6 @@
#include "webkit/glue/webcursor.h"
class RenderWidgetHost;
-class GpuViewHost;
struct NativeWebKeyboardEvent;
namespace WebKit {
@@ -71,7 +70,6 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView,
virtual void SelectionChanged(const std::string& text);
virtual void ShowingContextMenu(bool showing);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size);
virtual void SetBackground(const SkBitmap& background);
virtual void CreatePluginContainer(gfx::PluginWindowHandle id);
virtual void DestroyPluginContainer(gfx::PluginWindowHandle id);
@@ -123,12 +121,6 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView,
// The model object.
RenderWidgetHost* host_;
- // Cached value of --enable-gpu-rendering for out-of-process painting.
- bool enable_gpu_rendering_;
-
- // Non-NULL when we're doing out-of-process painting.
- scoped_ptr<GpuViewHost> gpu_view_host_;
-
// This is true when we are currently painting and thus should handle extra
// paint requests by expanding the invalid rect rather than actually
// painting.
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index c9151e7..38bbee2 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/plugin_process_host.h"
#include "chrome/browser/renderer_host/backing_store.h"
#include "chrome/browser/renderer_host/backing_store_win.h"
-#include "chrome/browser/renderer_host/gpu_view_host.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/common/chrome_constants.h"
@@ -315,10 +314,6 @@ void RenderWidgetHostViewWin::CreateWnd(HWND parent) {
new app::win::ScopedProp(m_hWnd,
chrome::kChromiumRendererIdProperty,
reinterpret_cast<HANDLE>(renderer_id)));
-
- // Uncommenting this will enable experimental out-of-process painting.
- // Contact brettw for more,
- // gpu_view_host_.reset(new GpuViewHost(render_widget_host_, m_hWnd));
}
///////////////////////////////////////////////////////////////////////////////
@@ -791,17 +786,9 @@ void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) {
BackingStore* RenderWidgetHostViewWin::AllocBackingStore(
const gfx::Size& size) {
- if (gpu_view_host_.get())
- return gpu_view_host_->CreateBackingStore(size);
return new BackingStoreWin(render_widget_host_, size);
}
-VideoLayer* RenderWidgetHostViewWin::AllocVideoLayer(
- const gfx::Size& size) {
- NOTIMPLEMENTED();
- return NULL;
-}
-
void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
RenderWidgetHostView::SetBackground(background);
Send(new ViewMsg_SetBackground(render_widget_host_->routing_id(),
@@ -890,16 +877,6 @@ void RenderWidgetHostViewWin::OnDestroy() {
void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) {
DCHECK(render_widget_host_->process()->HasConnection());
- if (gpu_view_host_.get()) {
- // When we're proxying painting, we don't actually display the web page
- // ourselves. We clear it white in case the proxy window isn't visible
- // yet we won't show gibberish.
- CPaintDC paint_dc(m_hWnd);
- FillRect(paint_dc.m_hDC, &paint_dc.m_ps.rcPaint,
- static_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)));
- return;
- }
-
// If the GPU process is rendering directly into the View,
// call the compositor directly.
RenderWidgetHost* render_widget_host = GetRenderWidgetHost();
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index e20a364..5d8c680 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -41,7 +41,6 @@ class Message;
class BackingStore;
class RenderWidgetHost;
-class GpuViewHost;
typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0>
RenderWidgetHostHWNDTraits;
@@ -156,7 +155,6 @@ class RenderWidgetHostViewWin
virtual void Destroy();
virtual void SetTooltipText(const std::wstring& tooltip_text);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size);
virtual void SetBackground(const SkBitmap& background);
virtual bool ContainsNativeView(gfx::NativeView native_view) const;
virtual void SetVisuallyDeemphasized(bool deemphasized);
@@ -268,10 +266,6 @@ class RenderWidgetHostViewWin
// The associated Model.
RenderWidgetHost* render_widget_host_;
- // If we're doing out-of-process painting, this member will be non-NULL,
- // indicating the gpu view we're using for the painting.
- scoped_ptr<GpuViewHost> gpu_view_host_;
-
// The cursor for the page. This is passed up from the renderer.
WebCursor current_cursor_;
diff --git a/chrome/browser/renderer_host/test/test_backing_store.cc b/chrome/browser/renderer_host/test/test_backing_store.cc
index d90c7fd..cf7e7fa 100644
--- a/chrome/browser/renderer_host/test/test_backing_store.cc
+++ b/chrome/browser/renderer_host/test/test_backing_store.cc
@@ -16,8 +16,7 @@ void TestBackingStore::PaintToBackingStore(
RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously) {
+ const std::vector<gfx::Rect>& copy_rects) {
}
bool TestBackingStore::CopyFromBackingStore(const gfx::Rect& rect,
diff --git a/chrome/browser/renderer_host/test/test_backing_store.h b/chrome/browser/renderer_host/test/test_backing_store.h
index f9db76e..d8f257b 100644
--- a/chrome/browser/renderer_host/test/test_backing_store.h
+++ b/chrome/browser/renderer_host/test/test_backing_store.h
@@ -18,8 +18,7 @@ class TestBackingStore : public BackingStore {
virtual void PaintToBackingStore(RenderProcessHost* process,
TransportDIB::Id bitmap,
const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects,
- bool* painted_synchronously);
+ const std::vector<gfx::Rect>& copy_rects);
virtual bool CopyFromBackingStore(const gfx::Rect& rect,
skia::PlatformCanvas* output);
virtual void ScrollBackingStore(int dx, int dy,
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc
index fb201bc..f3988e1 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -114,12 +114,6 @@ BackingStore* TestRenderWidgetHostView::AllocBackingStore(
return new TestBackingStore(rwh_, size);
}
-VideoLayer* TestRenderWidgetHostView::AllocVideoLayer(
- const gfx::Size& size) {
- NOTIMPLEMENTED();
- return NULL;
-}
-
#if defined(OS_MACOSX)
void TestRenderWidgetHostView::ShowPopupWithItems(
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index f33e7ff..fe58b68 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -88,7 +88,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void PrepareToDestroy() {}
virtual void SetTooltipText(const std::wstring& tooltip_text) {}
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual VideoLayer* AllocVideoLayer(const gfx::Size& size);
#if defined(OS_MACOSX)
virtual void SetTakesFocusOnlyOnMouseDown(bool flag) {}
virtual void ShowPopupWithItems(gfx::Rect bounds,
diff --git a/chrome/browser/renderer_host/video_layer.cc b/chrome/browser/renderer_host/video_layer.cc
deleted file mode 100644
index 1555060..0000000
--- a/chrome/browser/renderer_host/video_layer.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/video_layer.h"
-
-VideoLayer::VideoLayer(RenderWidgetHost* widget, const gfx::Size& size)
- : render_widget_host_(widget),
- size_(size) {
-}
-
-VideoLayer::~VideoLayer() {
-}
diff --git a/chrome/browser/renderer_host/video_layer.h b/chrome/browser/renderer_host/video_layer.h
deleted file mode 100644
index 0d7d4f8..0000000
--- a/chrome/browser/renderer_host/video_layer.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_
-#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_
-#pragma once
-
-#include "app/surface/transport_dib.h"
-#include "gfx/size.h"
-
-class RenderProcessHost;
-class RenderWidgetHost;
-
-namespace gfx {
-class Rect;
-}
-
-// Represents a layer of YUV data owned by RenderWidgetHost and composited with
-// the backing store. VideoLayer is responsible for converting to RGB as
-// needed.
-class VideoLayer {
- public:
- virtual ~VideoLayer();
-
- RenderWidgetHost* render_widget_host() const { return render_widget_host_; }
- const gfx::Size& size() { return size_; }
-
- // Copy the incoming bitmap into this video layer. |bitmap| contains YUV
- // pixel data in YV12 format and must be the same dimensions as this video
- // layer. |bitmap_rect| specifies the absolute position and destination size
- // of the bitmap on the backing store.
- virtual void CopyTransportDIB(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect) = 0;
-
- protected:
- // Can only be constructed via subclasses.
- VideoLayer(RenderWidgetHost* widget, const gfx::Size& size);
-
- private:
- // The owner of this video layer.
- RenderWidgetHost* render_widget_host_;
-
- // The size of the video layer.
- gfx::Size size_;
-
- DISALLOW_COPY_AND_ASSIGN(VideoLayer);
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_
diff --git a/chrome/browser/renderer_host/video_layer_proxy.cc b/chrome/browser/renderer_host/video_layer_proxy.cc
deleted file mode 100644
index 3df1d25..0000000
--- a/chrome/browser/renderer_host/video_layer_proxy.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/video_layer_proxy.h"
-
-#include "chrome/browser/gpu_process_host_ui_shim.h"
-#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/common/gpu_messages.h"
-#include "gfx/rect.h"
-
-VideoLayerProxy::VideoLayerProxy(RenderWidgetHost* widget,
- const gfx::Size& size,
- GpuProcessHostUIShim* process_shim,
- int32 routing_id)
- : VideoLayer(widget, size),
- process_shim_(process_shim),
- routing_id_(routing_id) {
- process_shim_->AddRoute(routing_id_, this);
-}
-
-VideoLayerProxy::~VideoLayerProxy() {
- process_shim_->RemoveRoute(routing_id_);
-}
-
-void VideoLayerProxy::CopyTransportDIB(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect) {
- base::ProcessId process_id;
-#if defined(OS_WIN)
- process_id = ::GetProcessId(process->GetHandle());
-#elif defined(OS_POSIX)
- process_id = process->GetHandle();
-#endif
-
- if (process_shim_->Send(new GpuMsg_PaintToVideoLayer(
- routing_id_, process_id, bitmap, bitmap_rect))) {
- } else {
- // TODO(scherkus): what to do ?!?!
- }
-}
-
-void VideoLayerProxy::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(VideoLayerProxy, msg)
- IPC_MESSAGE_HANDLER(GpuHostMsg_PaintToVideoLayer_ACK,
- OnPaintToVideoLayerACK)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void VideoLayerProxy::OnChannelConnected(int32 peer_pid) {
-}
-
-void VideoLayerProxy::OnChannelError() {
-}
-
-void VideoLayerProxy::OnPaintToVideoLayerACK() {
- // TODO(scherkus): we may not need to ACK video layer updates at all.
- NOTIMPLEMENTED();
-}
diff --git a/chrome/browser/renderer_host/video_layer_proxy.h b/chrome/browser/renderer_host/video_layer_proxy.h
deleted file mode 100644
index 4a4cc71..0000000
--- a/chrome/browser/renderer_host/video_layer_proxy.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_
-#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_
-#pragma once
-
-#include "chrome/browser/renderer_host/video_layer.h"
-#include "ipc/ipc_channel.h"
-
-class GpuProcessHostUIShim;
-
-// Proxies YUV video layer data to the GPU process for rendering.
-class VideoLayerProxy : public VideoLayer, public IPC::Channel::Listener {
- public:
- VideoLayerProxy(RenderWidgetHost* widget, const gfx::Size& size,
- GpuProcessHostUIShim* process_shim, int32 routing_id);
- virtual ~VideoLayerProxy();
-
- // VideoLayer implementation.
- virtual void CopyTransportDIB(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect);
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- private:
- // Called when GPU process has finished painting the video layer.
- void OnPaintToVideoLayerACK();
-
- // GPU process receiving our proxied requests.
- GpuProcessHostUIShim* process_shim_;
-
- // IPC routing ID to use when communicating with the GPU process.
- int32 routing_id_;
-
- DISALLOW_COPY_AND_ASSIGN(VideoLayerProxy);
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_
diff --git a/chrome/browser/renderer_host/video_layer_x.cc b/chrome/browser/renderer_host/video_layer_x.cc
deleted file mode 100644
index 09891b3..0000000
--- a/chrome/browser/renderer_host/video_layer_x.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#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 "media/base/yuv_convert.h"
-
-
-// Assume that somewhere along the line, someone will do width * height * 4
-// with signed numbers. If the maximum value is 2**31, then 2**31 / 4 =
-// 2**29 and floor(sqrt(2**29)) = 23170.
-
-// Max height and width for layers
-static const int kMaxVideoLayerSize = 23170;
-
-VideoLayerX::VideoLayerX(RenderWidgetHost* widget,
- const gfx::Size& size,
- void* visual,
- int depth)
- : VideoLayer(widget, size),
- visual_(visual),
- depth_(depth),
- display_(x11_util::GetXDisplay()),
- rgb_frame_size_(0) {
- DCHECK(!size.IsEmpty());
-
- // Create our pixmap + GC representing an RGB version of a video frame.
- pixmap_ = XCreatePixmap(display_, x11_util::GetX11RootWindow(),
- size.width(), size.height(), depth_);
- pixmap_gc_ = XCreateGC(display_, pixmap_, 0, NULL);
- pixmap_bpp_ = x11_util::BitsPerPixelForPixmapDepth(display_, depth_);
-}
-
-VideoLayerX::~VideoLayerX() {
- // In unit tests, |display_| may be NULL.
- if (!display_)
- return;
-
- XFreePixmap(display_, pixmap_);
- XFreeGC(display_, static_cast<GC>(pixmap_gc_));
-}
-
-void VideoLayerX::CopyTransportDIB(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect) {
- if (!display_)
- return;
-
- if (bitmap_rect.IsEmpty())
- return;
-
- if (bitmap_rect.size() != size()) {
- LOG(ERROR) << "Scaled video layer not supported.";
- return;
- }
-
- // Save location and size of destination bitmap.
- rgb_rect_ = bitmap_rect;
-
- const int width = bitmap_rect.width();
- const int height = bitmap_rect.height();
- const size_t new_rgb_frame_size = static_cast<size_t>(width * height * 4);
-
- if (width <= 0 || width > kMaxVideoLayerSize ||
- height <= 0 || height > kMaxVideoLayerSize)
- return;
-
- // Lazy allocate |rgb_frame_|.
- if (!rgb_frame_.get() || rgb_frame_size_ < new_rgb_frame_size) {
- // TODO(scherkus): handle changing dimensions and re-allocating.
- CHECK(size() == rgb_rect_.size());
- rgb_frame_.reset(new uint8[new_rgb_frame_size]);
- rgb_frame_size_ = new_rgb_frame_size;
- }
-
- TransportDIB* dib = process->GetTransportDIB(bitmap);
- if (!dib)
- return;
-
- // Perform colour space conversion.
- const uint8* y_plane = reinterpret_cast<uint8*>(dib->memory());
- const uint8* u_plane = y_plane + width * height;
- const uint8* v_plane = u_plane + ((width * height) >> 2);
- media::ConvertYUVToRGB32(y_plane,
- u_plane,
- v_plane,
- rgb_frame_.get(),
- width,
- height,
- width,
- width / 2,
- width * 4,
- media::YV12);
-
- // Draw ARGB frame onto our pixmap.
- x11_util::PutARGBImage(display_, visual_, depth_, pixmap_, pixmap_gc_,
- rgb_frame_.get(), width, height);
-}
-
-void VideoLayerX::XShow(XID target) {
- if (rgb_rect_.IsEmpty())
- return;
-
- XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_),
- 0, 0, rgb_rect_.width(), rgb_rect_.height(),
- rgb_rect_.x(), rgb_rect_.y());
-}
diff --git a/chrome/browser/renderer_host/video_layer_x.h b/chrome/browser/renderer_host/video_layer_x.h
deleted file mode 100644
index a12c7b4..0000000
--- a/chrome/browser/renderer_host/video_layer_x.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_
-#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_
-#pragma once
-
-#include "app/x11_util.h"
-#include "base/scoped_ptr.h"
-#include "chrome/browser/renderer_host/video_layer.h"
-#include "gfx/rect.h"
-
-// Implements a YUV data layer using X to hold the RGB data.
-class VideoLayerX : public VideoLayer {
- public:
- VideoLayerX(RenderWidgetHost* widget, const gfx::Size& size, void* visual,
- int depth);
- virtual ~VideoLayerX();
-
- // VideoLayer implementation.
- virtual void CopyTransportDIB(RenderProcessHost* process,
- TransportDIB::Id bitmap,
- const gfx::Rect& bitmap_rect);
-
- // Copy from the server-side video layer to the target window.
- // Unlike BackingStore, we maintain the absolute position and destination
- // size so passing in a rect is not required.
- void XShow(XID target);
-
- private:
- // X Visual to get RGB mask information.
- void* const visual_;
- // Depth of the target window.
- int depth_;
- // Connection to the X server where this video layer will be displayed.
- Display* const display_;
-
- // Handle to the server side pixmap which is our video layer.
- XID pixmap_;
- // Graphics context for painting our video layer.
- void* pixmap_gc_;
- // Server side bits-per-pixel for |pixmap_|.
- int pixmap_bpp_;
-
- // Most recently converted frame stored as 32-bit ARGB.
- scoped_array<uint8> rgb_frame_;
- size_t rgb_frame_size_;
-
- // Destination size and absolution position of the converted frame.
- gfx::Rect rgb_rect_;
-
- DISALLOW_COPY_AND_ASSIGN(VideoLayerX);
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index f8e17cf..6900688 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -701,8 +701,6 @@
'../skia/skia.gyp:skia',
],
'sources': [
- 'gpu/gpu_backing_store_win.cc',
- 'gpu/gpu_backing_store_win.h',
'gpu/gpu_channel.cc',
'gpu/gpu_channel.h',
'gpu/gpu_command_buffer_stub.cc',
@@ -722,8 +720,6 @@
'gpu/gpu_video_decoder.h',
'gpu/gpu_video_service.cc',
'gpu/gpu_video_service.h',
- 'gpu/gpu_view_win.cc',
- 'gpu/gpu_view_win.h',
'gpu/media/gpu_video_device.h',
'gpu/media/fake_gl_video_decode_engine.cc',
'gpu/media/fake_gl_video_decode_engine.h',
@@ -795,16 +791,8 @@
}],
['OS=="linux" and target_arch!="arm"', {
'sources': [
- 'gpu/gpu_backing_store_glx.cc',
- 'gpu/gpu_backing_store_glx.h',
- 'gpu/gpu_backing_store_glx_context.cc',
- 'gpu/gpu_backing_store_glx_context.h',
- 'gpu/gpu_view_x.cc',
- 'gpu/gpu_view_x.h',
'gpu/x_util.cc',
'gpu/x_util.h',
- 'gpu/gpu_video_layer_glx.cc',
- 'gpu/gpu_video_layer_glx.h',
],
}],
['enable_gpu==1', {
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index a494f84..9ff7768 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2515,8 +2515,6 @@
'browser/renderer_host/backing_store_manager.h',
'browser/renderer_host/backing_store_mac.h',
'browser/renderer_host/backing_store_mac.mm',
- 'browser/renderer_host/backing_store_proxy.cc',
- 'browser/renderer_host/backing_store_proxy.h',
'browser/renderer_host/backing_store_win.cc',
'browser/renderer_host/backing_store_win.h',
'browser/renderer_host/backing_store_x.cc',
@@ -2538,8 +2536,6 @@
'browser/renderer_host/file_utilities_dispatcher_host.cc',
'browser/renderer_host/file_utilities_dispatcher_host.h',
'browser/renderer_host/global_request_id.h',
- 'browser/renderer_host/gpu_view_host.cc',
- 'browser/renderer_host/gpu_view_host.h',
'browser/renderer_host/accelerated_surface_container_mac.cc',
'browser/renderer_host/accelerated_surface_container_mac.h',
'browser/renderer_host/accelerated_surface_container_manager_mac.cc',
@@ -2607,12 +2603,6 @@
'browser/renderer_host/socket_stream_host.h',
'browser/renderer_host/sync_resource_handler.cc',
'browser/renderer_host/sync_resource_handler.h',
- 'browser/renderer_host/video_layer.cc',
- 'browser/renderer_host/video_layer.h',
- 'browser/renderer_host/video_layer_proxy.cc',
- 'browser/renderer_host/video_layer_proxy.h',
- 'browser/renderer_host/video_layer_x.cc',
- 'browser/renderer_host/video_layer_x.h',
'browser/renderer_host/web_cache_manager.cc',
'browser/renderer_host/web_cache_manager.h',
'browser/renderer_host/x509_user_cert_resource_handler.cc',
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 2f446ac..8645f5d 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -76,8 +76,6 @@
'renderer/media/gles2_video_decode_context.h',
'renderer/media/ipc_video_decoder.cc',
'renderer/media/ipc_video_decoder.h',
- 'renderer/media/ipc_video_renderer.cc',
- 'renderer/media/ipc_video_renderer.h',
'renderer/net/predictor_queue.cc',
'renderer/net/predictor_queue.h',
'renderer/net/renderer_net_predictor.cc',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 4160bc0..1a6b7d0 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -434,9 +434,6 @@ const char kEnableIPv6[] = "enable-ipv6";
// Enable the GPU plugin and Pepper 3D rendering.
const char kEnableGPUPlugin[] = "enable-gpu-plugin";
-// Enable experimental GPU rendering for backing store and video.
-const char kEnableGPURendering[] = "enable-gpu-rendering";
-
// Force logging to be enabled. Logging is disabled by default in release
// builds.
const char kEnableLogging[] = "enable-logging";
@@ -531,10 +528,6 @@ const char kEnableVerticalTabs[] = "enable-vertical-tabs";
// incomplete and this flag is used for development and testing.
const char kEnableVideoFullscreen[] = "enable-video-fullscreen";
-// Enables video layering where video is rendered as a separate layer outside
-// of the backing store.
-const char kEnableVideoLayering[] = "enable-video-layering";
-
// Enables video logging where video elements log playback performance data to
// the debug log.
const char kEnableVideoLogging[] = "enable-video-logging";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 5a537ce..0e742a0 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -132,7 +132,6 @@ extern const char kEnableExtensionTimelineApi[];
extern const char kEnableFastback[];
extern const char kEnableFileCookies[];
extern const char kEnableGPUPlugin[];
-extern const char kEnableGPURendering[];
extern const char kEnableIPv6[];
extern const char kEnableLogging[];
extern const char kEnableMemoryInfo[];
@@ -163,7 +162,6 @@ extern const char kEnableTouch[];
extern const char kEnableVerbatimInstant[];
extern const char kEnableVerticalTabs[];
extern const char kEnableVideoFullscreen[];
-extern const char kEnableVideoLayering[];
extern const char kEnableVideoLogging[];
extern const char kEnableWatchdog[];
extern const char kEnableXSSAuditor[];
diff --git a/chrome/common/gpu_messages.h b/chrome/common/gpu_messages.h
index 799bc98..f932c99 100644
--- a/chrome/common/gpu_messages.h
+++ b/chrome/common/gpu_messages.h
@@ -9,7 +9,6 @@
#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/gpu_param_traits.h"
#include "gfx/native_widget_types.h"
#include "gpu/command_buffer/common/command_buffer.h"
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h
index 0b8e3e6..1b51c03 100644
--- a/chrome/common/gpu_messages_internal.h
+++ b/chrome/common/gpu_messages_internal.h
@@ -47,10 +47,6 @@ IPC_BEGIN_MESSAGES(Gpu)
// asynchronously.) Results in a GpuHostMsg_SynchronizeReply.
IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize)
- IPC_MESSAGE_CONTROL2(GpuMsg_NewRenderWidgetHostView,
- GpuNativeWindowHandle, /* parent window */
- int32 /* view_id */)
-
// Tells the GPU process to create a context for collecting graphics card
// information.
IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
@@ -61,45 +57,6 @@ IPC_BEGIN_MESSAGES(Gpu)
// Tells the GPU process to hang.
IPC_MESSAGE_CONTROL0(GpuMsg_Hang)
- // Creates a new backing store.
- IPC_MESSAGE_ROUTED2(GpuMsg_NewBackingStore,
- int32, /* backing_store_routing_id */
- gfx::Size /* size */)
-
- // Creates a new video layer.
- IPC_MESSAGE_ROUTED2(GpuMsg_NewVideoLayer,
- int32, /* video_layer_routing_id */
- gfx::Size /* size */)
-
- // Updates the backing store with the given bitmap. The GPU process will send
- // back a GpuHostMsg_PaintToBackingStore_ACK after the paint is complete to
- // let the caller know the TransportDIB can be freed or reused.
- IPC_MESSAGE_ROUTED4(GpuMsg_PaintToBackingStore,
- base::ProcessId, /* process */
- TransportDIB::Id, /* bitmap */
- gfx::Rect, /* bitmap_rect */
- std::vector<gfx::Rect>) /* copy_rects */
-
-
- IPC_MESSAGE_ROUTED4(GpuMsg_ScrollBackingStore,
- int, /* dx */
- int, /* dy */
- gfx::Rect, /* clip_rect */
- gfx::Size) /* view_size */
-
- // Tells the GPU process that the RenderWidgetHost has painted the window.
- // Depending on the platform, the accelerated content may need to be painted
- // over the top.
- IPC_MESSAGE_ROUTED0(GpuMsg_WindowPainted)
-
- // Updates the video layer with the given YUV data. The GPU process will send
- // back a GpuHostMsg_PaintToVideoLayer_ACK after the paint is complete to
- // let the caller know the TransportDIB can be freed or reused.
- IPC_MESSAGE_ROUTED3(GpuMsg_PaintToVideoLayer,
- base::ProcessId, /* process */
- TransportDIB::Id, /* bitmap */
- gfx::Rect) /* bitmap_rect */
-
IPC_END_MESSAGES(Gpu)
//------------------------------------------------------------------------------
@@ -107,12 +64,6 @@ IPC_END_MESSAGES(Gpu)
// These are messages from the GPU process to the browser.
IPC_BEGIN_MESSAGES(GpuHost)
- // Sent in response to GpuMsg_PaintToBackingStore, see that for more.
- IPC_MESSAGE_ROUTED0(GpuHostMsg_PaintToBackingStore_ACK)
-
- // Sent in response to GpuMsg_PaintToVideoLayer, see that for more.
- IPC_MESSAGE_ROUTED0(GpuHostMsg_PaintToVideoLayer_ACK)
-
// Response to a GpuHostMsg_EstablishChannel message.
IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished,
IPC::ChannelHandle, /* channel_handle */
diff --git a/chrome/common/gpu_native_window_handle.h b/chrome/common/gpu_native_window_handle.h
deleted file mode 100644
index cdc89f7..0000000
--- a/chrome/common/gpu_native_window_handle.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_COMMON_GPU_NATIVE_WINDOW_HANDLE_H_
-#define CHROME_COMMON_GPU_NATIVE_WINDOW_HANDLE_H_
-#pragma once
-
-#include "build/build_config.h"
-
-// This file defines the window handle type used by the GPU process IPC layer.
-// This is different than gfx::NativeWindow[Id] since on X, this is an XID.
-// Normally, Chrome deals with either GTK window pointers, or magic window
-// IDs that the app generates. The GPU process needs to know the real XID.
-
-#if defined(OS_WIN)
-
-#include <windows.h>
-
-typedef HWND GpuNativeWindowHandle;
-
-#elif defined(OS_MACOSX)
-
-// The GPU process isn't supported on Mac yet. Defining this arbitrarily allows
-// us to not worry about the integration points not compiling.
-typedef int GpuNativeWindowHandle;
-
-#elif defined(USE_X11)
-
-// Forward declar XID ourselves to avoid pulling in all of the X headers, which
-// can cause compile problems for some parts of the project.
-typedef unsigned long XID;
-
-typedef XID GpuNativeWindowHandle;
-
-#else
-
-#error define GpuNativeWindowHandle
-
-#endif
-
-#endif // CHROME_COMMON_GPU_NATIVE_WINDOW_HANDLE_H_
diff --git a/chrome/common/gpu_param_traits.h b/chrome/common/gpu_param_traits.h
index 59885ea..2aac31a 100644
--- a/chrome/common/gpu_param_traits.h
+++ b/chrome/common/gpu_param_traits.h
@@ -12,7 +12,6 @@
#include "chrome/common/dx_diag_node.h"
#include "chrome/common/gpu_create_command_buffer_config.h"
#include "chrome/common/gpu_info.h"
-#include "chrome/common/gpu_native_window_handle.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 6c15dd4..fb68afa 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -23,7 +23,6 @@
#include "chrome/common/translate_errors.h"
#include "chrome/common/view_types.h"
#include "chrome/common/webkit_param_traits.h"
-#include "gfx/native_widget_types.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_platform_file.h" // ifdefed typedef.
#include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h"
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index a7fbf65..2c5ca31 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -203,12 +203,6 @@ IPC_BEGIN_MESSAGES(View)
// This signals the render view that it can send another UpdateRect message.
IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK)
- // Replies to creating and updating videos.
- IPC_MESSAGE_ROUTED1(ViewMsg_CreateVideo_ACK,
- int32 /* video_id */)
- IPC_MESSAGE_ROUTED1(ViewMsg_UpdateVideo_ACK,
- int32 /* video_id */)
-
// Message payload includes:
// 1. A blob that should be cast to WebInputEvent
// 2. An optional boolean value indicating if a RawKeyDown event is associated
@@ -1315,14 +1309,6 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
ViewHostMsg_UpdateRect_Params)
- // Sent to create, update and destroy video layers.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_CreateVideo,
- gfx::Size /* size */)
- IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateVideo,
- TransportDIB::Id /* bitmap */,
- gfx::Rect /* bitmap_rect */)
- IPC_MESSAGE_ROUTED0(ViewHostMsg_DestroyVideo)
-
// Sent by the renderer when GPU compositing is enabled or disabled to notify
// the browser whether or not is should do paiting.
IPC_MESSAGE_ROUTED1(ViewHostMsg_GpuRenderingActivated,
diff --git a/chrome/gpu/gpu_backing_store_glx.cc b/chrome/gpu/gpu_backing_store_glx.cc
deleted file mode 100644
index 916a1db..0000000
--- a/chrome/gpu/gpu_backing_store_glx.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_backing_store_glx.h"
-
-#include "app/gfx/gl/gl_bindings.h"
-#include "app/surface/transport_dib.h"
-#include "base/scoped_ptr.h"
-#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_backing_store_glx_context.h"
-#include "chrome/gpu/gpu_thread.h"
-#include "chrome/gpu/gpu_view_x.h"
-#include "gfx/rect.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-
-GpuBackingStoreGLX::GpuBackingStoreGLX(GpuViewX* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size)
- : view_(view),
- gpu_thread_(gpu_thread),
- routing_id_(routing_id),
- size_(size),
- texture_id_(0) {
- gpu_thread_->AddRoute(routing_id_, this);
-
- view_->BindContext(); // Must do this before issuing OpenGl.
-
- glGenTextures(1, &texture_id_);
- glBindTexture(GL_TEXTURE_2D, texture_id_);
-
- // TODO(apatrick): This function are not available in GLES2.
- // glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-}
-
-GpuBackingStoreGLX::~GpuBackingStoreGLX() {
- if (texture_id_)
- glDeleteTextures(1, &texture_id_);
- gpu_thread_->RemoveRoute(routing_id_);
-}
-
-void GpuBackingStoreGLX::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GpuBackingStoreGLX, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_PaintToBackingStore, OnPaintToBackingStore)
- IPC_MESSAGE_HANDLER(GpuMsg_ScrollBackingStore, OnScrollBackingStore)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void GpuBackingStoreGLX::OnChannelConnected(int32 peer_pid) {
-}
-
-void GpuBackingStoreGLX::OnChannelError() {
- // FIXME(brettw) does this mean we aren't getting any more messages and we
- // should delete outselves?
- NOTIMPLEMENTED();
-}
-
-void GpuBackingStoreGLX::OnPaintToBackingStore(
- base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects) {
- scoped_ptr<TransportDIB> dib(TransportDIB::Map(id));
- view_->BindContext();
-
- scoped_ptr<skia::PlatformCanvas> canvas(
- dib->GetPlatformCanvas(bitmap_rect.width(), bitmap_rect.height()));
- const SkBitmap& transport_bitmap =
- canvas->getTopPlatformDevice().accessBitmap(false);
-
- for (size_t i = 0; i < copy_rects.size(); i++)
- PaintOneRectToBackingStore(transport_bitmap, bitmap_rect, copy_rects[i]);
-
- gpu_thread_->Send(new GpuHostMsg_PaintToBackingStore_ACK(routing_id_));
-
- view_->Repaint();
-}
-
-void GpuBackingStoreGLX::OnScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size) {
- // Create a framebuffer to render our scrolled texture into.
- GpuBackingStoreGLXContext* context = view_->gpu_thread()->GetGLXContext();
- if (!context->BindTextureForScrolling(view_->window(), size_))
- return;
-
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture_id_);
-
- // Set up the the tranform so we can paint exact pixels to the screen, with
- // (0, 0) at the bottom left.
- // TODO(apatrick): Commenting out because these variables were only used by
- // code that is now commented out.
- // float w = static_cast<float>(size_.width());
- // float h = static_cast<float>(size_.height());
- glViewport(0, 0, size_.width(), size_.height());
-
- // TODO(apatrick): These functions are not available in GLES2.
- // glLoadIdentity();
- // glOrtho(0.0, w, 0.0, h, -1.0, 1.0);
-
- // Paint the non-scrolled background of the page. Note that we try to avoid
- // this if the entire thing is scrolling, which is a common case.
- if (view_size != clip_rect.size()) {
- // TODO(apatrick): These functions are not available in GLES2.
- // glBegin(GL_QUADS);
- // glTexCoord2f(0.0f, 0.0f);
- // glVertex2f(0.0, 0.0);
-
- // glTexCoord2f(0.0f, 1.0f);
- // glVertex2f(0.0, h);
-
- // glTexCoord2f(1.0f, 1.0f);
- // glVertex2f(w, h);
-
- // glTexCoord2f(1.0f, 0.0f);
- // glVertex2f(w, 0.0);
- // glEnd();
- }
-
- // Constrain the painting to only the area we're scrolling. Compute the clip
- // rect in OpenGL pixel coords, which uses the lower-left as the origin.
- gfx::Rect gl_clip_rect(clip_rect.x(), clip_rect.y(),
- clip_rect.width(), clip_rect.height());
-
- glEnable(GL_SCISSOR_TEST);
- glScissor(gl_clip_rect.x(), gl_clip_rect.y(),
- gl_clip_rect.width(), gl_clip_rect.height());
-
- // Paint the offset texture.
- // TODO(apatrick): These functions are not available in GLES2.
- // glTranslatef(static_cast<float>(dx), static_cast<float>(dy), 0.0f);
- // glBegin(GL_QUADS);
- // glTexCoord2f(0.0f, 0.0f);
- // glVertex2f(0.0, 0.0);
-
- // glTexCoord2f(0.0f, 1.0f);
- // glVertex2f(0.0, h);
-
- // glTexCoord2f(1.0f, 1.0f);
- // glVertex2f(w, h);
-
- // glTexCoord2f(1.0f, 0.0f);
- // glVertex2f(w, 0.0);
- // glEnd();
- glDisable(GL_SCISSOR_TEST);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- texture_id_ = context->SwapTextureForScrolling(texture_id_, size_);
- glFlush();
- DCHECK(texture_id_);
-}
-
-void GpuBackingStoreGLX::PaintOneRectToBackingStore(
- const SkBitmap& transport_bitmap,
- const gfx::Rect& bitmap_rect,
- const gfx::Rect& copy_rect) {
- // Make a bitmap referring to the correct subset of the input bitmap.
- SkBitmap copy_bitmap;
- if (copy_rect.x() == 0 &&
- copy_rect.y() == 0 &&
- copy_rect.width() == bitmap_rect.width() &&
- copy_rect.height() == bitmap_rect.height()) {
- // The subregion we're being asked to copy is the full bitmap. We don't
- // have to do any extra work to make the bitmap, we can just refer to the
- // original data (bitmap assignments are just refs to the original).
- copy_bitmap = transport_bitmap;
- } else {
- // Make a rect referring to the subset into the original (copy_rect and
- // bitmap_rect are both in global coords) and make a copy of that data to
- // give to OpenGL later.
- //
- // TODO(brettw) on desktop GL (not ES) we can do a trick here using
- // GL_UNPACK_ROW_WIDTH, GL_UNPACK_SKIP_PIXELS and GL_UNPACK_SKIP_ROWS to
- // avoid this copy.
- //
- // On ES, it may be better to actually call subimage for each row of
- // the updated bitmap to avoid the copy. We will have to benchmark that
- // approach against making the copy here to see if it performs better on
- // the systems we're targeting.
- SkIRect sk_copy_rect = { copy_rect.x() - bitmap_rect.x(),
- copy_rect.y() - bitmap_rect.y(),
- copy_rect.right() - bitmap_rect.x(),
- copy_rect.bottom() - bitmap_rect.y()};
-
- // extractSubset will not acutually make a copy, and Skia will refer to the
- // original data which is not what we want, since rows won't be contiguous.
- // However, since this is very cheap, we can do it and *then* make a copy.
- SkBitmap non_copied_subset;
- transport_bitmap.extractSubset(&non_copied_subset, sk_copy_rect);
- non_copied_subset.copyTo(&copy_bitmap, SkBitmap::kARGB_8888_Config);
- CHECK(!copy_bitmap.isNull());
- }
-
- glBindTexture(GL_TEXTURE_2D, texture_id_);
-
- SkAutoLockPixels lock(copy_bitmap);
- if (copy_rect.size() == size_ && copy_rect.size() != texture_size_) {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, copy_rect.width(),
- copy_rect.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE,
- copy_bitmap.getAddr32(0, 0));
- texture_size_ = copy_rect.size();
- } else {
- /* Debugging code for why the below call may fail.
- int existing_width = 0, existing_height = 0;
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH,
- &existing_width);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT,
- &existing_height);
- */
- glTexSubImage2D(GL_TEXTURE_2D, 0, copy_rect.x(), copy_rect.y(),
- copy_rect.width(), copy_rect.height(),
- GL_BGRA, GL_UNSIGNED_BYTE,
- copy_bitmap.getAddr32(0, 0));
- /* Enable if you're having problems with TexSubImage failing.
- int err = glGetError();
- DCHECK(err == GL_NO_ERROR) << "Error " << err <<
- " copying (" << copy_rect.x() << "," << copy_rect.y() <<
- ")," << copy_rect.width() << "x" << copy_rect.height() <<
- " for bitmap " << texture_size_.width() << "x" <<
- texture_size_.height() <<
- " real size " << existing_width << "x" << existing_height <<
- " for " << this;
- */
- }
-}
diff --git a/chrome/gpu/gpu_backing_store_glx.h b/chrome/gpu/gpu_backing_store_glx.h
deleted file mode 100644
index 14b1f5f..0000000
--- a/chrome/gpu/gpu_backing_store_glx.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_BACKING_STORE_GLX_H_
-#define CHROME_GPU_GPU_BACKING_STORE_GLX_H_
-#pragma once
-
-#include "app/surface/transport_dib.h"
-#include "base/basictypes.h"
-#include "base/process.h"
-#include "gfx/size.h"
-#include "ipc/ipc_channel.h"
-#include "gfx/size.h"
-
-class GpuViewX;
-class GpuThread;
-class SkBitmap;
-
-class GpuBackingStoreGLX : public IPC::Channel::Listener {
- public:
- GpuBackingStoreGLX(GpuViewX* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size);
- ~GpuBackingStoreGLX();
-
- const gfx::Size& size() const { return size_; }
- const gfx::Size& texture_size() const { return texture_size_; }
- unsigned int texture_id() const { return texture_id_; }
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- private:
- // Message handlers.
- void OnPaintToBackingStore(base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects);
- void OnScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size);
-
- void PaintOneRectToBackingStore(const SkBitmap& transport_bitmap,
- const gfx::Rect& bitmap_rect,
- const gfx::Rect& copy_rect);
-
- GpuViewX* view_;
- GpuThread* gpu_thread_;
- int32 routing_id_;
- gfx::Size size_;
-
- unsigned int texture_id_; // 0 when uninitialized.
-
- // The size of the texture loaded into GL. This is 0x0 when there is no
- // texture loaded. This may be different than the size of the backing store
- // because we could have been resized without yet getting the updated
- // bitmap.
- gfx::Size texture_size_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuBackingStoreGLX);
-};
-
-#endif // CHROME_GPU_GPU_BACKING_STORE_GLX_H_
diff --git a/chrome/gpu/gpu_backing_store_glx_context.cc b/chrome/gpu/gpu_backing_store_glx_context.cc
deleted file mode 100644
index ea70651..0000000
--- a/chrome/gpu/gpu_backing_store_glx_context.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_backing_store_glx_context.h"
-
-#include "app/gfx/gl/gl_bindings.h"
-#include "app/x11_util.h"
-#include "base/scoped_ptr.h"
-#include "chrome/gpu/gpu_thread.h"
-
-// Must be last.
-#include <X11/Xutil.h>
-
-GpuBackingStoreGLXContext::GpuBackingStoreGLXContext(GpuThread* gpu_thread)
- : gpu_thread_(gpu_thread),
- tried_to_init_(false),
- context_(NULL),
- previous_window_id_(0),
- frame_buffer_for_scrolling_(0),
- is_frame_buffer_bound_(false),
- temp_scroll_texture_id_(0) {
-}
-
-GpuBackingStoreGLXContext::~GpuBackingStoreGLXContext() {
- if (temp_scroll_texture_id_) {
- glDeleteTextures(1, &temp_scroll_texture_id_);
- temp_scroll_texture_id_ = 0;
- }
-
- if (frame_buffer_for_scrolling_)
- glDeleteFramebuffersEXT(1, &frame_buffer_for_scrolling_);
-
- if (context_)
- glXDestroyContext(gpu_thread_->display(), context_);
-}
-
-GLXContext GpuBackingStoreGLXContext::BindContext(XID window_id) {
- DCHECK(!is_frame_buffer_bound_);
-
- if (tried_to_init_) {
- if (!context_)
- return NULL;
- if (!previous_window_id_ || previous_window_id_ != window_id) {
- bool success = glXMakeCurrent(gpu_thread_->display(), window_id,
- context_);
- DCHECK(success);
- }
- previous_window_id_ = window_id;
- return context_;
- }
- tried_to_init_ = true;
-
- int attrib_list[] = { GLX_RGBA, GLX_DOUBLEBUFFER, 0 };
- scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> visual_info(
- glXChooseVisual(gpu_thread_->display(), 0, attrib_list));
- if (!visual_info.get())
- return NULL;
-
- context_ = glXCreateContext(gpu_thread_->display(), visual_info.get(),
- NULL, True);
- bool success = glXMakeCurrent(gpu_thread_->display(), window_id, context_);
- DCHECK(success);
- return context_;
-}
-
-bool GpuBackingStoreGLXContext::BindTextureForScrolling(
- XID window_id,
- const gfx::Size& size) {
- DCHECK(!is_frame_buffer_bound_);
- BindContext(window_id);
-
- // Create a new destination texture if the old one isn't properly sized.
- // This means we try to re-use old ones without re-creating all the texture
- // to save work in the common case of scrolling a window repeatedly that
- // doesn't change size.
- if (temp_scroll_texture_id_ == 0 ||
- size != temp_scroll_texture_size_) {
- if (!temp_scroll_texture_id_) {
- // There may be no temporary one created yet.
- glGenTextures(1, &temp_scroll_texture_id_);
- }
-
- // Create a new texture in the context with random garbage in it large
- // enough to fit the required size.
- glBindTexture(GL_TEXTURE_2D, temp_scroll_texture_id_);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(),
- 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
-
- if (!frame_buffer_for_scrolling_)
- glGenFramebuffersEXT(1, &frame_buffer_for_scrolling_);
- glBindFramebufferEXT(GL_FRAMEBUFFER, frame_buffer_for_scrolling_);
- is_frame_buffer_bound_ = true;
-
- // Release our color attachment.
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- temp_scroll_texture_id_, 0);
-
- DCHECK(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
- GL_FRAMEBUFFER_COMPLETE_EXT);
- return true;
-}
-
-unsigned int GpuBackingStoreGLXContext::SwapTextureForScrolling(
- unsigned int old_texture,
- const gfx::Size& old_size) {
- // Unbind the framebuffer, which we expect to be bound.
- DCHECK(is_frame_buffer_bound_);
- glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
- is_frame_buffer_bound_ = false;
-
- DCHECK(temp_scroll_texture_id_);
- unsigned int new_texture = temp_scroll_texture_id_;
-
- temp_scroll_texture_id_ = old_texture;
- temp_scroll_texture_size_ = old_size;
-
- return new_texture;
-}
diff --git a/chrome/gpu/gpu_backing_store_glx_context.h b/chrome/gpu/gpu_backing_store_glx_context.h
deleted file mode 100644
index 0f1a8cd..0000000
--- a/chrome/gpu/gpu_backing_store_glx_context.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_BACKING_STORE_GLX_CONTEXT_H_
-#define CHROME_GPU_GPU_BACKING_STORE_GLX_CONTEXT_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "chrome/gpu/x_util.h"
-#include "gfx/size.h"
-
-class GpuThread;
-
-
-class GpuBackingStoreGLXContext {
- public:
- explicit GpuBackingStoreGLXContext(GpuThread* gpu_thread);
- ~GpuBackingStoreGLXContext();
-
- // Returns the context, creating it if necessary, and binding it to the given
- // display and window identified by the XID. This will avoid duplicate calls
- // to MakeCurrent if the display/XID hasn't changed from the last call.
- // Returns NULL on failure.
- GLXContext BindContext(XID window_id);
-
- bool BindTextureForScrolling(XID window_id,
- const gfx::Size& size);
-
- unsigned int SwapTextureForScrolling(unsigned int old_texture,
- const gfx::Size& old_size);
-
- private:
- GpuThread* gpu_thread_;
-
- // Set to true when we've tried to create the context. This prevents us from
- // trying to initialize the OpenGL context over and over in the failure case.
- bool tried_to_init_;
-
- // The OpenGL context. Non-NULL when initialized.
- GLXContext context_;
-
- // The last window we've bound our context to. This allows us to avoid
- // duplicate "MakeCurrent" calls which are expensive.
- XID previous_window_id_;
-
- // The frame buffer object we use to render scrolled images into. We'll set
- // is_frame_buffer_bound_ when the FBO is bound so we can perform some checks
- // to make sure we're not forgetting to unbind it.
- unsigned int frame_buffer_for_scrolling_;
- bool is_frame_buffer_bound_;
-
- // The temporary texture we use for scrolling. The ID will be 0 if it is
- // uninitialized. Otherwise, this will give the ID and size of an existing
- // texture that can be re-used for a temporary buffer for scrolling.
- unsigned int temp_scroll_texture_id_;
- gfx::Size temp_scroll_texture_size_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuBackingStoreGLXContext);
-};
-
-#endif // CHROME_GPU_GPU_BACKING_STORE_GLX_CONTEXT_H_
diff --git a/chrome/gpu/gpu_backing_store_win.cc b/chrome/gpu/gpu_backing_store_win.cc
deleted file mode 100644
index d5af441..0000000
--- a/chrome/gpu/gpu_backing_store_win.cc
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_backing_store_win.h"
-
-#include "app/win_util.h"
-#include "base/logging.h"
-#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_view_win.h"
-#include "chrome/gpu/gpu_thread.h"
-#include "gfx/gdi_util.h"
-
-namespace {
-
-// Creates a dib conforming to the height/width/section parameters passed in.
-HANDLE CreateDIB(HDC dc, int width, int height, int color_depth) {
- BITMAPV5HEADER hdr = {0};
- ZeroMemory(&hdr, sizeof(BITMAPV5HEADER));
-
- // These values are shared with gfx::PlatformDevice
- hdr.bV5Size = sizeof(BITMAPINFOHEADER);
- hdr.bV5Width = width;
- hdr.bV5Height = -height; // minus means top-down bitmap
- hdr.bV5Planes = 1;
- hdr.bV5BitCount = color_depth;
- hdr.bV5Compression = BI_RGB; // no compression
- hdr.bV5SizeImage = 0;
- hdr.bV5XPelsPerMeter = 1;
- hdr.bV5YPelsPerMeter = 1;
- hdr.bV5ClrUsed = 0;
- hdr.bV5ClrImportant = 0;
-
-
- void* data = NULL;
- HANDLE dib = CreateDIBSection(dc, reinterpret_cast<BITMAPINFO*>(&hdr),
- 0, &data, NULL, 0);
- DCHECK(data);
- return dib;
-}
-
-void CallStretchDIBits(HDC hdc, int dest_x, int dest_y, int dest_w, int dest_h,
- int src_x, int src_y, int src_w, int src_h, void* pixels,
- const BITMAPINFO* bitmap_info) {
- // When blitting a rectangle that touches the bottom, left corner of the
- // bitmap, StretchDIBits looks at it top-down! For more details, see
- // http://wiki.allegro.cc/index.php?title=StretchDIBits.
- int rv;
- int bitmap_h = -bitmap_info->bmiHeader.biHeight;
- int bottom_up_src_y = bitmap_h - src_y - src_h;
- if (bottom_up_src_y == 0 && src_x == 0 && src_h != bitmap_h) {
- rv = StretchDIBits(hdc,
- dest_x, dest_h + dest_y - 1, dest_w, -dest_h,
- src_x, bitmap_h - src_y + 1, src_w, -src_h,
- pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
- } else {
- rv = StretchDIBits(hdc,
- dest_x, dest_y, dest_w, dest_h,
- src_x, bottom_up_src_y, src_w, src_h,
- pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
- }
- DCHECK(rv != GDI_ERROR);
-}
-
-} // namespace
-
-
-GpuBackingStoreWin::GpuBackingStoreWin(GpuViewWin* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size)
- : view_(view),
- gpu_thread_(gpu_thread),
- routing_id_(routing_id),
- size_(size) {
- gpu_thread_->AddRoute(routing_id_, this);
-
- HDC screen_dc = ::GetDC(NULL);
- color_depth_ = ::GetDeviceCaps(screen_dc, BITSPIXEL);
- // Color depths less than 16 bpp require a palette to be specified. Instead,
- // we specify the desired color depth as 16 which lets the OS to come up
- // with an approximation.
- if (color_depth_ < 16)
- color_depth_ = 16;
- hdc_ = CreateCompatibleDC(screen_dc);
- ReleaseDC(NULL, screen_dc);
-}
-
-GpuBackingStoreWin::~GpuBackingStoreWin() {
- gpu_thread_->RemoveRoute(routing_id_);
-
- DCHECK(hdc_);
- if (original_bitmap_) {
- SelectObject(hdc_, original_bitmap_);
- }
- if (backing_store_dib_) {
- DeleteObject(backing_store_dib_);
- backing_store_dib_ = NULL;
- }
- DeleteDC(hdc_);
-}
-
-void GpuBackingStoreWin::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GpuBackingStoreWin, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_PaintToBackingStore, OnPaintToBackingStore)
- IPC_MESSAGE_HANDLER(GpuMsg_ScrollBackingStore, OnScrollBackingStore)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void GpuBackingStoreWin::OnChannelConnected(int32 peer_pid) {
-}
-
-void GpuBackingStoreWin::OnChannelError() {
- // FIXME(brettw) does this mean we aren't getting any more messages and we
- // should delete outselves?
-}
-
-void GpuBackingStoreWin::OnPaintToBackingStore(
- base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects) {
- HANDLE source_process_handle = OpenProcess(PROCESS_ALL_ACCESS,
- FALSE, source_process_id);
- CHECK(source_process_handle);
-
- // On Windows we need to duplicate the handle from the remote process.
- // See BrowserRenderProcessHost::MapTransportDIB for how to do this on other
- // platforms.
- HANDLE section = win_util::GetSectionFromProcess(
- id.handle, source_process_handle, false /* read write */);
- CHECK(section);
- scoped_ptr<TransportDIB> dib(TransportDIB::Map(section));
- CHECK(dib.get());
-
- if (!backing_store_dib_) {
- backing_store_dib_ = CreateDIB(hdc_, size_.width(),
- size_.height(), color_depth_);
- if (!backing_store_dib_) {
- NOTREACHED();
-
- // TODO(brettw): do this in such a way that we can't forget to
- // send the ACK.
- gpu_thread_->Send(new GpuHostMsg_PaintToBackingStore_ACK(routing_id_));
- return;
- }
- original_bitmap_ = SelectObject(hdc_, backing_store_dib_);
- }
-
- BITMAPINFOHEADER hdr;
- gfx::CreateBitmapHeader(bitmap_rect.width(), bitmap_rect.height(), &hdr);
- // Account for a bitmap_rect that exceeds the bounds of our view
- gfx::Rect view_rect(0, 0, size_.width(), size_.height());
-
- for (size_t i = 0; i < copy_rects.size(); i++) {
- gfx::Rect paint_rect = view_rect.Intersect(copy_rects[i]);
- CallStretchDIBits(hdc_,
- paint_rect.x(),
- paint_rect.y(),
- paint_rect.width(),
- paint_rect.height(),
- paint_rect.x() - bitmap_rect.x(),
- paint_rect.y() - bitmap_rect.y(),
- paint_rect.width(),
- paint_rect.height(),
- dib->memory(),
- reinterpret_cast<BITMAPINFO*>(&hdr));
- view_->InvalidateRect(&paint_rect.ToRECT());
- }
-
- CloseHandle(source_process_handle);
- gpu_thread_->Send(new GpuHostMsg_PaintToBackingStore_ACK(routing_id_));
-}
-
-void GpuBackingStoreWin::OnScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size) {
- RECT damaged_rect, r = clip_rect.ToRECT();
- ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect);
-
- // TODO(darin): this doesn't work if dx and dy are both non-zero!
- DCHECK(dx == 0 || dy == 0);
-
- view_->DidScrollBackingStoreRect(dx, dy, clip_rect);
-}
diff --git a/chrome/gpu/gpu_backing_store_win.h b/chrome/gpu/gpu_backing_store_win.h
deleted file mode 100644
index fc4bfd9..0000000
--- a/chrome/gpu/gpu_backing_store_win.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_BACKING_STORE_WIN_H_
-#define CHROME_GPU_GPU_BACKING_STORE_WIN_H_
-#pragma once
-
-#include <windows.h>
-
-#include <vector>
-
-#include "app/surface/transport_dib.h"
-#include "base/basictypes.h"
-#include "gfx/native_widget_types.h"
-#include "gfx/size.h"
-#include "ipc/ipc_channel.h"
-
-class GpuThread;
-class GpuViewWin;
-
-namespace gfx {
-class Rect;
-class Size;
-}
-
-class GpuBackingStoreWin : public IPC::Channel::Listener {
- public:
- GpuBackingStoreWin(GpuViewWin* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size);
- ~GpuBackingStoreWin();
-
- gfx::Size size() const { return size_; }
- HDC hdc() const { return hdc_; }
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- private:
- // Message handlers.
- void OnPaintToBackingStore(base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect,
- const std::vector<gfx::Rect>& copy_rects);
- void OnScrollBackingStore(int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size);
-
- GpuViewWin* view_;
-
- GpuThread* gpu_thread_;
- int32 routing_id_;
-
- gfx::Size size_;
-
- // The backing store dc.
- HDC hdc_;
-
- // Handle to the backing store dib.
- HANDLE backing_store_dib_;
-
- // Handle to the original bitmap in the dc.
- HANDLE original_bitmap_;
-
- // Number of bits per pixel of the screen.
- int color_depth_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuBackingStoreWin);
-};
-
-#endif // CHROME_GPU_GPU_BACKING_STORE_WIN_H_
diff --git a/chrome/gpu/gpu_config.h b/chrome/gpu/gpu_config.h
index 96a2861..884d2ff 100644
--- a/chrome/gpu/gpu_config.h
+++ b/chrome/gpu/gpu_config.h
@@ -10,12 +10,4 @@
#include "build/build_config.h"
-#if defined(OS_LINUX) && !defined(ARCH_CPU_ARMEL)
-
-// Only define GLX support for Intel CPUs for now until we can get the
-// proper dependencies and build setup for ARM.
-#define GPU_USE_GLX
-
-#endif
-
#endif // CHROME_GPU_GPU_CONFIG_H_
diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc
index 554f864..3e4d25d 100644
--- a/chrome/gpu/gpu_thread.cc
+++ b/chrome/gpu/gpu_thread.cc
@@ -17,15 +17,6 @@
#include "chrome/gpu/gpu_info_collector.h"
#include "ipc/ipc_channel_handle.h"
-#if defined(OS_WIN)
-#include "chrome/gpu/gpu_view_win.h"
-#elif defined(GPU_USE_GLX)
-#include "chrome/gpu/gpu_backing_store_glx_context.h"
-#include "chrome/gpu/gpu_view_x.h"
-
-#include <X11/Xutil.h> // Must be last.
-#endif
-
#if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h>
#include "app/x11_util.h"
@@ -33,16 +24,13 @@
#endif
GpuThread::GpuThread() {
-#if defined(GPU_USE_GLX)
- display_ = ::XOpenDisplay(NULL);
-#endif
#if defined(OS_LINUX)
{
// The X11 port of the command buffer code assumes it can access the X
// display via the macro GDK_DISPLAY(), which implies that Gtk has been
// initialized. This code was taken from PluginThread. TODO(kbr):
// rethink whether initializing Gtk is really necessary or whether we
- // should just send the display connection down to the GPUProcessor.
+ // should just send a raw display connection down to the GPUProcessor.
g_thread_init(NULL);
gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
x11_util::SetDefaultX11ErrorHandlers();
@@ -53,14 +41,6 @@ GpuThread::GpuThread() {
GpuThread::~GpuThread() {
}
-#if defined(GPU_USE_GLX)
-GpuBackingStoreGLXContext* GpuThread::GetGLXContext() {
- if (!glx_context_.get())
- glx_context_.reset(new GpuBackingStoreGLXContext(this));
- return glx_context_.get();
-}
-#endif
-
void GpuThread::RemoveChannel(int renderer_id) {
gpu_channels_.erase(renderer_id);
}
@@ -72,8 +52,6 @@ void GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
OnEstablishChannel)
IPC_MESSAGE_HANDLER(GpuMsg_Synchronize,
OnSynchronize)
- IPC_MESSAGE_HANDLER(GpuMsg_NewRenderWidgetHostView,
- OnNewRenderWidgetHostView)
IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo,
OnCollectGraphicsInfo)
IPC_MESSAGE_HANDLER(GpuMsg_Crash,
@@ -128,20 +106,6 @@ void GpuThread::OnSynchronize() {
Send(new GpuHostMsg_SynchronizeReply());
}
-void GpuThread::OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window,
- int32 routing_id) {
- // The GPUView class' lifetime is controlled by the host, which will send a
- // message to destroy the GpuRWHView when necessary. So we don't manage the
- // lifetime of this object.
-#if defined(OS_WIN)
- new GpuViewWin(this, parent_window, routing_id);
-#elif defined(GPU_USE_GLX)
- new GpuViewX(this, parent_window, routing_id);
-#else
- NOTIMPLEMENTED();
-#endif
-}
-
void GpuThread::OnCollectGraphicsInfo() {
// Fail to establish a channel if some implementation of GL cannot be
// initialized.
diff --git a/chrome/gpu/gpu_thread.h b/chrome/gpu/gpu_thread.h
index b896360..65a0234 100644
--- a/chrome/gpu/gpu_thread.h
+++ b/chrome/gpu/gpu_thread.h
@@ -10,27 +10,16 @@
#include "base/scoped_ptr.h"
#include "build/build_config.h"
#include "chrome/common/child_thread.h"
-#include "chrome/common/gpu_native_window_handle.h"
#include "chrome/gpu/gpu_channel.h"
#include "chrome/gpu/gpu_config.h"
#include "chrome/gpu/x_util.h"
#include "gfx/native_widget_types.h"
-#if defined(GPU_USE_GLX)
-class GpuBackingStoreGLXContext;
-#endif
-
class GpuThread : public ChildThread {
public:
GpuThread();
~GpuThread();
-#if defined(GPU_USE_GLX)
- GpuBackingStoreGLXContext* GetGLXContext();
-
- Display* display() const { return display_; }
-#endif
-
// Remove the channel for a particular renderer.
void RemoveChannel(int renderer_id);
@@ -44,17 +33,10 @@ class GpuThread : public ChildThread {
void OnCollectGraphicsInfo();
void OnCrash();
void OnHang();
- void OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window,
- int32 routing_id);
typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap;
GpuChannelMap gpu_channels_;
-#if defined(GPU_USE_GLX)
- Display* display_;
- scoped_ptr<GpuBackingStoreGLXContext> glx_context_;
-#endif
-
DISALLOW_COPY_AND_ASSIGN(GpuThread);
};
diff --git a/chrome/gpu/gpu_video_layer_glx.cc b/chrome/gpu/gpu_video_layer_glx.cc
deleted file mode 100644
index d0578ad..0000000
--- a/chrome/gpu/gpu_video_layer_glx.cc
+++ /dev/null
@@ -1,332 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_video_layer_glx.h"
-
-#include "app/gfx/gl/gl_bindings.h"
-#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_thread.h"
-#include "chrome/gpu/gpu_view_x.h"
-
-// Handy constants for addressing YV12 data.
-static const int kYUVPlanes = 3;
-static const int kYPlane = 0;
-static const int kUPlane = 1;
-static const int kVPlane = 2;
-
-// Buffer size for shader compile errors.
-static const unsigned int kErrorSize = 4096;
-
-// Matrix used for the YUV to RGB conversion.
-static const float kYUV2RGB[9] = {
- 1.f, 0.f, 1.403f,
- 1.f, -.344f, -.714f,
- 1.f, 1.772f, 0.f,
-};
-
-// Texture coordinates mapping the entire texture.
-static const float kTextureCoords[8] = {
- 0, 0,
- 0, 1,
- 1, 0,
- 1, 1,
-};
-
-#define I915_WORKAROUND
-
-// Pass-through vertex shader.
-static const char kVertexShader[] =
- "varying vec2 interp_tc;\n"
- "\n"
- "attribute vec4 in_pos;\n"
- "attribute vec2 in_tc;\n"
- "\n"
- "void main() {\n"
-#if defined(I915_WORKAROUND)
- " gl_TexCoord[0].st = in_tc;\n"
-#else
- " interp_tc = in_tc;\n"
-#endif
- " gl_Position = in_pos;\n"
- "}\n";
-
-// YUV to RGB pixel shader. Loads a pixel from each plane and pass through the
-// matrix.
-static const char kFragmentShader[] =
- "varying vec2 interp_tc;\n"
- "\n"
- "uniform sampler2D y_tex;\n"
- "uniform sampler2D u_tex;\n"
- "uniform sampler2D v_tex;\n"
- "uniform mat3 yuv2rgb;\n"
- "\n"
- "void main() {\n"
-#if defined(I915_WORKAROUND)
- " float y = texture2D(y_tex, gl_TexCoord[0].st).x;\n"
- " float u = texture2D(u_tex, gl_TexCoord[0].st).r - .5;\n"
- " float v = texture2D(v_tex, gl_TexCoord[0].st).r - .5;\n"
- " float r = y + v * 1.403;\n"
- " float g = y - u * 0.344 - v * 0.714;\n"
- " float b = y + u * 1.772;\n"
- " gl_FragColor = vec4(r, g, b, 1);\n"
-#else
- " float y = texture2D(y_tex, interp_tc).x;\n"
- " float u = texture2D(u_tex, interp_tc).r - .5;\n"
- " float v = texture2D(v_tex, interp_tc).r - .5;\n"
- " vec3 rgb = yuv2rgb * vec3(y, u, v);\n"
- " gl_FragColor = vec4(rgb, 1);\n"
-#endif
- "}\n";
-
-
-// Assume that somewhere along the line, someone will do width * height * 4
-// with signed numbers. If the maximum value is 2**31, then 2**31 / 4 =
-// 2**29 and floor(sqrt(2**29)) = 23170.
-
-// Max height and width for layers
-static const int kMaxVideoLayerSize = 23170;
-
-GpuVideoLayerGLX::GpuVideoLayerGLX(GpuViewX* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size)
- : view_(view),
- gpu_thread_(gpu_thread),
- routing_id_(routing_id),
- native_size_(size),
- program_(0) {
- memset(textures_, 0, sizeof(textures_));
-
- // Load identity vertices.
- gfx::Rect identity(0, 0, 1, 1);
- CalculateVertices(identity.size(), identity, target_vertices_);
-
- gpu_thread_->AddRoute(routing_id_, this);
-
- view_->BindContext(); // Must do this before issuing OpenGl.
-
- // TODO(apatrick): These functions are not available in GLES2.
- // glMatrixMode(GL_MODELVIEW);
-
- // Create 3 textures, one for each plane, and bind them to different
- // texture units.
- glGenTextures(kYUVPlanes, textures_);
-
- glBindTexture(GL_TEXTURE_2D, textures_[kYPlane]);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glBindTexture(GL_TEXTURE_2D, textures_[kUPlane]);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glBindTexture(GL_TEXTURE_2D, textures_[kVPlane]);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- // Create our YUV->RGB shader.
- program_ = glCreateProgram();
- GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
- const char* vs_source = kVertexShader;
- int vs_size = sizeof(kVertexShader);
- glShaderSource(vertex_shader, 1, &vs_source, &vs_size);
- glCompileShader(vertex_shader);
- int result = GL_FALSE;
- glGetShaderiv(vertex_shader, GL_COMPILE_STATUS, &result);
- if (!result) {
- char log[kErrorSize];
- int len;
- glGetShaderInfoLog(vertex_shader, kErrorSize - 1, &len, log);
- log[kErrorSize - 1] = 0;
- LOG(FATAL) << log;
- }
- glAttachShader(program_, vertex_shader);
- glDeleteShader(vertex_shader);
-
- GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
- const char* ps_source = kFragmentShader;
- int ps_size = sizeof(kFragmentShader);
- glShaderSource(fragment_shader, 1, &ps_source, &ps_size);
- glCompileShader(fragment_shader);
- result = GL_FALSE;
- glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &result);
- if (!result) {
- char log[kErrorSize];
- int len;
- glGetShaderInfoLog(fragment_shader, kErrorSize - 1, &len, log);
- log[kErrorSize - 1] = 0;
- LOG(FATAL) << log;
- }
- glAttachShader(program_, fragment_shader);
- glDeleteShader(fragment_shader);
-
- glLinkProgram(program_);
- result = GL_FALSE;
- glGetProgramiv(program_, GL_LINK_STATUS, &result);
- if (!result) {
- char log[kErrorSize];
- int len;
- glGetProgramInfoLog(program_, kErrorSize - 1, &len, log);
- log[kErrorSize - 1] = 0;
- LOG(FATAL) << log;
- }
-}
-
-GpuVideoLayerGLX::~GpuVideoLayerGLX() {
- // TODO(scherkus): this seems like a bad idea.. we might be better off with
- // separate Initialize()/Teardown() calls instead.
- view_->BindContext();
- if (program_) {
- glDeleteProgram(program_);
- }
-
- gpu_thread_->RemoveRoute(routing_id_);
-}
-
-void GpuVideoLayerGLX::Render(const gfx::Size& viewport_size) {
- // Nothing to do if we're not visible or have no YUV data.
- if (target_rect_.IsEmpty()) {
- return;
- }
-
- // Calculate the position of our quad.
- CalculateVertices(viewport_size, target_rect_, target_vertices_);
-
- // Bind Y, U and V textures to texture units.
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, textures_[kYPlane]);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, textures_[kUPlane]);
- glActiveTexture(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_2D, textures_[kVPlane]);
-
- // Bind vertex/fragment shader program.
- glUseProgram(program_);
-
- // Bind parameters.
- glUniform1i(glGetUniformLocation(program_, "y_tex"), 0);
- glUniform1i(glGetUniformLocation(program_, "u_tex"), 1);
- glUniform1i(glGetUniformLocation(program_, "v_tex"), 2);
-
-#if !defined(I915_WORKAROUND)
- int yuv2rgb_location = glGetUniformLocation(program_, "yuv2rgb");
- glUniformMatrix3fv(yuv2rgb_location, 1, GL_TRUE, kYUV2RGB);
-#endif
-
- // TODO(scherkus): instead of calculating and loading a geometry each time,
- // we should store a constant geometry in a VBO and use a vertex shader.
- int pos_location = glGetAttribLocation(program_, "in_pos");
- glEnableVertexAttribArray(pos_location);
- glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0,
- target_vertices_);
-
- int tc_location = glGetAttribLocation(program_, "in_tc");
- glEnableVertexAttribArray(tc_location);
- glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0,
- kTextureCoords);
-
- // Render!
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- // Reset back to original state.
- glDisableVertexAttribArray(pos_location);
- glDisableVertexAttribArray(tc_location);
- glActiveTexture(GL_TEXTURE0);
- glUseProgram(0);
-}
-
-void GpuVideoLayerGLX::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GpuVideoLayerGLX, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_PaintToVideoLayer, OnPaintToVideoLayer)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void GpuVideoLayerGLX::OnChannelConnected(int32 peer_pid) {
-}
-
-void GpuVideoLayerGLX::OnChannelError() {
- // FIXME(brettw) does this mean we aren't getting any more messages and we
- // should delete outselves?
- NOTIMPLEMENTED();
-}
-
-void GpuVideoLayerGLX::OnPaintToVideoLayer(base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect) {
- // TODO(scherkus): |native_size_| is set in constructor, so perhaps this check
- // should be a DCHECK().
- const int width = native_size_.width();
- const int height = native_size_.height();
- const int stride = width;
-
- if (width <= 0 || width > kMaxVideoLayerSize ||
- height <= 0 || height > kMaxVideoLayerSize)
- return;
-
- TransportDIB* dib = TransportDIB::Map(id);
- if (!dib)
- return;
-
- // Everything looks good, update our target position and size.
- target_rect_ = bitmap_rect;
-
- // Perform colour space conversion.
- uint8* planes[kYUVPlanes];
- planes[kYPlane] = reinterpret_cast<uint8*>(dib->memory());
- planes[kUPlane] = planes[kYPlane] + width * height;
- planes[kVPlane] = planes[kUPlane] + ((width * height) >> 2);
-
- view_->BindContext(); // Must do this before issuing OpenGl.
-
- // Assume YV12 format.
- for (int i = 0; i < kYUVPlanes; ++i) {
- int plane_width = (i == kYPlane ? width : width / 2);
- int plane_height = (i == kYPlane ? height : height / 2);
- int plane_stride = (i == kYPlane ? stride : stride / 2);
-
- // Ensure that we will not read outside the shared mem region.
- if (planes[i] >= planes[kYPlane] &&
- (dib->size() - (planes[kYPlane] - planes[i])) >=
- static_cast<unsigned int>(plane_width * plane_height)) {
- glActiveTexture(GL_TEXTURE0 + i);
- glBindTexture(GL_TEXTURE_2D, textures_[i]);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, plane_stride);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, plane_width, plane_height, 0,
- GL_LUMINANCE, GL_UNSIGNED_BYTE, planes[i]);
- }
- }
-
- // Reset back to original state.
- glActiveTexture(GL_TEXTURE0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glFlush();
-
- // TODO(scherkus): we may not need to ACK video layer updates at all.
- gpu_thread_->Send(new GpuHostMsg_PaintToVideoLayer_ACK(routing_id_));
-}
-
-// static
-void GpuVideoLayerGLX::CalculateVertices(const gfx::Size& world,
- const gfx::Rect& object,
- float* vertices) {
- // Don't forget GL has a flipped Y-axis!
- float width = world.width();
- float height = world.height();
-
- // Top left.
- vertices[0] = 2.0f * (object.x() / width) - 1.0f;
- vertices[1] = -2.0f * (object.y() / height) + 1.0f;
-
- // Bottom left.
- vertices[2] = 2.0f * (object.x() / width) - 1.0f;
- vertices[3] = -2.0f * (object.bottom() / height) + 1.0f;
-
- // Top right.
- vertices[4] = 2.0f * (object.right() / width) - 1.0f;
- vertices[5] = -2.0f * (object.y() / height) + 1.0f;
-
- // Bottom right.
- vertices[6] = 2.0f * (object.right() / width) - 1.0f;
- vertices[7] = -2.0f * (object.bottom() / height) + 1.0f;
-}
diff --git a/chrome/gpu/gpu_video_layer_glx.h b/chrome/gpu/gpu_video_layer_glx.h
deleted file mode 100644
index 4b3497f..0000000
--- a/chrome/gpu/gpu_video_layer_glx.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_
-#define CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_
-#pragma once
-
-#include "app/surface/transport_dib.h"
-#include "base/basictypes.h"
-#include "base/process.h"
-#include "gfx/rect.h"
-#include "gfx/size.h"
-#include "ipc/ipc_channel.h"
-#include "gfx/rect.h"
-#include "gfx/size.h"
-
-class GpuViewX;
-class GpuThread;
-
-class GpuVideoLayerGLX : public IPC::Channel::Listener {
- public:
- GpuVideoLayerGLX(GpuViewX* view,
- GpuThread* gpu_thread,
- int32 routing_id,
- const gfx::Size& size);
- virtual ~GpuVideoLayerGLX();
-
- // Renders the video layer using the current GL context with respect to the
- // given |viewport_size|.
- //
- // TODO(scherkus): we also need scrolling information to determine where
- // exactly to place our quad.
- void Render(const gfx::Size& viewport_size);
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- private:
- // Message handlers.
- void OnPaintToVideoLayer(base::ProcessId source_process_id,
- TransportDIB::Id id,
- const gfx::Rect& bitmap_rect);
-
- // Calculates vertices for |object| relative to |world|, where |world| is
- // assumed to represent a full-screen quad. |vertices| should be an array of
- // 8 floats.
- //
- // TODO(scherkus): not sure how to describe what this does.
- static void CalculateVertices(const gfx::Size& world,
- const gfx::Rect& object,
- float* vertices);
-
- // GPU process related.
- GpuViewX* view_;
- GpuThread* gpu_thread_;
- int32 routing_id_;
-
- // The native size of the incoming YUV frames.
- gfx::Size native_size_;
-
- // The target absolute position and size of the RGB frames.
- gfx::Rect target_rect_;
-
- // The target absolute position and size expressed as quad vertices.
- float target_vertices_[8];
-
- // 3 textures, one for each plane.
- unsigned int textures_[3];
-
- // Shader program for YUV->RGB conversion.
- unsigned int program_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuVideoLayerGLX);
-};
-
-#endif // CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_
diff --git a/chrome/gpu/gpu_view_win.cc b/chrome/gpu/gpu_view_win.cc
deleted file mode 100644
index afedbd4..0000000
--- a/chrome/gpu/gpu_view_win.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_view_win.h"
-
-#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_backing_store_win.h"
-#include "chrome/gpu/gpu_thread.h"
-#include "gfx/rect.h"
-
-namespace {
-
-void DrawBackground(const RECT& dirty_rect, CPaintDC* dc) {
- HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
- dc->FillRect(&dirty_rect, white_brush);
-}
-
-void DrawResizeCorner(const RECT& dirty_rect, HDC dc) {
- // TODO(brettw): implement this.
-}
-
-} // namespace
-
-GpuViewWin::GpuViewWin(GpuThread* gpu_thread,
- HWND parent,
- int32 routing_id)
- : gpu_thread_(gpu_thread),
- routing_id_(routing_id),
- parent_(parent) {
- gpu_thread_->AddRoute(routing_id_, this);
- Create(parent_);
- SetWindowText(L"GPU window");
- ShowWindow(SW_SHOW);
-}
-
-GpuViewWin::~GpuViewWin() {
- gpu_thread_->RemoveRoute(routing_id_);
- // TODO(brettw) may want to delete any dangling backing stores, or perhaps
- // assert if one still exists.
-}
-
-void GpuViewWin::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GpuViewWin, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_NewBackingStore, OnNewBackingStore)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void GpuViewWin::OnChannelConnected(int32 peer_pid) {
-}
-
-void GpuViewWin::OnChannelError() {
- // TODO(brettw) do we need to delete ourselves now?
-}
-
-void GpuViewWin::DidScrollBackingStoreRect(int dx, int dy,
- const gfx::Rect& rect) {
- // We need to pass in SW_INVALIDATE to ScrollWindowEx. The documentation on
- // MSDN states that it only applies to the HRGN argument, which is wrong.
- // Not passing in this flag does not invalidate the region which was scrolled
- // from, thus causing painting issues.
- RECT clip_rect = rect.ToRECT();
- ScrollWindowEx(dx, dy, NULL, &clip_rect, NULL, NULL, SW_INVALIDATE);
-}
-
-void GpuViewWin::OnNewBackingStore(int32 routing_id, const gfx::Size& size) {
- backing_store_.reset(
- new GpuBackingStoreWin(this, gpu_thread_, routing_id, size));
- MoveWindow(0, 0, size.width(), size.height(), TRUE);
-}
-
-void GpuViewWin::OnPaint(HDC unused_dc) {
- // Grab the region to paint before creation of paint_dc since it clears the
- // damage region.
- ScopedGDIObject<HRGN> damage_region(CreateRectRgn(0, 0, 0, 0));
- GetUpdateRgn(damage_region, FALSE);
-
- CPaintDC paint_dc(m_hWnd);
-
- gfx::Rect damaged_rect(paint_dc.m_ps.rcPaint);
- if (damaged_rect.IsEmpty())
- return;
-
- if (backing_store_.get()) {
- gfx::Rect bitmap_rect(gfx::Point(), backing_store_->size());
-
- // Blit only the damaged regions from the backing store.
- DWORD data_size = GetRegionData(damage_region, 0, NULL);
- // TODO(brettw) why is the "+1" necessary here? When I remove it, the
- // page paints black, but according to the documentation, its not needed.
- scoped_array<char> region_data_buf(new char[data_size + 1]);
- RGNDATA* region_data = reinterpret_cast<RGNDATA*>(region_data_buf.get());
- GetRegionData(damage_region, data_size, region_data);
-
- RECT* region_rects = reinterpret_cast<RECT*>(region_data->Buffer);
- for (DWORD i = 0; i < region_data->rdh.nCount; ++i) {
- gfx::Rect paint_rect = bitmap_rect.Intersect(gfx::Rect(region_rects[i]));
- if (!paint_rect.IsEmpty()) {
- DrawResizeCorner(paint_rect.ToRECT(), backing_store_->hdc());
- BitBlt(paint_dc.m_hDC,
- paint_rect.x(),
- paint_rect.y(),
- paint_rect.width(),
- paint_rect.height(),
- backing_store_->hdc(),
- paint_rect.x(),
- paint_rect.y(),
- SRCCOPY);
- }
- }
-
- // Fill the remaining portion of the damaged_rect with the background
- if (damaged_rect.right() > bitmap_rect.right()) {
- RECT r;
- r.left = std::max(bitmap_rect.right(), damaged_rect.x());
- r.right = damaged_rect.right();
- r.top = damaged_rect.y();
- r.bottom = std::min(bitmap_rect.bottom(), damaged_rect.bottom());
- DrawBackground(r, &paint_dc);
- }
- if (damaged_rect.bottom() > bitmap_rect.bottom()) {
- RECT r;
- r.left = damaged_rect.x();
- r.right = damaged_rect.right();
- r.top = std::max(bitmap_rect.bottom(), damaged_rect.y());
- r.bottom = damaged_rect.bottom();
- DrawBackground(r, &paint_dc);
- }
- } else {
- DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc);
- }
-}
diff --git a/chrome/gpu/gpu_view_win.h b/chrome/gpu/gpu_view_win.h
deleted file mode 100644
index 39cbf54..0000000
--- a/chrome/gpu/gpu_view_win.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_VIEW_WIN_H_
-#define CHROME_GPU_GPU_VIEW_WIN_H_
-#pragma once
-
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlcrack.h>
-#include <atlmisc.h>
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "gfx/native_widget_types.h"
-#include "ipc/ipc_channel.h"
-
-class GpuBackingStoreWin;
-class GpuThread;
-
-namespace gfx {
-class Rect;
-class Size;
-}
-
-// WS_DISABLED means that input events will be delivered to the parent, which is
-// what we want for our overlay window.
-typedef CWinTraits<
- WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED, 0>
- GpuRenderWidgetHostViewWinTraits;
-
-class GpuViewWin
- : public IPC::Channel::Listener,
- public CWindowImpl<GpuViewWin,
- CWindow,
- GpuRenderWidgetHostViewWinTraits> {
- public:
- GpuViewWin(GpuThread* gpu_thread,
- HWND parent,
- int32 routing_id);
- ~GpuViewWin();
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- void DidScrollBackingStoreRect(int dx, int dy, const gfx::Rect& rect);
-
- BEGIN_MSG_MAP(GpuViewWin)
- MSG_WM_PAINT(OnPaint)
- END_MSG_MAP()
-
- private:
- // IPC message handlers.
- void OnNewBackingStore(int32 routing_id, const gfx::Size& size);
-
- // Windows message handlers.
- void OnPaint(HDC unused_dc);
-
- GpuThread* gpu_thread_;
- int32 routing_id_;
-
- HWND parent_;
-
- scoped_ptr<GpuBackingStoreWin> backing_store_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuViewWin);
-};
-
-#endif // CHROME_GPU_GPU_VIEW_WIN_H_
diff --git a/chrome/gpu/gpu_view_x.cc b/chrome/gpu/gpu_view_x.cc
deleted file mode 100644
index d9fd9d7..0000000
--- a/chrome/gpu/gpu_view_x.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/gpu_view_x.h"
-
-#include "app/gfx/gl/gl_bindings.h"
-#include "base/scoped_ptr.h"
-#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_backing_store_glx.h"
-#include "chrome/gpu/gpu_backing_store_glx_context.h"
-#include "chrome/gpu/gpu_thread.h"
-#include "chrome/gpu/gpu_video_layer_glx.h"
-
-// X stuff must be last since it does "#define Status int" which messes up some
-// of the header files we indirectly pull in.
-#include <X11/Xutil.h>
-
-GpuViewX::GpuViewX(GpuThread* gpu_thread,
- XID parent,
- int32 routing_id)
- : gpu_thread_(gpu_thread),
- routing_id_(routing_id),
- window_(parent) {
- gpu_thread_->AddRoute(routing_id_, this);
-}
-
-GpuViewX::~GpuViewX() {
- gpu_thread_->RemoveRoute(routing_id_);
- // TODO(brettw) may want to delete any dangling backing stores, or perhaps
- // assert if one still exists.
-}
-
-GLXContext GpuViewX::BindContext() {
- GLXContext ctx = gpu_thread_->GetGLXContext()->BindContext(window_);
- CHECK(ctx);
- return ctx;
-}
-
-void GpuViewX::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GpuViewX, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_NewBackingStore, OnNewBackingStore)
- IPC_MESSAGE_HANDLER(GpuMsg_NewVideoLayer, OnNewVideoLayer)
- IPC_MESSAGE_HANDLER(GpuMsg_WindowPainted, OnWindowPainted)
- IPC_END_MESSAGE_MAP_EX()
-}
-
-void GpuViewX::OnChannelConnected(int32 peer_pid) {
-}
-
-void GpuViewX::OnChannelError() {
- // TODO(brettw) do we need to delete ourselves now?
-}
-
-void GpuViewX::DidScrollBackingStoreRect(int dx, int dy,
- const gfx::Rect& rect) {
-}
-
-void GpuViewX::Repaint() {
- BindContext();
-
- const gfx::Size& size = backing_store_->size();
-
- glViewport(0, 0, size.width(), size.height());
-
- // TODO(apatrick): These functions are not available in GLES2.
- // glMatrixMode(GL_MODELVIEW);
- // glLoadIdentity();
-
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, backing_store_->texture_id());
-
- // TODO(brettw) use vertex buffers.
- // TODO(brettw) make this so we use the texture size rather than the whole
- // area size so we don't stretch bitmaps.
- // TODO(apatrick): These functions are not available in GLES2.
- // glBegin(GL_QUADS);
- // glTexCoord2f(0.0f, 0.0f);
- // glVertex2f(-1.0, 1.0);
-
- // glTexCoord2f(0.0f, 1.0f);
- // glVertex2f(-1.0, -1.0);
-
- // glTexCoord2f(1.0f, 1.0f);
- // glVertex2f(1.0, -1.0);
-
- // glTexCoord2f(1.0f, 0.0f);
- // glVertex2f(1.0, 1.0);
- // glEnd();
- DCHECK(glGetError() == GL_NO_ERROR);
-
- if (video_layer_.get()) {
- video_layer_->Render(backing_store_->size());
- DCHECK(glGetError() == GL_NO_ERROR);
- }
-
- // TODO(brettw) when we no longer stretch non-fitting bitmaps, we should
- // paint white over any unpainted area here.
-
- glXSwapBuffers(gpu_thread_->display(), window_);
-}
-
-void GpuViewX::OnNewBackingStore(int32 routing_id, const gfx::Size& size) {
- backing_store_.reset(
- new GpuBackingStoreGLX(this, gpu_thread_, routing_id, size));
-}
-
-void GpuViewX::OnNewVideoLayer(int32 routing_id, const gfx::Size& size) {
- video_layer_.reset(
- new GpuVideoLayerGLX(this, gpu_thread_, routing_id, size));
-}
-
-void GpuViewX::OnWindowPainted() {
- Repaint();
-}
diff --git a/chrome/gpu/gpu_view_x.h b/chrome/gpu/gpu_view_x.h
deleted file mode 100644
index a9a5ddd..0000000
--- a/chrome/gpu/gpu_view_x.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_GPU_GPU_VIEW_X_H_
-#define CHROME_GPU_GPU_VIEW_X_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "chrome/gpu/x_util.h"
-#include "gfx/native_widget_types.h"
-#include "ipc/ipc_channel.h"
-
-class GpuBackingStoreGLX;
-class GpuThread;
-class GpuVideoLayerGLX;
-
-namespace gfx {
-class Rect;
-class Size;
-}
-
-class GpuViewX
- : public IPC::Channel::Listener {
- public:
- GpuViewX(GpuThread* gpu_thread,
- XID parent,
- int32 routing_id);
- ~GpuViewX();
-
- GpuThread* gpu_thread() const { return gpu_thread_; }
- XID window() const { return window_; }
-
- // Wrapper around GPUBackingStoreGLXContext using our current window.
- GLXContext BindContext();
-
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelConnected(int32 peer_pid);
- virtual void OnChannelError();
-
- void DidScrollBackingStoreRect(int dx, int dy, const gfx::Rect& rect);
-
- void Repaint();
-
- private:
- // IPC message handlers.
- void OnNewBackingStore(int32 routing_id, const gfx::Size& size);
- void OnNewVideoLayer(int32 routing_id, const gfx::Size& size);
- void OnWindowPainted();
-
- GpuThread* gpu_thread_;
- int32 routing_id_;
-
- XID window_;
-
- scoped_ptr<GpuBackingStoreGLX> backing_store_;
-
- scoped_ptr<GpuVideoLayerGLX> video_layer_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuViewX);
-};
-
-#endif // CHROME_GPU_GPU_VIEW_X_H_
diff --git a/chrome/renderer/media/ipc_video_renderer.cc b/chrome/renderer/media/ipc_video_renderer.cc
deleted file mode 100644
index fcf8c61..0000000
--- a/chrome/renderer/media/ipc_video_renderer.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/renderer/media/ipc_video_renderer.h"
-
-#include "chrome/common/render_messages.h"
-#include "chrome/renderer/render_thread.h"
-#include "media/base/video_frame.h"
-#include "media/base/media_format.h"
-
-IPCVideoRenderer::IPCVideoRenderer(int routing_id)
- : created_(false),
- routing_id_(routing_id),
- stopped_(false, false) {
-}
-
-IPCVideoRenderer::~IPCVideoRenderer() {
-}
-
-bool IPCVideoRenderer::OnInitialize(media::VideoDecoder* decoder) {
- video_size_.SetSize(width(), height());
-
- // TODO(scherkus): we're assuming YV12 here.
- size_t size = (width() * height()) + ((width() * height()) >> 1);
- uint32 epoch = static_cast<uint32>(reinterpret_cast<size_t>(this));
- transport_dib_.reset(TransportDIB::Create(size, epoch));
- CHECK(transport_dib_.get());
-
- return true;
-}
-
-void IPCVideoRenderer::OnStop(media::FilterCallback* callback) {
- stopped_.Signal();
-
- proxy_->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &IPCVideoRenderer::DoDestroyVideo, callback));
-}
-
-void IPCVideoRenderer::OnFrameAvailable() {
- proxy_->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &IPCVideoRenderer::DoUpdateVideo));
-}
-
-void IPCVideoRenderer::SetWebMediaPlayerImplProxy(
- webkit_glue::WebMediaPlayerImpl::Proxy* proxy) {
- proxy_ = proxy;
-}
-
-void IPCVideoRenderer::SetRect(const gfx::Rect& rect) {
- DCHECK(MessageLoop::current() == proxy_->message_loop());
-
- // TODO(scherkus): this is actually a SetSize() call... there's a pending
- // WebKit bug to get this fixed up. It would be nice if this was a real
- // SetRect() call so we could get the absolute coordinates instead of relying
- // on Paint().
-}
-
-void IPCVideoRenderer::Paint(skia::PlatformCanvas* canvas,
- const gfx::Rect& dest_rect) {
- DCHECK(MessageLoop::current() == proxy_->message_loop());
-
- // Copy the rect for UpdateVideo messages.
- video_rect_ = dest_rect;
-
- if (!created_) {
- created_ = true;
- Send(new ViewHostMsg_CreateVideo(routing_id_, video_size_));
-
- // Force an update in case the first frame arrived before the first
- // Paint() call.
- DoUpdateVideo();
- }
-
- // TODO(scherkus): code to punch a hole through the backing store goes here.
- // We don't need it right away since we don't do a proper alpha composite
- // between the browser BackingStore and VideoLayer.
-}
-
-void IPCVideoRenderer::Send(IPC::Message* msg) {
- DCHECK(routing_id_ != MSG_ROUTING_NONE);
- DCHECK(routing_id_ == msg->routing_id());
-
- bool result = RenderThread::current()->Send(msg);
- LOG_IF(ERROR, !result) << "RenderThread::current()->Send(msg) failed";
-}
-
-void IPCVideoRenderer::DoUpdateVideo() {
- DCHECK(MessageLoop::current() == proxy_->message_loop());
-
- // Nothing to do if we don't know where we are positioned on the page.
- if (!created_ || video_rect_.IsEmpty() || stopped_.IsSignaled()) {
- return;
- }
-
- scoped_refptr<media::VideoFrame> frame;
- GetCurrentFrame(&frame);
- if (!frame) {
- PutCurrentFrame(frame);
- return;
- }
-
- CHECK(frame->width() == static_cast<size_t>(video_size_.width()));
- CHECK(frame->height() == static_cast<size_t>(video_size_.height()));
- CHECK(frame->format() == media::VideoFrame::YV12);
- CHECK(frame->planes() == 3);
-
- uint8* dest = reinterpret_cast<uint8*>(transport_dib_->memory());
-
- // Copy Y plane.
- const uint8* src = frame->data(media::VideoFrame::kYPlane);
- size_t stride = frame->stride(media::VideoFrame::kYPlane);
- for (size_t row = 0; row < frame->height(); ++row) {
- memcpy(dest, src, frame->width());
- dest += frame->width();
- src += stride;
- }
-
- // Copy U plane.
- src = frame->data(media::VideoFrame::kUPlane);
- stride = frame->stride(media::VideoFrame::kUPlane);
- for (size_t row = 0; row < frame->height() / 2; ++row) {
- memcpy(dest, src, frame->width() / 2);
- dest += frame->width() / 2;
- src += stride;
- }
-
- // Copy V plane.
- src = frame->data(media::VideoFrame::kVPlane);
- stride = frame->stride(media::VideoFrame::kVPlane);
- for (size_t row = 0; row < frame->height() / 2; ++row) {
- memcpy(dest, src, frame->width() / 2);
- dest += frame->width() / 2;
- src += stride;
- }
-
- PutCurrentFrame(frame);
-
- // Sanity check!
- uint8* expected = reinterpret_cast<uint8*>(transport_dib_->memory()) +
- transport_dib_->size();
- CHECK(dest == expected);
-
- Send(new ViewHostMsg_UpdateVideo(routing_id_,
- transport_dib_->id(),
- video_rect_));
-}
-
-void IPCVideoRenderer::DoDestroyVideo(media::FilterCallback* callback) {
- DCHECK(MessageLoop::current() == proxy_->message_loop());
-
- // We shouldn't receive any more messages after the browser receives this.
- Send(new ViewHostMsg_DestroyVideo(routing_id_));
-
- // Detach ourselves from the proxy.
- proxy_->SetVideoRenderer(NULL);
- proxy_ = NULL;
- if (callback) {
- callback->Run();
- delete callback;
- }
-}
diff --git a/chrome/renderer/media/ipc_video_renderer.h b/chrome/renderer/media/ipc_video_renderer.h
deleted file mode 100644
index d032469..0000000
--- a/chrome/renderer/media/ipc_video_renderer.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This video renderer implementation uses IPC to signal the browser process to
-// composite the video as a separate layer underneath the backing store.
-//
-// Extremely experimental. Use at own risk!
-
-#ifndef CHROME_RENDERER_MEDIA_IPC_VIDEO_RENDERER_H_
-#define CHROME_RENDERER_MEDIA_IPC_VIDEO_RENDERER_H_
-#pragma once
-
-#include "app/surface/transport_dib.h"
-#include "base/waitable_event.h"
-#include "gfx/rect.h"
-#include "gfx/size.h"
-#include "ipc/ipc_message.h"
-#include "media/filters/video_renderer_base.h"
-#include "webkit/glue/media/web_video_renderer.h"
-#include "webkit/glue/webmediaplayer_impl.h"
-
-class IPCVideoRenderer : public webkit_glue::WebVideoRenderer {
- public:
- explicit IPCVideoRenderer(int routing_id);
- virtual ~IPCVideoRenderer();
-
- // WebVideoRenderer implementation.
- virtual void SetWebMediaPlayerImplProxy(
- webkit_glue::WebMediaPlayerImpl::Proxy* proxy);
- virtual void SetRect(const gfx::Rect& rect);
- virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
-
- void OnUpdateVideo();
- void OnUpdateVideoAck();
- void OnDestroyVideo();
-
- protected:
- // VideoRendererBase implementation.
- virtual bool OnInitialize(media::VideoDecoder* decoder);
- virtual void OnStop(media::FilterCallback* callback);
- virtual void OnFrameAvailable();
-
- private:
- // Send an IPC message to the browser process. The routing ID of the message
- // is assumed to match |routing_id_|.
- void Send(IPC::Message* msg);
-
- // Handles updating the video on the render thread.
- void DoUpdateVideo();
-
- // Handles destroying the video on the render thread.
- void DoDestroyVideo(media::FilterCallback* callback);
-
- // Pointer to our parent object that is called to request repaints.
- scoped_refptr<webkit_glue::WebMediaPlayerImpl::Proxy> proxy_;
-
- // The size of the video.
- gfx::Size video_size_;
-
- // The rect of the video.
- gfx::Rect video_rect_;
-
- // Whether we've created the video layer on the browser.
- bool created_;
-
- // Used to transporting YUV to the browser process.
- int routing_id_;
- scoped_ptr<TransportDIB> transport_dib_;
-
- // Used to determine whether we've been instructed to stop.
- // TODO(scherkus): work around because we don't have asynchronous stopping.
- // Refer to http://crbug.com/16059
- base::WaitableEvent stopped_;
-
- DISALLOW_COPY_AND_ASSIGN(IPCVideoRenderer);
-};
-
-#endif // CHROME_RENDERER_MEDIA_IPC_VIDEO_RENDERER_H_
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 7355fae8..912042b 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -65,7 +65,6 @@
#include "chrome/renderer/localized_error.h"
#include "chrome/renderer/media/audio_renderer_impl.h"
#include "chrome/renderer/media/ipc_video_decoder.h"
-#include "chrome/renderer/media/ipc_video_renderer.h"
#include "chrome/renderer/navigation_state.h"
#include "chrome/renderer/notification_provider.h"
#include "chrome/renderer/page_click_tracker.h"
@@ -2668,18 +2667,11 @@ WebMediaPlayer* RenderView::createMediaPlayer(
routing_id());
scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer;
- if (cmd_line->HasSwitch(switches::kEnableVideoLayering)) {
- scoped_refptr<IPCVideoRenderer> renderer(
- new IPCVideoRenderer(routing_id_));
- collection->AddFilter(renderer);
- video_renderer = renderer;
- } else {
- bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging);
- scoped_refptr<webkit_glue::VideoRendererImpl> renderer(
- new webkit_glue::VideoRendererImpl(pts_logging));
- collection->AddFilter(renderer);
- video_renderer = renderer;
- }
+ bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging);
+ scoped_refptr<webkit_glue::VideoRendererImpl> renderer(
+ new webkit_glue::VideoRendererImpl(pts_logging));
+ collection->AddFilter(renderer);
+ video_renderer = renderer;
return new webkit_glue::WebMediaPlayerImpl(
client, collection.release(), bridge_factory_simple,
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 17c0ee7..79dd235 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -170,8 +170,6 @@ IPC_DEFINE_MESSAGE_MAP(RenderWidget)
IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden)
IPC_MESSAGE_HANDLER(ViewMsg_WasRestored, OnWasRestored)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck)
- IPC_MESSAGE_HANDLER(ViewMsg_CreateVideo_ACK, OnCreateVideoAck)
- IPC_MESSAGE_HANDLER(ViewMsg_UpdateVideo_ACK, OnUpdateVideoAck)
IPC_MESSAGE_HANDLER(ViewMsg_HandleInputEvent, OnHandleInputEvent)
IPC_MESSAGE_HANDLER(ViewMsg_MouseCaptureLost, OnMouseCaptureLost)
IPC_MESSAGE_HANDLER(ViewMsg_SetFocus, OnSetFocus)
@@ -317,14 +315,6 @@ void RenderWidget::OnUpdateRectAck() {
CallDoDeferredUpdate();
}
-void RenderWidget::OnCreateVideoAck(int32 video_id) {
- // TODO(scherkus): handle CreateVideo_ACK with a message filter.
-}
-
-void RenderWidget::OnUpdateVideoAck(int32 video_id) {
- // TODO(scherkus): handle UpdateVideo_ACK with a message filter.
-}
-
void RenderWidget::OnHandleInputEvent(const IPC::Message& message) {
void* iter = NULL;