11cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger/*
21cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * Copyright 2011 Google Inc.
31cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger *
41cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * Use of this source code is governed by a BSD-style license that can be
51cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * found in the LICENSE file.
61cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger */
71cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger
80910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project#include "SkBlitRow.h"
90910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project#include "SkColorPriv.h"
100910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project#include "SkDither.h"
110910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
120910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project///////////////////////////////////////////////////////////////////////////////
130910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
140910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32_D4444_Opaque(uint16_t* SK_RESTRICT dst,
150910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                             const SkPMColor* SK_RESTRICT src, int count,
160910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                             U8CPU alpha, int /*x*/, int /*y*/) {
170910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 == alpha);
180910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
190910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
200910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
210910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
220910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
230910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkASSERT(SkGetPackedA32(c) == 255);
240910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            *dst++ = SkPixel32ToPixel4444(c);
250910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
260910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
270910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
280910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
290910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32_D4444_Blend(uint16_t* SK_RESTRICT dst,
300910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                            const SkPMColor* SK_RESTRICT src, int count,
310910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                            U8CPU alpha, int /*x*/, int /*y*/) {
320910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 > alpha);
330910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
340910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
350910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        unsigned scale16 = SkAlpha255To256(alpha) >> 4;
360910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
370910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
380910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
390910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkASSERT(SkGetPackedA32(c) == 255);
400910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
410910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            uint32_t src_expand = SkExpand32_4444(c);
420910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            uint32_t dst_expand = SkExpand_4444(*dst);
430910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            dst_expand += (src_expand - dst_expand) * scale16 >> 4;
440910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            *dst++ = SkCompact_4444(dst_expand);
450910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
460910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
470910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
480910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
490910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32A_D4444_Opaque(uint16_t* SK_RESTRICT dst,
500910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                              const SkPMColor* SK_RESTRICT src, int count,
510910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                              U8CPU alpha, int /*x*/, int /*y*/) {
520910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 == alpha);
530910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
540910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
550910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
560910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
570910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
580910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project//            if (__builtin_expect(c!=0, 1))
590910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            if (c)
600910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            {
610910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned scale16 = SkAlpha255To256(255 - SkGetPackedA32(c)) >> 4;
620910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t src_expand = SkExpand_8888(c);
630910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t dst_expand = SkExpand_4444(*dst) * scale16;
640910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                *dst = SkCompact_4444((src_expand + dst_expand) >> 4);
650910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            }
660910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            dst += 1;
670910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
680910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
690910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
700910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
710910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32A_D4444_Blend(uint16_t* SK_RESTRICT dst,
720910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                             const SkPMColor* SK_RESTRICT src, int count,
730910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                             U8CPU alpha, int /*x*/, int /*y*/) {
740910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 > alpha);
750910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
760910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
770910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        int src_scale = SkAlpha255To256(alpha) >> 4;
780910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
790910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor sc = *src++;
800910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(sc);
810910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
820910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            if (sc) {
830910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned dst_scale = 16 - (SkGetPackedA32(sc) * src_scale >> 8);
840910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t src_expand = SkExpand32_4444(sc) * src_scale;
850910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t dst_expand = SkExpand_4444(*dst) * dst_scale;
860910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                *dst = SkCompact_4444((src_expand + dst_expand) >> 4);
870910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            }
880910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            dst += 1;
890910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
900910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
910910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
920910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
930910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project/////////////////////////////////////////////////////////////////////////////
940910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
950910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32_D4444_Opaque_Dither(uint16_t* SK_RESTRICT dst,
960910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                    const SkPMColor* SK_RESTRICT src,
970910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                    int count, U8CPU alpha, int x, int y) {
980910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 == alpha);
990910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1000910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
1010910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        DITHER_4444_SCAN(y);
1020910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
1030910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
1040910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
1050910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkASSERT(SkGetPackedA32(c) == 255);
1060910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1070910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            unsigned dither = DITHER_VALUE(x);
1080910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            *dst++ = SkDitherARGB32To4444(c, dither);
1090910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            DITHER_INC_X(x);
1100910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
1110910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
1120910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
1130910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1140910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32_D4444_Blend_Dither(uint16_t* SK_RESTRICT dst,
1150910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                   const SkPMColor* SK_RESTRICT src,
1160910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                   int count, U8CPU alpha, int x, int y) {
1170910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 > alpha);
1180910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1190910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
1200910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        int scale16 = SkAlpha255To256(alpha) >> 4;
1210910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        DITHER_4444_SCAN(y);
1220910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
1230910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
1240910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
1250910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkASSERT(SkGetPackedA32(c) == 255);
1260910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1270910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            uint32_t src_expand = SkExpand32_4444(c) * scale16;
1280910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            uint32_t dst_expand = SkExpand_4444(*dst) * (16 - scale16);
1290910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1300910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            c = SkCompact_8888(src_expand + dst_expand); // convert back to SkPMColor
1310910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            *dst++ = SkDitherARGB32To4444(c, DITHER_VALUE(x));
1320910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            DITHER_INC_X(x);
1330910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
1340910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
1350910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
1360910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1370910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32A_D4444_Opaque_Dither(uint16_t* SK_RESTRICT dst,
1380910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                     const SkPMColor* SK_RESTRICT src,
1390910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                     int count, U8CPU alpha, int x, int y) {
1400910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 == alpha);
1410910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1420910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
1430910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        DITHER_4444_SCAN(y);
1440910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
1450910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
1460910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
1470910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            if (c) {
1480910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned a = SkGetPackedA32(c);
1490910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                int d = SkAlphaMul(DITHER_VALUE(x), SkAlpha255To256(a));
1500910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1510910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned scale16 = SkAlpha255To256(255 - a) >> 4;
1520910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t src_expand = SkExpand_8888(c);
1530910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t dst_expand = SkExpand_4444(*dst) * scale16;
1540910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                // convert back to SkPMColor
1550910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                c = SkCompact_8888(src_expand + dst_expand);
1560910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                *dst = SkDitherARGB32To4444(c, d);
1570910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            }
1580910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            dst += 1;
1590910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            DITHER_INC_X(x);
1600910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
1610910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
1620910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
1630910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1640910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project// need DitherExpand888To4444(expand, dither)
1650910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1660910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic void S32A_D4444_Blend_Dither(uint16_t* SK_RESTRICT dst,
1670910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                    const SkPMColor* SK_RESTRICT src,
1680910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                                    int count, U8CPU alpha, int x, int y) {
1690910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(255 > alpha);
1700910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1710910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    if (count > 0) {
1720910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        int src_scale = SkAlpha255To256(alpha) >> 4;
1730910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        DITHER_4444_SCAN(y);
1740910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        do {
1750910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColor c = *src++;
1760910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            SkPMColorAssert(c);
1770910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            if (c) {
1780910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned a = SkAlpha255To256(SkGetPackedA32(c));
1790910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                int d = SkAlphaMul(DITHER_VALUE(x), a);
1800910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1810910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                unsigned dst_scale = 16 - SkAlphaMul(src_scale, a);
1820910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t src_expand = SkExpand32_4444(c) * src_scale;
1830910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                uint32_t dst_expand = SkExpand_4444(*dst) * dst_scale;
1840910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                // convert back to SkPMColor
1850910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                c = SkCompact_8888(src_expand + dst_expand);
1860910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project                *dst = SkDitherARGB32To4444(c, d);
1870910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            }
1880910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            dst += 1;
1890910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project            DITHER_INC_X(x);
1900910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project        } while (--count != 0);
1910910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    }
1920910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
1930910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1940910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project///////////////////////////////////////////////////////////////////////////////
1950910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project///////////////////////////////////////////////////////////////////////////////
1960910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
1970910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Projectstatic const SkBlitRow::Proc gProcs4444[] = {
1980910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    // no dither
1990910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32_D4444_Opaque,
2000910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32_D4444_Blend,
2010910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2020910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32A_D4444_Opaque,
2030910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32A_D4444_Blend,
2040910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2050910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    // dither
2060910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32_D4444_Opaque_Dither,
2070910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32_D4444_Blend_Dither,
2080910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2090910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32A_D4444_Opaque_Dither,
2100910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    S32A_D4444_Blend_Dither
2110910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project};
2120910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2130910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source ProjectSkBlitRow::Proc SkBlitRow_Factory_4444(unsigned flags);
2140910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source ProjectSkBlitRow::Proc SkBlitRow_Factory_4444(unsigned flags)
2150910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project{
2160910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    SkASSERT(flags < SK_ARRAY_COUNT(gProcs4444));
2170910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2180910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project    return gProcs4444[flags];
2190910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project}
2200910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
2210910916c0f7b951ee55c4b7c6358295b9bca0565The Android Open Source Project
222