Home | History | Annotate | Download | only in core
      1 
      2 /*
      3  * Copyright 2006 The Android Open Source Project
      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 #ifndef SkSpriteBlitter_DEFINED
     11 #define SkSpriteBlitter_DEFINED
     12 
     13 #include "SkBlitter.h"
     14 #include "SkBitmap.h"
     15 
     16 class SkPaint;
     17 
     18 class SkSpriteBlitter : public SkBlitter {
     19 public:
     20             SkSpriteBlitter(const SkBitmap& source);
     21     virtual ~SkSpriteBlitter();
     22 
     23     virtual void setup(const SkBitmap& device, int left, int top,
     24                        const SkPaint& paint);
     25 
     26     // overrides
     27 #ifdef SK_DEBUG
     28     virtual void    blitH(int x, int y, int width);
     29     virtual void    blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]);
     30     virtual void    blitV(int x, int y, int height, SkAlpha alpha);
     31     virtual void    blitMask(const SkMask&, const SkIRect& clip);
     32 #endif
     33 
     34     static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&,
     35                                       void* storage, size_t storageSize);
     36     static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&,
     37                                       void* storage, size_t storageSize);
     38 
     39 protected:
     40     const SkBitmap* fDevice;
     41     const SkBitmap* fSource;
     42     int             fLeft, fTop;
     43     const SkPaint*  fPaint;
     44 };
     45 
     46 #endif
     47