LCOV - code coverage report
Current view: directory - gfx/skia/src/core - SkBitmapProcState_shaderproc.h (source / functions) Found Hit Coverage
Test: app.info Lines: 32 0 0.0 %
Date: 2012-06-02 Functions: 3 0 0.0 %

       1                 : 
       2                 : /*
       3                 :  * Copyright 2011 Google Inc.
       4                 :  *
       5                 :  * Use of this source code is governed by a BSD-style license that can be
       6                 :  * found in the LICENSE file.
       7                 :  */
       8                 : 
       9                 : 
      10                 : 
      11                 : #define SCALE_FILTER_NAME       MAKENAME(_filter_DX_shaderproc)
      12                 : 
      13               0 : static void SCALE_FILTER_NAME(const SkBitmapProcState& s, int x, int y,
      14                 :                               DSTTYPE* SK_RESTRICT colors, int count) {
      15               0 :     SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask |
      16                 :                              SkMatrix::kScale_Mask)) == 0);
      17               0 :     SkASSERT(s.fInvKy == 0);
      18               0 :     SkASSERT(count > 0 && colors != NULL);
      19               0 :     SkASSERT(s.fDoFilter);
      20               0 :     SkDEBUGCODE(CHECKSTATE(s);)
      21                 : 
      22               0 :     const unsigned maxX = s.fBitmap->width() - 1;
      23               0 :     const SkFixed oneX = s.fFilterOneX;
      24               0 :     const SkFixed dx = s.fInvSx;
      25                 :     SkFixed fx;
      26                 :     const SRCTYPE* SK_RESTRICT row0;
      27                 :     const SRCTYPE* SK_RESTRICT row1;
      28                 :     unsigned subY;
      29                 : 
      30                 :     {
      31                 :         SkPoint pt;
      32               0 :         s.fInvProc(*s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
      33               0 :                    SkIntToScalar(y) + SK_ScalarHalf, &pt);
      34               0 :         SkFixed fy = SkScalarToFixed(pt.fY) - (s.fFilterOneY >> 1);
      35               0 :         const unsigned maxY = s.fBitmap->height() - 1;
      36                 :         // compute our two Y values up front
      37               0 :         subY = TILEY_LOW_BITS(fy, maxY);
      38               0 :         int y0 = TILEY_PROCF(fy, maxY);
      39               0 :         int y1 = TILEY_PROCF((fy + s.fFilterOneY), maxY);
      40                 : 
      41               0 :         const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels();
      42               0 :         unsigned rb = s.fBitmap->rowBytes();
      43               0 :         row0 = (const SRCTYPE*)(srcAddr + y0 * rb);
      44               0 :         row1 = (const SRCTYPE*)(srcAddr + y1 * rb);
      45                 :         // now initialize fx
      46               0 :         fx = SkScalarToFixed(pt.fX) - (oneX >> 1);
      47                 :     }
      48                 : 
      49                 : #ifdef PREAMBLE
      50               0 :     PREAMBLE(s);
      51                 : #endif
      52                 :     
      53               0 :     do {
      54               0 :         unsigned subX = TILEX_LOW_BITS(fx, maxX);
      55               0 :         unsigned x0 = TILEX_PROCF(fx, maxX);
      56               0 :         unsigned x1 = TILEX_PROCF((fx + oneX), maxX);
      57                 : 
      58               0 :         FILTER_PROC(subX, subY,
      59                 :                     SRC_TO_FILTER(row0[x0]),
      60                 :                     SRC_TO_FILTER(row0[x1]),
      61                 :                     SRC_TO_FILTER(row1[x0]),
      62                 :                     SRC_TO_FILTER(row1[x1]),
      63               0 :                     colors);
      64               0 :         colors += 1;
      65                 : 
      66               0 :         fx += dx;
      67                 :     } while (--count != 0);
      68                 : 
      69                 : #ifdef POSTAMBLE
      70               0 :     POSTAMBLE(s);
      71                 : #endif
      72               0 : }
      73                 : 
      74                 : ///////////////////////////////////////////////////////////////////////////////
      75                 : 
      76                 : #undef TILEX_PROCF
      77                 : #undef TILEY_PROCF
      78                 : #undef TILEX_LOW_BITS
      79                 : #undef TILEY_LOW_BITS
      80                 : #undef MAKENAME
      81                 : #undef SRCTYPE
      82                 : #undef DSTTYPE
      83                 : #undef CHECKSTATE
      84                 : #undef SRC_TO_FILTER
      85                 : #undef FILTER_TO_DST
      86                 : #undef PREAMBLE
      87                 : #undef POSTAMBLE
      88                 : 
      89                 : #undef SCALE_FILTER_NAME

Generated by: LCOV version 1.7