Index: remoting/base/util.cc |
diff --git a/remoting/base/util.cc b/remoting/base/util.cc |
index c72f3a8105fd0bd0a0a64041490f2dda23098b20..f6adcb4b9be0b71973c510843badb79c4cb36ebf 100644 |
--- a/remoting/base/util.cc |
+++ b/remoting/base/util.cc |
@@ -72,6 +72,15 @@ void CopyRGB32Rect(const uint8_t* source_buffer, |
} |
} |
+void CopyAndSwapRB(const uint8_t* source, uint8_t* dest, int length) { |
Sergey Ulanov
2016/07/19 00:42:48
Please use RGBAToARGB() from libyuv. It's optimize
Yuwei
2016/07/19 04:11:52
Wouldn't it be BGRAToRGBA()? Looks like there is n
Yuwei
2016/07/19 20:34:23
Done. Using libyuv::ABGRToARGB
Sergey Ulanov
2016/07/20 18:06:11
memcpy() itself should be already optimized.
|
+ for (int i = 0; i < length / kBytesPerPixelRGB32; i++) { |
+ dest[i * kBytesPerPixelRGB32] = source[i * kBytesPerPixelRGB32 + 2]; |
+ dest[i * kBytesPerPixelRGB32 + 1] = source[i * kBytesPerPixelRGB32 + 1]; |
+ dest[i * kBytesPerPixelRGB32 + 2] = source[i * kBytesPerPixelRGB32 + 0]; |
+ dest[i * kBytesPerPixelRGB32 + 3] = source[i * kBytesPerPixelRGB32 + 3]; |
+ } |
+} |
+ |
std::string ReplaceLfByCrLf(const std::string& in) { |
std::string out; |
out.resize(2 * in.size()); |