コード例 #1
0
ファイル: SkBlitter_ARGB32.cpp プロジェクト: ghub/NVprSDK
void SkARGB32_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[],
                                 const int16_t runs[]) {
    if (fSrcA == 0) {
        return;
    }

    uint32_t    color = fPMColor;
    uint32_t*   device = fDevice.getAddr32(x, y);
    unsigned    opaqueMask = fSrcA; // if fSrcA is 0xFF, then we will catch the fast opaque case

    for (;;) {
        int count = runs[0];
        SkASSERT(count >= 0);
        if (count <= 0) {
            return;
        }
        unsigned aa = antialias[0];
        if (aa) {
            if ((opaqueMask & aa) == 255) {
                sk_memset32(device, color, count);
            } else {
                uint32_t sc = SkAlphaMulQ(color, SkAlpha255To256(aa));
                fColor32Proc(device, device, count, sc);
            }
        }
        runs += count;
        antialias += count;
        device += count;
    }
}
コード例 #2
0
 virtual void filterSpan(const SkPMColor shader[], int count,
                         SkPMColor result[]) {
     if (NULL == fColor32Proc) {
         fColor32Proc = SkBlitRow::ColorProcFactory();
     }
     fColor32Proc(result, shader, count, fPMColor);
 }
コード例 #3
0
void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) {
    SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width() && y + height <= fDevice.height());

    if (fSrcA == 0) {
        return;
    }

    uint32_t*   device = fDevice.getAddr32(x, y);
    uint32_t    color = fPMColor;
    size_t      rowBytes = fDevice.rowBytes();

    while (--height >= 0) {
        fColor32Proc(device, device, width, color);
        device = (uint32_t*)((char*)device + rowBytes);
    }
}
コード例 #4
0
ファイル: SkColorFilters.cpp プロジェクト: Ashu17/blackberry
 void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const override {
     fColor32Proc(result, shader, count, this->getPMColor());
 }
コード例 #5
0
ファイル: SkBlitter_ARGB32.cpp プロジェクト: ghub/NVprSDK
void SkARGB32_Blitter::blitH(int x, int y, int width) {
    SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width());

    uint32_t*   device = fDevice.getAddr32(x, y);
    fColor32Proc(device, device, width, fPMColor);
}