/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/ // This file does not have include guards because it is not meant to be used on its own.
/* SK_BLITBWMASK_NAME name of function(const SkPixmap& dstPixmap, const SkMask& mask, const SkIRect& clip, SK_BLITBWMASK_ARGS) SK_BLITBWMASK_ARGS list of additional arguments to SK_BLITBWMASK_NAME, beginning with a comma SK_BLITBWMASK_BLIT8 name of function(U8CPU byteMask, SK_BLITBWMASK_DEVTYPE* dst, int x, int y) SK_BLITBWMASK_GETADDR either writable_addr[8,16,32] SK_BLITBWMASK_DEVTYPE either U32 or U16 or U8
*/
if (cx == maskLeft && clip.fRight == srcMask.fBounds.fRight)
{ do {
SK_BLITBWMASK_DEVTYPE* dst = device; unsigned rb = mask_rowBytes; do {
U8CPU mask = *bits++;
SK_BLITBWMASK_BLIT8(mask, dst);
dst += 8;
} while (--rb != 0);
device = (SK_BLITBWMASK_DEVTYPE*)((char*)device + bitmap_rowBytes);
} while (--height != 0);
} else
{ int left_edge = cx - maskLeft;
SkASSERT(left_edge >= 0); int rite_edge = clip.fRight - maskLeft;
SkASSERT(rite_edge > left_edge);
int left_mask = 0xFF >> (left_edge & 7); int rite_mask = 0xFF << (8 - (rite_edge & 7));
rite_mask &= 0xFF; // only want low-8 bits of mask int full_runs = (rite_edge >> 3) - ((left_edge + 7) >> 3);
// check for empty right mask, so we don't read off the end (or go slower than we need to) if (rite_mask == 0)
{
SkASSERT(full_runs >= 0);
full_runs -= 1;
rite_mask = 0xFF;
} if (left_mask == 0xFF)
full_runs -= 1;
// back up manually so we can keep in sync with our byte-aligned src // and not trigger an assert from the getAddr## function
device -= left_edge & 7;
if (full_runs < 0)
{
left_mask &= rite_mask;
SkASSERT(left_mask != 0); do {
U8CPU mask = *bits & left_mask;
SK_BLITBWMASK_BLIT8(mask, device);
bits += mask_rowBytes;
device = (SK_BLITBWMASK_DEVTYPE*)((char*)device + bitmap_rowBytes);
} while (--height != 0);
} else
{ do { int runs = full_runs;
SK_BLITBWMASK_DEVTYPE* dst = device; const uint8_t* b = bits;
U8CPU mask;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.