diff options
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/renderer_host/backing_store.h | 52 | ||||
-rw-r--r-- | chrome/browser/renderer_host/backing_store_manager.cc (renamed from chrome/browser/renderer_host/backing_store.cc) | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/backing_store_manager.h | 68 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host.cc | 1 | ||||
-rw-r--r-- | chrome/chrome.gyp | 3 |
6 files changed, 79 insertions, 56 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index d11b0dc..108fb73 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -2168,11 +2168,15 @@ > </File> <File - RelativePath=".\renderer_host\backing_store.cc" + RelativePath=".\renderer_host\backing_store.h" > </File> <File - RelativePath=".\renderer_host\backing_store.h" + RelativePath=".\renderer_host\backing_store_manager.cc" + > + </File> + <File + RelativePath=".\renderer_host\backing_store_manager.h" > </File> <File diff --git a/chrome/browser/renderer_host/backing_store.h b/chrome/browser/renderer_host/backing_store.h index aa0a633..5d817d0 100644 --- a/chrome/browser/renderer_host/backing_store.h +++ b/chrome/browser/renderer_host/backing_store.h @@ -122,56 +122,4 @@ class BackingStore { DISALLOW_COPY_AND_ASSIGN(BackingStore); }; -// BackingStoreManager --------------------------------------------------------- - -// This class manages backing stores in the browsr. Every RenderWidgetHost is -// associated with a backing store which it requests from this class. The -// hosts don't maintain any references to the backing stores. These backing -// stores are maintained in a cache which can be trimmed as needed. -class BackingStoreManager { - public: - // Returns a backing store which matches the desired dimensions. - // - // backing_store_rect - // The desired backing store dimensions. - // Returns a pointer to the backing store on success, NULL on failure. - static BackingStore* GetBackingStore(RenderWidgetHost* host, - const gfx::Size& desired_size); - - // Returns a backing store which is fully ready for consumption, i.e. the - // bitmap from the renderer has been copied into the backing store dc, or the - // bitmap in the backing store dc references the renderer bitmap. - // - // backing_store_size - // The desired backing store dimensions. - // process_handle - // The renderer process handle. - // bitmap_section - // The bitmap section from the renderer. - // bitmap_rect - // The rect to be painted into the backing store - // needs_full_paint - // Set if we need to send out a request to paint the view - // to the renderer. - static BackingStore* PrepareBackingStore(RenderWidgetHost* host, - const gfx::Size& backing_store_size, - base::ProcessHandle process_handle, - TransportDIB* bitmap, - const gfx::Rect& bitmap_rect, - bool* needs_full_paint); - - // Returns a matching backing store for the host. - // Returns NULL if we fail to find one. - static BackingStore* Lookup(RenderWidgetHost* host); - - // Removes the backing store for the host. - static void RemoveBackingStore(RenderWidgetHost* host); - - private: - // Not intended for instantiation. - BackingStoreManager() {} - - DISALLOW_COPY_AND_ASSIGN(BackingStoreManager); -}; - #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ diff --git a/chrome/browser/renderer_host/backing_store.cc b/chrome/browser/renderer_host/backing_store_manager.cc index b354e59..3ff2e76 100644 --- a/chrome/browser/renderer_host/backing_store.cc +++ b/chrome/browser/renderer_host/backing_store_manager.cc @@ -2,9 +2,10 @@ // 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.h" +#include "chrome/browser/renderer_host/backing_store_manager.h" #include "base/sys_info.h" +#include "chrome/browser/renderer_host/backing_store.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/common/chrome_constants.h" diff --git a/chrome/browser/renderer_host/backing_store_manager.h b/chrome/browser/renderer_host/backing_store_manager.h new file mode 100644 index 0000000..5b929f6 --- /dev/null +++ b/chrome/browser/renderer_host/backing_store_manager.h @@ -0,0 +1,68 @@ +// Copyright (c) 2006-2008 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_MANAGER_H_ +#define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ + +#include "base/basictypes.h" +#include "base/gfx/rect.h" +#include "base/gfx/size.h" +#include "base/process.h" +#include "build/build_config.h" + +class BackingStore; +class RenderWidgetHost; +class TransportDIB; + +// This class manages backing stores in the browsr. Every RenderWidgetHost is +// associated with a backing store which it requests from this class. The +// hosts don't maintain any references to the backing stores. These backing +// stores are maintained in a cache which can be trimmed as needed. +class BackingStoreManager { + public: + // Returns a backing store which matches the desired dimensions. + // + // backing_store_rect + // The desired backing store dimensions. + // Returns a pointer to the backing store on success, NULL on failure. + static BackingStore* GetBackingStore(RenderWidgetHost* host, + const gfx::Size& desired_size); + + // Returns a backing store which is fully ready for consumption, i.e. the + // bitmap from the renderer has been copied into the backing store dc, or the + // bitmap in the backing store dc references the renderer bitmap. + // + // backing_store_size + // The desired backing store dimensions. + // process_handle + // The renderer process handle. + // bitmap_section + // The bitmap section from the renderer. + // bitmap_rect + // The rect to be painted into the backing store + // needs_full_paint + // Set if we need to send out a request to paint the view + // to the renderer. + static BackingStore* PrepareBackingStore(RenderWidgetHost* host, + const gfx::Size& backing_store_size, + base::ProcessHandle process_handle, + TransportDIB* bitmap, + const gfx::Rect& bitmap_rect, + bool* needs_full_paint); + + // Returns a matching backing store for the host. + // Returns NULL if we fail to find one. + static BackingStore* Lookup(RenderWidgetHost* host); + + // Removes the backing store for the host. + static void RemoveBackingStore(RenderWidgetHost* host); + + private: + // Not intended for instantiation. + BackingStoreManager() {} + + DISALLOW_COPY_AND_ASSIGN(BackingStoreManager); +}; + +#endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index dbd4cfd..fb6303b 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -8,6 +8,7 @@ #include "base/message_loop.h" #include "base/keyboard_codes.h" #include "chrome/browser/renderer_host/backing_store.h" +#include "chrome/browser/renderer_host/backing_store_manager.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_widget_helper.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 90c2b13..a82e7dc 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1151,8 +1151,9 @@ 'browser/renderer_host/async_resource_handler.h', 'browser/renderer_host/audio_renderer_host.cc', 'browser/renderer_host/audio_renderer_host.h', - 'browser/renderer_host/backing_store.cc', 'browser/renderer_host/backing_store.h', + 'browser/renderer_host/backing_store_manager.cc', + 'browser/renderer_host/backing_store_manager.h', 'browser/renderer_host/backing_store_mac.cc', 'browser/renderer_host/backing_store_win.cc', 'browser/renderer_host/backing_store_x.cc', |