summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/backing_store.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 20:34:04 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 20:34:04 +0000
commit214559a75e57b79101f3c70b08d1aa98102c520a (patch)
treed065c0e83fb5328b4e123928cd99c310334b78d6 /chrome/browser/renderer_host/backing_store.cc
parentc98fe6fa60b3262364158809ca0d462f1009709f (diff)
downloadchromium_src-214559a75e57b79101f3c70b08d1aa98102c520a.zip
chromium_src-214559a75e57b79101f3c70b08d1aa98102c520a.tar.gz
chromium_src-214559a75e57b79101f3c70b08d1aa98102c520a.tar.bz2
Linux: server side backing stores
This converts Linux to using server-side backing stores. Rather than keeping a backing store in heap memory in the browser, we create a pixmap in the X server. This means that expose messages don't require us to transport any images to the X server, we can just direct it to paint from the pixmap. Also, scrolling can be performed server side also. This greatly improves performance over remote X. Also, shared memory transport to the X server is implemented. Shared memory segments can be created in the renderer and mapped directly into the X server. Review URL: http://codereview.chromium.org/27147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/backing_store.cc')
-rw-r--r--chrome/browser/renderer_host/backing_store.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/renderer_host/backing_store.cc b/chrome/browser/renderer_host/backing_store.cc
index a68e785..8f8a1c9 100644
--- a/chrome/browser/renderer_host/backing_store.cc
+++ b/chrome/browser/renderer_host/backing_store.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/renderer_host/backing_store.h"
-class RenderWidgetHost;
+#include "chrome/browser/renderer_host/render_widget_host.h"
namespace {
@@ -22,10 +22,10 @@ static int GetBackingStoreCacheSize() {
// Creates the backing store for the host based on the dimensions passed in.
// Removes the existing backing store if there is one.
BackingStore* CreateBackingStore(RenderWidgetHost* host,
- const gfx::Rect& backing_store_rect) {
+ const gfx::Size& backing_store_size) {
BackingStoreManager::RemoveBackingStore(host);
- BackingStore* backing_store = new BackingStore(backing_store_rect.size());
+ BackingStore* backing_store = host->AllocBackingStore(backing_store_size);
int backing_store_cache_size = GetBackingStoreCacheSize();
if (backing_store_cache_size > 0) {
if (!cache)
@@ -58,21 +58,21 @@ BackingStore* BackingStoreManager::GetBackingStore(
// static
BackingStore* BackingStoreManager::PrepareBackingStore(
RenderWidgetHost* host,
- const gfx::Rect& backing_store_rect,
+ const gfx::Size& backing_store_size,
base::ProcessHandle process_handle,
TransportDIB* bitmap,
const gfx::Rect& bitmap_rect,
bool* needs_full_paint) {
- BackingStore* backing_store = GetBackingStore(host,
- backing_store_rect.size());
+ BackingStore* backing_store = GetBackingStore(host, backing_store_size);
if (!backing_store) {
// We need to get Webkit to generate a new paint here, as we
// don't have a previous snapshot.
- if (bitmap_rect != backing_store_rect) {
+ if (bitmap_rect.size() != backing_store_size ||
+ bitmap_rect.x() != 0 || bitmap_rect.y() != 0) {
DCHECK(needs_full_paint != NULL);
*needs_full_paint = true;
}
- backing_store = CreateBackingStore(host, backing_store_rect);
+ backing_store = CreateBackingStore(host, backing_store_size);
}
DCHECK(backing_store != NULL);