Add the ability for the GPU process to be used to paint the backing store of a
tab. This is the first pass and is currently a bit buggy and incomplete.
This patch refactors the backing store to make it a virtual interface which is
then implemented by the platform-specific backing stores. This cleans up the
multi-platform aspects of the old code, and also makes it possible to create
different backing stores (such as ones in another process).
This renames the BackingStore::PaintRect function to PaintToBackingStore which
clears up what it does. I would often get confused and think that it paints
the backing store to the screen.
This makes a common way to capture backing store information and adds it to the
backing store API. This removed a bunch of ugly ifdefs.
This adds the ability for a backing store to specify that the TransportDIB
should not be freed by RenderWidgetHost when painting is complete. This is
necessary since the out-of-process version needs to use it after the
RenderWidget paint function has returned.
This pushes up the vector of copy_rect from RenderWidgetHost to the actual
BackingStores. This prevents us from sending duplicate data over IPC. It also
makes the common non-IPC case more efficient, since we end up setting up various
surfaces only once when there are multiple update rects.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/523028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36075 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc
new file mode 100644
index 0000000..e60cffab
--- /dev/null
+++ b/chrome/gpu/gpu_main.cc
@@ -0,0 +1,38 @@
+// 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 "base/message_loop.h"
+#include "build/build_config.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/main_function_params.h"
+#include "chrome/gpu/gpu_process.h"
+#include "chrome/gpu/gpu_thread.h"
+
+#if defined(OS_WIN)
+#include "app/win_util.h"
+#endif
+
+// Main function for starting the Gpu process.
+int GpuMain(const MainFunctionParams& parameters) {
+#if defined(USE_LINUX_BREAKPAD)
+ // Needs to be called after we have chrome::DIR_USER_DATA.
+ InitCrashReporter();
+#endif
+
+ MessageLoop main_message_loop(MessageLoop::TYPE_UI);
+ std::wstring app_name = chrome::kBrowserAppName;
+ PlatformThread::SetName(WideToASCII(app_name + L"_GpuMain").c_str());
+
+#if defined(OS_WIN)
+ win_util::ScopedCOMInitializer com_initializer;
+#endif
+
+ GpuProcess gpu_process;
+ gpu_process.set_main_thread(new GpuThread());
+
+ main_message_loop.Run();
+
+ return 0;
+}
+