Commit c802c520 authored by erg@chromium.org's avatar erg@chromium.org

GTK: Remove the one user of GetRTLEnabledSurfaceNamed() and move it over to ResourceBundle().

BUG=106060
TEST=none


Review URL: http://codereview.chromium.org/8917026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114138 0039d316-1c4b-4281-b951-d872f2087c98
parent 80d341af
......@@ -901,9 +901,9 @@ gboolean FindBarGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
GtkAllocation border_allocation = bar->border_bin_->allocation;
// Blit the left part of the background image once on the left.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
gfx::CairoCachedSurface* background_left =
bar->theme_service_->GetRTLEnabledSurfaceNamed(
IDR_FIND_BOX_BACKGROUND_LEFT, widget);
rb.GetRTLEnabledImageNamed(IDR_FIND_BOX_BACKGROUND_LEFT).ToCairo();
background_left->SetSource(cr, widget,
border_allocation.x, border_allocation.y);
cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
......@@ -912,7 +912,6 @@ gboolean FindBarGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
cairo_fill(cr);
// Blit the center part of the background image in all the space between.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
gfx::CairoCachedSurface* background =
rb.GetNativeImageNamed(IDR_FIND_BOX_BACKGROUND).ToCairo();
background->SetSource(cr, widget,
......
......@@ -570,21 +570,6 @@ void GtkThemeService::GetScrollbarColors(GdkColor* thumb_active_color,
*track_color = *theme_trough_color;
}
gfx::CairoCachedSurface* GtkThemeService::GetRTLEnabledSurfaceNamed(
int id,
GtkWidget* widget_on_display) {
// We flip the sign of |id| when passing it to GetSurfaceNamedImpl() for the
// same reason that ThemeService::GetPixbufImpl() does: so that if one
// location calls this function with a resource ID, and another place calls
// GetSurfaceNamed() with the same ID, they'll correctly get different
// surfaces in RTL mode.
return GetSurfaceNamedImpl(
-id,
&per_display_surfaces_,
&GtkThemeService::GetRTLEnabledPixbufNamedWrapper,
widget_on_display);
}
gfx::CairoCachedSurface* GtkThemeService::GetCairoIcon(
int id,
GtkWidget* widget_on_display) {
......
......@@ -117,10 +117,6 @@ class GtkThemeService : public ThemeService {
// Expose the inner label. Only used for testing.
GtkWidget* fake_label() { return fake_label_.get(); }
// Same as above, but auto-mirrors the underlying pixbuf in RTL mode.
gfx::CairoCachedSurface* GetRTLEnabledSurfaceNamed(
int id, GtkWidget* widget_on_display);
// A way to get a cached cairo surface for the equivalent of GetFolderIcon()
// or GetDefaultFavicon(). Uses the ids defined in CairoDefaultIcon.
gfx::CairoCachedSurface* GetCairoIcon(int id, GtkWidget* widget_on_display);
......
......@@ -180,6 +180,9 @@ class UI_EXPORT ResourceBundle {
// This function flips it in RTL locales.
GdkPixbuf* GetRTLEnabledPixbufNamed(int resource_id);
// Same as above, but returns a gfx::Image wrapping the GdkPixbuf.
gfx::Image& GetRTLEnabledImageNamed(int resource_id);
private:
// Shared implementation for the above two functions.
gfx::Image* GetPixbufImpl(int resource_id, bool rtl_enabled);
......
......@@ -94,4 +94,8 @@ GdkPixbuf* ResourceBundle::GetRTLEnabledPixbufNamed(int resource_id) {
return *GetPixbufImpl(resource_id, true);
}
gfx::Image& ResourceBundle::GetRTLEnabledImageNamed(int resource_id) {
return *GetPixbufImpl(resource_id, true);
}
} // namespace ui
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment