157641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org/* 257641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org * Copyright 2014 ARM Ltd. 357641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org * 457641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org * Use of this source code is governed by a BSD-style license that can be 557641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org * found in the LICENSE file. 657641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org */ 757641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org 857641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#include "SkMorphology_opts.h" 957641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#include "SkMorphology_opts_neon.h" 1057641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#include "SkUtilsArm.h" 1157641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org 1257641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.orgSkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type) { 1357641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#if SK_ARM_NEON_IS_NONE 1457641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return NULL; 1557641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#else 1657641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#if SK_ARM_NEON_IS_DYNAMIC 1757641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org if (!sk_cpu_arm_has_neon()) { 1857641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return NULL; 1957641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org } 2057641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#endif 2157641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org switch (type) { 2257641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org case kDilateX_SkMorphologyProcType: 2357641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return SkDilateX_neon; 2457641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org case kDilateY_SkMorphologyProcType: 2557641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return SkDilateY_neon; 2657641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org case kErodeX_SkMorphologyProcType: 2757641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return SkErodeX_neon; 2857641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org case kErodeY_SkMorphologyProcType: 2957641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return SkErodeY_neon; 3057641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org default: 3157641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org return NULL; 3257641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org } 3357641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org#endif 3457641651275c139e34be3f1cd963ff35b8362051commit-bot@chromium.org} 35