diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-30 00:34:11 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-30 00:34:11 +0000 |
commit | 0815731ac884b41853725e51e26b0697449747b4 (patch) | |
tree | 27a55633488026d5ddf3e4c960b61588e6a286e1 /chrome/browser/renderer_host/backing_store.h | |
parent | 8ac828c751bd8f55f40a66f8054d8a3e629be211 (diff) | |
download | chromium_src-0815731ac884b41853725e51e26b0697449747b4.zip chromium_src-0815731ac884b41853725e51e26b0697449747b4.tar.gz chromium_src-0815731ac884b41853725e51e26b0697449747b4.tar.bz2 |
Fix a bunch of lint complaints in preparation to land issue 19046. Mostly formatting changes, i.e. CRLF, space at end of line.
Review URL: http://codereview.chromium.org/19486
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/backing_store.h')
-rw-r--r-- | chrome/browser/renderer_host/backing_store.h | 260 |
1 files changed, 130 insertions, 130 deletions
diff --git a/chrome/browser/renderer_host/backing_store.h b/chrome/browser/renderer_host/backing_store.h index 07ed517..eddb4c4 100644 --- a/chrome/browser/renderer_host/backing_store.h +++ b/chrome/browser/renderer_host/backing_store.h @@ -1,130 +1,130 @@ -// 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_H_
-#define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_
-
-#include "base/basictypes.h"
-#include "base/gfx/rect.h"
-#include "base/gfx/size.h"
-#include "base/process.h"
-#include "build/build_config.h"
-#include "chrome/common/mru_cache.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
-class RenderWidgetHost;
-
-// BackingStore ----------------------------------------------------------------
-
-// Represents a backing store for the pixels in a RenderWidgetHost.
-class BackingStore {
- public:
- BackingStore(const gfx::Size& size);
- ~BackingStore();
-
- const gfx::Size& size() { return size_; }
-
-#if defined(OS_WIN)
- HDC hdc() { return hdc_; }
-#endif
-
- // Paints the bitmap from the renderer onto the backing store.
- // TODO(port): The HANDLE is a shared section on Windows. Abstract this.
- bool PaintRect(base::ProcessHandle process,
- HANDLE bitmap_section,
- const gfx::Rect& bitmap_rect);
-
- // Scrolls the given rect in the backing store, replacing the given region
- // identified by |bitmap_rect| by the bitmap in the file identified by the
- // given file handle.
- // TODO(port): The HANDLE is a shared section on Windows. Abstract this.
- void ScrollRect(base::ProcessHandle process,
- HANDLE bitmap, const gfx::Rect& bitmap_rect,
- int dx, int dy,
- const gfx::Rect& clip_rect,
- const gfx::Size& view_size);
-
- private:
- // The size of the backing store.
- gfx::Size size_;
-
-#if defined(OS_WIN)
- // Creates a dib conforming to the height/width/section parameters passed
- // in. The use_os_color_depth parameter controls whether we use the color
- // depth to create an appropriate dib or not.
- HANDLE CreateDIB(HDC dc,
- int width, int height,
- bool use_os_color_depth,
- HANDLE section);
-
- // 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_;
-#endif
-
- 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_rect
- // 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.
- // TODO(port): The HANDLE is a shared section on Windows. Abstract this.
- static BackingStore* PrepareBackingStore(RenderWidgetHost* host,
- const gfx::Rect& backing_store_rect,
- base::ProcessHandle process_handle,
- HANDLE bitmap_section,
- 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_
+// 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_H_ +#define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ + +#include "base/basictypes.h" +#include "base/gfx/rect.h" +#include "base/gfx/size.h" +#include "base/process.h" +#include "build/build_config.h" +#include "chrome/common/mru_cache.h" + +#if defined(OS_WIN) +#include <windows.h> +#endif + +class RenderWidgetHost; + +// BackingStore ---------------------------------------------------------------- + +// Represents a backing store for the pixels in a RenderWidgetHost. +class BackingStore { + public: + explicit BackingStore(const gfx::Size& size); + ~BackingStore(); + + const gfx::Size& size() { return size_; } + +#if defined(OS_WIN) + HDC hdc() { return hdc_; } +#endif + + // Paints the bitmap from the renderer onto the backing store. + // TODO(port): The HANDLE is a shared section on Windows. Abstract this. + bool PaintRect(base::ProcessHandle process, + HANDLE bitmap_section, + const gfx::Rect& bitmap_rect); + + // Scrolls the given rect in the backing store, replacing the given region + // identified by |bitmap_rect| by the bitmap in the file identified by the + // given file handle. + // TODO(port): The HANDLE is a shared section on Windows. Abstract this. + void ScrollRect(base::ProcessHandle process, + HANDLE bitmap, const gfx::Rect& bitmap_rect, + int dx, int dy, + const gfx::Rect& clip_rect, + const gfx::Size& view_size); + + private: + // The size of the backing store. + gfx::Size size_; + +#if defined(OS_WIN) + // Creates a dib conforming to the height/width/section parameters passed + // in. The use_os_color_depth parameter controls whether we use the color + // depth to create an appropriate dib or not. + HANDLE CreateDIB(HDC dc, + int width, int height, + bool use_os_color_depth, + HANDLE section); + + // 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_; +#endif + + 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_rect + // 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. + // TODO(port): The HANDLE is a shared section on Windows. Abstract this. + static BackingStore* PrepareBackingStore(RenderWidgetHost* host, + const gfx::Rect& backing_store_rect, + base::ProcessHandle process_handle, + HANDLE bitmap_section, + 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_ |