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

Unified Diff: src/ports/SkFontHost_FreeType_common.cpp

Issue 892453002: neon code for bgra to rgba conversion for copyFTBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added handling of SkPMColor formats and updated variable type and formatting Created 5 years, 11 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 | « src/opts/SkFontHost_FreeType_common_opts_neon.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType_common.cpp
diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp
index bd3cddf596420ae61a898636945b344d7297fd02..4e04a3daddcd3caffca4d7560bec925fa0c23c16 100644
--- a/src/ports/SkFontHost_FreeType_common.cpp
+++ b/src/ports/SkFontHost_FreeType_common.cpp
@@ -14,6 +14,9 @@
#include "SkFontHost_FreeType_common.h"
#include "SkPath.h"
+#include "SkUtilsArm.h"
+#include "SkFontHost_FreeType_common_opts_neon.h"
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_BITMAP_H
@@ -226,6 +229,14 @@ static void copyFTBitmap(const FT_Bitmap& srcFTBitmap, SkMask& dstMask) {
dst += dstRowBytes;
}
} else if (FT_PIXEL_MODE_BGRA == srcFormat && SkMask::kARGB32_Format == dstFormat) {
+#if !defined(SK_CPU_ARM64) && !defined(SK_SHOW_TEXT_BLIT_COVERAGE)
+ if (sk_cpu_arm_has_neon()) {
+ SkPackARGB32_neon(reinterpret_cast<const uint32_t*>(src),
+ reinterpret_cast<SkPMColor*>(dst), height, width, dstRowBytes,
+ srcPitch);
+ return;
+ }
+#endif
// FT_PIXEL_MODE_BGRA is pre-multiplied.
for (size_t y = height; y --> 0;) {
const uint8_t* src_row = src;
« no previous file with comments | « src/opts/SkFontHost_FreeType_common_opts_neon.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698