summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 07:56:19 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 07:56:19 +0000
commit42d572d97059d7ba084230dba17f45341becfc11 (patch)
tree33ca641a3fd23526fdea2ce365d4d7c2662a7bee
parent331b01d23d2d1af36bf3a144d53f5bb1c2e01f61 (diff)
downloadchromium_src-42d572d97059d7ba084230dba17f45341becfc11.zip
chromium_src-42d572d97059d7ba084230dba17f45341becfc11.tar.gz
chromium_src-42d572d97059d7ba084230dba17f45341becfc11.tar.bz2
Remove obsolete code: NineBox::ChangeWhiteToTransparent.
crrev.com/103851 added alpha transparency to png images: chrome/app/theme/find_dlg_[left|right]_bg.png Keying transparency from white pixels is no longer needed. BUG=98822 TEST=No visual differences on NineBox items (find bar, etc.) Review URL: http://codereview.chromium.org/8122016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104073 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/gtk/find_bar_gtk.cc1
-rw-r--r--chrome/browser/ui/gtk/nine_box.cc30
-rw-r--r--chrome/browser/ui/gtk/nine_box.h3
3 files changed, 0 insertions, 34 deletions
diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc
index a84611f..81e233d 100644
--- a/chrome/browser/ui/gtk/find_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/find_bar_gtk.cc
@@ -134,7 +134,6 @@ void SetDialogShape(GtkWidget* widget) {
IDR_FIND_DLG_MIDDLE_BACKGROUND,
IDR_FIND_DLG_RIGHT_BACKGROUND,
0, 0, 0, 0, 0, 0);
- dialog_shape->ChangeWhiteToTransparent();
}
dialog_shape->ContourWidget(widget);
diff --git a/chrome/browser/ui/gtk/nine_box.cc b/chrome/browser/ui/gtk/nine_box.cc
index 35dfb32..1decd3b 100644
--- a/chrome/browser/ui/gtk/nine_box.cc
+++ b/chrome/browser/ui/gtk/nine_box.cc
@@ -174,36 +174,6 @@ void NineBox::RenderTopCenterStrip(cairo_t* cr, int x, int y,
TileImage(cr, images_[1], x, y, width, height, 1.0);
}
-void NineBox::ChangeWhiteToTransparent() {
- for (int image_idx = 0; image_idx < 9; ++image_idx) {
- GdkPixbuf* pixbuf = images_[image_idx];
- if (!pixbuf)
- continue;
-
- if (!gdk_pixbuf_get_has_alpha(pixbuf))
- continue;
-
- guchar* pixels = gdk_pixbuf_get_pixels(pixbuf);
- int rowstride = gdk_pixbuf_get_rowstride(pixbuf);
- int width = gdk_pixbuf_get_width(pixbuf);
- int height = gdk_pixbuf_get_height(pixbuf);
-
- if (width * 4 > rowstride) {
- NOTREACHED();
- continue;
- }
-
- for (int i = 0; i < height; ++i) {
- for (int j = 0; j < width; ++j) {
- guchar* pixel = &pixels[i * rowstride + j * 4];
- if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) {
- pixel[3] = 0;
- }
- }
- }
- }
-}
-
void NineBox::ContourWidget(GtkWidget* widget) const {
int width = widget->allocation.width;
int height = widget->allocation.height;
diff --git a/chrome/browser/ui/gtk/nine_box.h b/chrome/browser/ui/gtk/nine_box.h
index 6a8fc85..25a86cb 100644
--- a/chrome/browser/ui/gtk/nine_box.h
+++ b/chrome/browser/ui/gtk/nine_box.h
@@ -43,9 +43,6 @@ class NineBox {
// This is split from RenderToWidget so the toolbar can use it.
void RenderTopCenterStrip(cairo_t* cr, int x, int y, int width) const;
- // Change all pixels that are white in |images_| to have 0 opacity.
- void ChangeWhiteToTransparent();
-
// Set the shape of |widget| to match that of the ninebox. Note that |widget|
// must have its own window and be allocated. Also, currently only the top
// three images are used.