diff options
Diffstat (limited to 'base/gfx')
-rwxr-xr-x | base/gfx/gtk_util.cc | 20 | ||||
-rwxr-xr-x | base/gfx/gtk_util.h | 5 |
2 files changed, 0 insertions, 25 deletions
diff --git a/base/gfx/gtk_util.cc b/base/gfx/gtk_util.cc index 77ec95a..03acfbf 100755 --- a/base/gfx/gtk_util.cc +++ b/base/gfx/gtk_util.cc @@ -27,24 +27,4 @@ void SubtractRectanglesFromRegion(GdkRegion* region, } } -uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride) { - if (stride == 0) - stride = width * 4; - - guchar* new_pixels = static_cast<guchar*>(malloc(height * stride)); - - // We have to copy the pixels and swap from BGRA to RGBA. - for (int i = 0; i < height; ++i) { - for (int j = 0; j < width; ++j) { - int idx = i * stride + j * 4; - new_pixels[idx] = pixels[idx + 2]; - new_pixels[idx + 1] = pixels[idx + 1]; - new_pixels[idx + 2] = pixels[idx]; - new_pixels[idx + 3] = pixels[idx + 3]; - } - } - - return new_pixels; -} - } // namespace gfx diff --git a/base/gfx/gtk_util.h b/base/gfx/gtk_util.h index 3a1a1d4..110caf5 100755 --- a/base/gfx/gtk_util.h +++ b/base/gfx/gtk_util.h @@ -28,11 +28,6 @@ extern const GdkColor kGdkGreen; void SubtractRectanglesFromRegion(GdkRegion* region, const std::vector<Rect>& cutouts); -// Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. -// The caller is responsible for free()ing the data. If |stride| is 0, -// it's assumed to be 4 * |width|. -uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); - } // namespace gfx #endif // BASE_GFX_GTK_UTIL_H_ |