Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1839)

Unified Diff: base/gfx/gtk_util.cc

Issue 87016: Eliminate a circular dependency by making BGRAToRGBA() generic... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/gfx/gtk_util.h ('k') | base/linux_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/gfx/gtk_util.cc
===================================================================
--- base/gfx/gtk_util.cc (revision 14068)
+++ base/gfx/gtk_util.cc (working copy)
@@ -27,24 +27,4 @@
}
}
-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
« no previous file with comments | « base/gfx/gtk_util.h ('k') | base/linux_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698