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

Unified Diff: remoting/base/util.cc

Issue 2148743005: [Remoting Android] Cursor & Cursor Feedback for OpenGL Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Swap BGRA to RGBA Created 4 years, 5 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
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());
« no previous file with comments | « remoting/base/util.h ('k') | remoting/client/BUILD.gn » ('j') | remoting/client/gl_cursor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698