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 SkBitmapProcShader_DEFINED | 10 #ifndef SkBitmapProcShader_DEFINED |
11 #define SkBitmapProcShader_DEFINED | 11 #define SkBitmapProcShader_DEFINED |
12 | 12 |
13 #include "SkShader.h" | 13 #include "SkShader.h" |
14 #include "SkBitmapProcState.h" | 14 #include "SkBitmapProcState.h" |
15 | 15 |
16 class SkBitmapProcShader : public SkShader { | 16 class SkBitmapProcShader : public SkShader { |
| 17 typedef SkShader INHERITED; |
| 18 |
17 public: | 19 public: |
18 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty); | 20 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty); |
19 | 21 |
20 // overrides from SkShader | 22 // overrides from SkShader |
21 virtual bool isOpaque() const SK_OVERRIDE; | 23 virtual bool isOpaque() const SK_OVERRIDE; |
22 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK
_OVERRIDE; | 24 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK
_OVERRIDE; |
23 virtual void endContext() SK_OVERRIDE; | 25 virtual void endContext() SK_OVERRIDE; |
24 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } | 26 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } |
25 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRID
E; | 27 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRID
E; |
26 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; | 28 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; |
27 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRI
DE; | 29 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRI
DE; |
28 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR
IDE; | 30 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR
IDE; |
29 | 31 |
30 static bool CanDo(const SkBitmap&, TileMode tx, TileMode ty); | 32 static bool CanDo(const SkBitmap&, TileMode tx, TileMode ty); |
31 | 33 |
32 SK_DEVELOPER_TO_STRING() | 34 SK_DEVELOPER_TO_STRING() |
33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) | 35 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) |
34 | 36 |
35 #if SK_SUPPORT_GPU | 37 #if SK_SUPPORT_GPU |
36 GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE; | 38 GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE; |
37 #endif | 39 #endif |
38 | 40 |
39 protected: | 41 protected: |
40 SkBitmapProcShader(SkFlattenableReadBuffer& ); | 42 SkBitmapProcShader(SkFlattenableReadBuffer& ); |
41 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 43 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
42 | 44 |
43 SkBitmap fRawBitmap; // experimental for RLE encoding | 45 SkBitmap fRawBitmap; // experimental for RLE encoding |
44 SkBitmapProcState fState; | 46 SkBitmapProcState fState; |
45 uint32_t fFlags; | 47 uint32_t fFlags; |
46 | |
47 private: | |
48 typedef SkShader INHERITED; | |
49 }; | 48 }; |
50 | 49 |
51 #endif | 50 #endif |
OLD | NEW |