From 6f3dfc1c2d1b862308fc555815cf6dcda6cf35ec Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Wed, 5 Sep 2018 19:37:36 +0900 Subject: [PATCH] lottie/render: add neon path srcOver compostion mode for solid src. Change-Id: I711dc309b02911de1155b0e788c6e79b6630fb7a --- src/vector/vdrawhelper.cpp | 14 +++++--------- src/vector/vdrawhelper_neon.cpp | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/vector/vdrawhelper.cpp b/src/vector/vdrawhelper.cpp index ccb1168..90f20eb 100644 --- a/src/vector/vdrawhelper.cpp +++ b/src/vector/vdrawhelper.cpp @@ -674,15 +674,11 @@ void vInitDrawhelperFunctions() #if defined(__ARM_NEON__) // update fast path for NEON -// extern void comp_func_solid_SourceOver_neon( -// uint32_t * dest, int length, uint32_t color, uint32_t const_alpha); -// extern void comp_func_solid_Source_neon( -// uint32_t * dest, int length, uint32_t color, uint32_t const_alpha); - -// COMP_functionForModeSolid_C[VPainter::CompModeSrc] = -// comp_func_solid_Source_neon; -// COMP_functionForModeSolid_C[VPainter::CompModeSrcOver] = -// comp_func_solid_SourceOver_neon; + extern void comp_func_solid_SourceOver_neon( + uint32_t * dest, int length, uint32_t color, uint32_t const_alpha); + + COMP_functionForModeSolid_C[VPainter::CompModeSrcOver] = + comp_func_solid_SourceOver_neon; #endif #if defined(__SSE2__) diff --git a/src/vector/vdrawhelper_neon.cpp b/src/vector/vdrawhelper_neon.cpp index 49502d1..806a8b5 100644 --- a/src/vector/vdrawhelper_neon.cpp +++ b/src/vector/vdrawhelper_neon.cpp @@ -9,6 +9,13 @@ pixman_composite_src_n_8888_asm_neon (int32_t w, int32_t dst_stride, uint32_t src); +extern "C" void +pixman_composite_over_n_8888_asm_neon(int32_t w, + int32_t h, + uint32_t *dst, + int32_t dst_stride, + uint32_t src); + void memfill32(uint32_t *dest, uint32_t value, int length) { pixman_composite_src_n_8888_asm_neon(length, @@ -18,4 +25,16 @@ void memfill32(uint32_t *dest, uint32_t value, int length) value); } +void +comp_func_solid_SourceOver_neon(uint32_t *dest, int length, uint32_t color, + uint32_t const_alpha) +{ + if (const_alpha != 255) color = BYTE_MUL(color, const_alpha); + + pixman_composite_over_n_8888_asm_neon(length, + 1, + dest, + length, + color); +} #endif -- 2.7.4