virtual void blitRect(int x, int y, int width, int height) {
        SkASSERT(width > 0 && height > 0);
        SK_RESTRICT SkPMColor* dst = fDevice->getAddr32(x, y);
        const SK_RESTRICT SkPMColor16* src = fSource->getAddr16(x - fLeft,
                                                                y - fTop);
        unsigned dstRB = fDevice->rowBytes();
        unsigned srcRB = fSource->rowBytes();

        do {
            src_row(dst, src, width);
            dst = (SK_RESTRICT SkPMColor*)((char*)dst + dstRB);
            src = (const SK_RESTRICT SkPMColor16*)((const char*)src + srcRB);
        } while (--height != 0);
    }
Exemplo n.º 2
0
static void src_rect(const GBitmap& bitmap, const GIRect& rect, const GPixel& color) {
    const int width = rect.width();
    for (int y = rect.top(); y < rect.bottom(); ++y) {
        src_row(get_addr(bitmap, rect.x(), y), width, color);
    }
}