KoOptimizedCompositeOpFactory.cpp 1.78 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 *  Copyright (c) 2012 Dmitry Kazakov <dimula73@gmail.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include "KoOptimizedCompositeOpFactory.h"
20
#include "KoOptimizedCompositeOpFactory_p.h"
21

22 23 24 25
/**
 * We include these headers even when no vectorization
 * is available on the system to ensure they build correctly
 */
26
#include "KoOptimizedCompositeOpAlphaDarken32.h"
27
#include "KoOptimizedCompositeOpOver32.h"
28 29


30 31
#include "config-vc.h"

Boudewijn Rempt's avatar
Boudewijn Rempt committed
32
#ifdef HAVE_VC
33 34 35 36
#include <Vc/global.h>
#include <Vc/common/support.h>
#endif

37

38 39
KoCompositeOp* KoOptimizedCompositeOpFactory::createAlphaDarkenOp32(const KoColorSpace *cs)
{
Boudewijn Rempt's avatar
Boudewijn Rempt committed
40
#if defined HAVE_VC
41 42 43
    if (Vc::currentImplementationSupported()) {
        return new KoOptimizedCompositeOpAlphaDarken32(cs);
    }
44
#endif
45
    return KoOptimizedCompositeOpFactoryPrivate::createLegacyAlphaDarkenOp32(cs);
46
}
47 48 49

KoCompositeOp* KoOptimizedCompositeOpFactory::createOverOp32(const KoColorSpace *cs)
{
Boudewijn Rempt's avatar
Boudewijn Rempt committed
50
#if defined HAVE_VC
51 52 53
    if (Vc::currentImplementationSupported()) {
        return new KoOptimizedCompositeOpOver32(cs);
    }
54
#endif
55
    return KoOptimizedCompositeOpFactoryPrivate::createLegacyOverOp32(cs);
56

57
}