summaryrefslogtreecommitdiffstats
path: root/chrome/gpu/gpu_backing_store_glx.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 05:15:42 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 05:15:42 +0000
commit7c4ea146bc033d89c1a0d527ae3d43b587a23cab (patch)
tree293c4da0b8fa44e5d4939c410434c51c8ffb872c /chrome/gpu/gpu_backing_store_glx.h
parent877cbee0688984a2a00ce074f981bdfb1e42abfa (diff)
downloadchromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.zip
chromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.tar.gz
chromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.tar.bz2
Create initial GPU backing store in the GPU process for X windows applications.
This gets the window from the RenderWidgetHostViewGtk and just does OpenGL calls directly into it. There are a lot of bugs, especially around expose events, which aren't really processed at all, and also tab teardown and reparenting. The new backing store defaults to off. This does some refactoring of the existing Windows GPU process backing store implementation to make some of it sharable by this Linux verion. This removes some previously defunct in-process GL backing store code and moves it to the GPU process. This patch does some refactoring around how child processes are created using zygoes or not. I found there were many places where a command line would be checked with special logic to know whether to enable zygote code or not. I tried to unify this so it could be computed once for each process type. This is what most of the changed files in chrome/browser are related to. BUG=none TEST=none Review URL: http://codereview.chromium.org/548112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_backing_store_glx.h')
-rw-r--r--chrome/gpu/gpu_backing_store_glx.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_backing_store_glx.h b/chrome/gpu/gpu_backing_store_glx.h
new file mode 100644
index 0000000..b0c1d65
--- /dev/null
+++ b/chrome/gpu/gpu_backing_store_glx.h
@@ -0,0 +1,65 @@
+// 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_
+
+#include "base/basictypes.h"
+#include "base/process.h"
+#include "chrome/common/transport_dib.h"
+#include "chrome/common/x11_util.h"
+#include "ipc/ipc_channel.h"
+
+class GpuViewX;
+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_