Пример #1
0
bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX,
                               SkBoxBlurProc* boxBlurY,
                               SkBoxBlurProc* boxBlurXY,
                               SkBoxBlurProc* boxBlurYX) {
#if SK_ARM_NEON_IS_NONE
    return false;
#else
#if SK_ARM_NEON_IS_DYNAMIC
    if (!sk_cpu_arm_has_neon()) {
        return false;
    }
#endif
    return SkBoxBlurGetPlatformProcs_NEON(boxBlurX, boxBlurY, boxBlurXY, boxBlurYX);
#endif
}
SkMemset32Proc SkMemset32GetPlatformProc() {
    // FIXME: memset.arm.S is using syntax incompatible with XCode
#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
    return NULL;
#elif SK_ARM_NEON_IS_DYNAMIC
    if (sk_cpu_arm_has_neon()) {
        return memset32_neon;
    } else {
        return arm_memset32;
    }
#elif SK_ARM_NEON_IS_ALWAYS
    return memset32_neon;
#else
    return arm_memset32;
#endif
}
Пример #3
0
bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX,
                               SkBoxBlurProc* boxBlurY,
                               SkBoxBlurProc* boxBlurXY,
                               SkBoxBlurProc* boxBlurYX) {
    // Temporary workaround for http://skbug.com/2845
    return false;

#if SK_ARM_NEON_IS_NONE
    return false;
#else
#if SK_ARM_NEON_IS_DYNAMIC
    if (!sk_cpu_arm_has_neon()) {
        return false;
    }
#endif
    return SkBoxBlurGetPlatformProcs_NEON(boxBlurX, boxBlurY, boxBlurXY, boxBlurYX);
#endif
}
SkBlitMask::ColorProc SkBlitMask::PlatformColorProcs(SkBitmap::Config dstConfig,
                                                     SkMask::Format maskFormat,
                                                     SkColor color) {
#if SK_ARM_NEON_IS_NONE
    return NULL;
#else
#if SK_ARM_NEON_IS_DYNAMIC
    if (!sk_cpu_arm_has_neon()) {
        return NULL;
    }
#endif
    if ((SkBitmap::kARGB_8888_Config == dstConfig) &&
        (SkMask::kA8_Format == maskFormat)) {
            return D32_A8_Factory_neon(color);
    }
#endif

    // We don't need to handle the SkMask::kLCD16_Format case as the default
    // LCD16 will call us through SkBlitMask::PlatformBlitRowProcs16()

    return NULL;
}
SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
#if SK_ARM_NEON_IS_NONE
    return NULL;
#else
#if SK_ARM_NEON_IS_DYNAMIC
    if (!sk_cpu_arm_has_neon()) {
        return NULL;
    }
#endif
    switch (type) {
        case kDilateX_SkMorphologyProcType:
            return SkDilateX_neon;
        case kDilateY_SkMorphologyProcType:
            return SkDilateY_neon;
        case kErodeX_SkMorphologyProcType:
            return SkErodeX_neon;
        case kErodeY_SkMorphologyProcType:
            return SkErodeY_neon;
        default:
            return NULL;
    }
#endif
}