OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkSpriteBlitter_DEFINED | 10 #ifndef SkSpriteBlitter_DEFINED |
11 #define SkSpriteBlitter_DEFINED | 11 #define SkSpriteBlitter_DEFINED |
12 | 12 |
13 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
14 #include "SkBitmapProcShader.h" | 14 #include "SkBitmapProcShader.h" |
15 #include "SkBlitter.h" | 15 #include "SkBlitter.h" |
16 #include "SkShader.h" | 16 #include "SkShader.h" |
17 #include "SkSmallAllocator.h" | 17 #include "SkSmallAllocator.h" |
18 | 18 |
19 class SkPaint; | 19 class SkPaint; |
20 | 20 |
21 class SkSpriteBlitter : public SkBlitter { | 21 class SkSpriteBlitter : public SkBlitter { |
22 public: | 22 public: |
23 SkSpriteBlitter(const SkBitmap& source); | 23 SkSpriteBlitter(const SkBitmap& source); |
24 virtual ~SkSpriteBlitter(); | |
25 | 24 |
26 virtual void setup(const SkBitmap& device, int left, int top, | 25 virtual bool setup(const SkBitmap& device, int left, int top, const SkPaint&
paint); |
27 const SkPaint& paint); | |
28 | 26 |
29 // overrides | 27 // overrides |
30 #ifdef SK_DEBUG | 28 #ifdef SK_DEBUG |
31 virtual void blitH(int x, int y, int width); | 29 virtual void blitH(int x, int y, int width); |
32 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int
16_t runs[]); | 30 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int
16_t runs[]); |
33 virtual void blitV(int x, int y, int height, SkAlpha alpha); | 31 virtual void blitV(int x, int y, int height, SkAlpha alpha); |
34 virtual void blitMask(const SkMask&, const SkIRect& clip); | 32 virtual void blitMask(const SkMask&, const SkIRect& clip); |
35 #endif | 33 #endif |
36 | 34 |
37 static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&, | 35 static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&, |
38 SkTBlitterAllocator*); | 36 SkTBlitterAllocator*); |
39 static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&, | 37 static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&, |
40 SkTBlitterAllocator*); | 38 SkTBlitterAllocator*); |
41 | 39 |
42 protected: | 40 protected: |
43 const SkBitmap* fDevice; | 41 const SkBitmap* fDevice; |
44 const SkBitmap* fSource; | 42 const SkPixmap* fSource; |
45 int fLeft, fTop; | 43 int fLeft, fTop; |
46 const SkPaint* fPaint; | 44 const SkPaint* fPaint; |
| 45 |
| 46 private: |
| 47 SkAutoPixmapUnlock fUnlocker; |
47 }; | 48 }; |
48 | 49 |
49 #endif | 50 #endif |
OLD | NEW |