diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 16:15:17 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 16:15:17 +0000 |
commit | 8009f23dff4aeea8b2a1b32481ffbfbb334760c5 (patch) | |
tree | c6042d4cb63f05bfd29005f97ca592a0ed44c559 /ui/gfx/native_theme_chromeos.cc | |
parent | 81bb1092f354f3cb3c597ab3c9ed568905078e49 (diff) | |
download | chromium_src-8009f23dff4aeea8b2a1b32481ffbfbb334760c5.zip chromium_src-8009f23dff4aeea8b2a1b32481ffbfbb334760c5.tar.gz chromium_src-8009f23dff4aeea8b2a1b32481ffbfbb334760c5.tar.bz2 |
Use ResourceBundle for NativeThemeLinux/Chromeos resource images.
- Clean up gfx NativeThemeLinux/Chromeos code to use ResourceBundle.
This should also fix valgrind failures in issue 77712 and 77721.
- Remove no longer needed gfx_module and gfx_resource_provider files.
- Update linux/chromeos test_shell and DumpRenderTree to use
ResourceBundle as well.
BUG=77712,77721
TEST=Build should pass and valgrind failure in issue 77712 and 77721 should be gone.
Review URL: http://codereview.chromium.org/6773021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_chromeos.cc')
-rw-r--r-- | ui/gfx/native_theme_chromeos.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/gfx/native_theme_chromeos.cc b/ui/gfx/native_theme_chromeos.cc index afa1668..fe3ed72 100644 --- a/ui/gfx/native_theme_chromeos.cc +++ b/ui/gfx/native_theme_chromeos.cc @@ -10,7 +10,7 @@ #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/core/SkShader.h" -#include "ui/gfx/gfx_module.h" +#include "ui/base/resource/resource_bundle.h" #include "ui/gfx/insets.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -298,13 +298,12 @@ gfx::Size NativeThemeChromeos::GetPartSize(Part part) const { void NativeThemeChromeos::PaintScrollbarTrack(skia::PlatformCanvas* canvas, Part part, State state, const ScrollbarTrackExtraParams& extra_params, const gfx::Rect& rect) { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); if (part == kScrollbarVerticalTrack) { - SkBitmap* background = - gfx::GfxModule::GetBitmapNamed(IDR_SCROLL_BACKGROUND); - SkBitmap* border_up = - gfx::GfxModule::GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_UP); + SkBitmap* background = rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND); + SkBitmap* border_up = rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_UP); SkBitmap* border_down = - gfx::GfxModule::GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_DOWN); + rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_DOWN); // Draw track background. DrawBitmapInt( canvas, *background, @@ -342,13 +341,14 @@ void NativeThemeChromeos::PaintScrollbarTrack(skia::PlatformCanvas* canvas, void NativeThemeChromeos::PaintScrollbarThumb(skia::PlatformCanvas* canvas, Part part, State state, const gfx::Rect& rect) { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); int resource_id = IDR_SCROLL_THUMB; if (state == kHovered) resource_id++; else if (state == kPressed) resource_id += 2; if (part == kScrollbarVerticalThumb) { - SkBitmap* bitmap = gfx::GfxModule::GetBitmapNamed(resource_id); + SkBitmap* bitmap = rb.GetBitmapNamed(resource_id); // Top DrawBitmapInt( canvas, *bitmap, @@ -386,6 +386,7 @@ void NativeThemeChromeos::PaintScrollbarThumb(skia::PlatformCanvas* canvas, void NativeThemeChromeos::PaintArrowButton(skia::PlatformCanvas* canvas, const gfx::Rect& rect, Part part, State state) { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); int resource_id = (part == kScrollbarUpArrow || part == kScrollbarLeftArrow) ? IDR_SCROLL_ARROW_UP : IDR_SCROLL_ARROW_DOWN; @@ -395,7 +396,7 @@ void NativeThemeChromeos::PaintArrowButton(skia::PlatformCanvas* canvas, resource_id += 2; SkBitmap* bitmap; if (part == kScrollbarUpArrow || part == kScrollbarDownArrow) - bitmap = gfx::GfxModule::GetBitmapNamed(resource_id); + bitmap = rb.GetBitmapNamed(resource_id); else bitmap = GetHorizontalBitmapNamed(resource_id); DrawBitmapInt(canvas, *bitmap, @@ -678,7 +679,8 @@ SkBitmap* NativeThemeChromeos::GetHorizontalBitmapNamed(int resource_id) { if (found != horizontal_bitmaps_.end()) return found->second; - SkBitmap* vertical_bitmap = gfx::GfxModule::GetBitmapNamed(resource_id); + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + SkBitmap* vertical_bitmap = rb.GetBitmapNamed(resource_id); if (vertical_bitmap) { SkBitmap transposed_bitmap = |