diff options
author | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 02:41:51 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 02:41:51 +0000 |
commit | f7f1b468a71842908224a46ecf6e7acb1b17af80 (patch) | |
tree | ed1f3ccd24e18fa1acc8c0579ce31dbc5ae74cde /gfx | |
parent | 76b0ed0fc52beb46dfdf3d797c4ec39668f1ab2c (diff) | |
download | chromium_src-f7f1b468a71842908224a46ecf6e7acb1b17af80.zip chromium_src-f7f1b468a71842908224a46ecf6e7acb1b17af80.tar.gz chromium_src-f7f1b468a71842908224a46ecf6e7acb1b17af80.tar.bz2 |
- Fix style issue
- Rename ScopedRegionClipping to ScopedClipRegion
TBR=pkasting
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2083009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/native_theme_win.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gfx/native_theme_win.cc b/gfx/native_theme_win.cc index 07deec1..a8e90ad 100644 --- a/gfx/native_theme_win.cc +++ b/gfx/native_theme_win.cc @@ -479,23 +479,23 @@ HRESULT NativeTheme::PaintTrackbar(HDC hdc, } // A ScopedRegion wrapper to set/restore clipping region during the scope. -class ScopedRegionClipping { +class ScopedClipRegion { public: - explicit ScopedRegionClipping(const HDC hdc) + explicit ScopedClipRegion(const HDC hdc) : hdc_(hdc), clip_(NULL) { RECT zero_rect = { 0 }; clip_ = CreateRectRgnIndirect(&zero_rect); GetClipRgn(hdc_, clip_); } - ~ScopedRegionClipping() { + ~ScopedClipRegion() { SelectClipRgn(hdc_, clip_); } private: HDC hdc_; ScopedRegion clip_; - DISALLOW_COPY_AND_ASSIGN(ScopedRegionClipping); + DISALLOW_COPY_AND_ASSIGN(ScopedClipRegion); }; HRESULT NativeTheme::PaintProgressBar(HDC hdc, @@ -503,14 +503,15 @@ HRESULT NativeTheme::PaintProgressBar(HDC hdc, int value_part_id, RECT* value_rect, skia::PlatformCanvas* canvas) const { - // For an indeterminate progress bar, we draw a moving highlight that's animated - // (by the caller) across the width of the bar. The highlight part is always - // drawn as being as wide as the bar, to scale it properly. Therefore, we need - // to clip it against the bar rect, so that as it moves, it doesn't extend past - // the ends of the bar. For a normal progress bar, we won't try to draw past - // the bar ends, so this clipping is useless, but harmless. - ScopedRegionClipping clip(hdc); - IntersectClipRect(hdc, bar_rect->left, bar_rect->top, + // For an indeterminate progress bar, we draw a moving highlight that's + // animated (by the caller) across the width of the bar. The highlight part + // is always drawn as being as wide as the bar, to scale it properly. + // Therefore, we need to clip it against the bar rect, so that as it moves, + // it doesn't extend past the ends of the bar. For a normal progress bar, + // we won't try to draw past the bar ends, so this clipping is useless, + // but harmless. + ScopedClipRegion clip(hdc); + IntersectClipRect(hdc, bar_rect->left, bar_rect->top, bar_rect->right, bar_rect->bottom); HANDLE handle = GetThemeHandle(PROGRESS); |