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 "SkBitmap.h" 14 #include "SkBitmapProcShader.h" 15 #include "SkBlitter.h" 16 #include "SkShader.h" 17 #include "SkSmallAllocator.h" 18 19 class SkPaint; 20 21 class SkSpriteBlitter : public SkBlitter { 22 public: 23 SkSpriteBlitter(const SkBitmap& source); 24 virtual ~SkSpriteBlitter(); 25 26 virtual void setup(const SkBitmap& device, int left, int top, 27 const SkPaint& paint); 28 29 // overrides 30 #ifdef SK_DEBUG 31 virtual void blitH(int x, int y, int width); 32 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]); 33 virtual void blitV(int x, int y, int height, SkAlpha alpha); 34 virtual void blitMask(const SkMask&, const SkIRect& clip); 35 #endif 36 37 static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&, 38 SkTBlitterAllocator*); 39 static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&, 40 SkTBlitterAllocator*); 41 42 protected: 43 const SkBitmap* fDevice; 44 const SkBitmap* fSource; 45 int fLeft, fTop; 46 const SkPaint* fPaint; 47 }; 48 49 #endif 50