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 SkDraw_DEFINED | 10 #ifndef SkDraw_DEFINED |
(...skipping 16 matching lines...) Expand all Loading... |
27 class SkRRect; | 27 class SkRRect; |
28 | 28 |
29 class SkDraw { | 29 class SkDraw { |
30 public: | 30 public: |
31 SkDraw(); | 31 SkDraw(); |
32 SkDraw(const SkDraw& src); | 32 SkDraw(const SkDraw& src); |
33 | 33 |
34 void drawPaint(const SkPaint&) const; | 34 void drawPaint(const SkPaint&) const; |
35 void drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[], | 35 void drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[], |
36 const SkPaint&, bool forceUseDevice = false) const; | 36 const SkPaint&, bool forceUseDevice = false) const; |
37 void drawRect(const SkRect&, const SkPaint&) const; | 37 void drawRect(const SkRect& prePaintRect, const SkPaint&, const SkMatrix*
paintMatrix, |
| 38 const SkRect* postPaintRect) const; |
| 39 void drawRect(const SkRect& rect, const SkPaint& paint) const { |
| 40 this->drawRect(rect, paint, NULL, NULL); |
| 41 } |
38 void drawRRect(const SkRRect&, const SkPaint&) const; | 42 void drawRRect(const SkRRect&, const SkPaint&) const; |
39 /** | 43 /** |
40 * To save on mallocs, we allow a flag that tells us that srcPath is | 44 * To save on mallocs, we allow a flag that tells us that srcPath is |
41 * mutable, so that we don't have to make copies of it as we transform it. | 45 * mutable, so that we don't have to make copies of it as we transform it. |
42 * | 46 * |
43 * If prePathMatrix is not null, it should logically be applied before any | 47 * If prePathMatrix is not null, it should logically be applied before any |
44 * stroking or other effects. If there are no effects on the paint that | 48 * stroking or other effects. If there are no effects on the paint that |
45 * affect the geometry/rasterization, then the pre matrix can just be | 49 * affect the geometry/rasterization, then the pre matrix can just be |
46 * pre-concated with the current matrix. | 50 * pre-concated with the current matrix. |
47 */ | 51 */ |
48 void drawPath(const SkPath& path, const SkPaint& paint, | 52 void drawPath(const SkPath& path, const SkPaint& paint, |
49 const SkMatrix* prePathMatrix, bool pathIsMutable) const { | 53 const SkMatrix* prePathMatrix, bool pathIsMutable) const { |
50 this->drawPath(path, paint, prePathMatrix, pathIsMutable, false); | 54 this->drawPath(path, paint, prePathMatrix, pathIsMutable, false); |
51 } | 55 } |
52 | 56 |
53 void drawPath(const SkPath& path, const SkPaint& paint, | 57 void drawPath(const SkPath& path, const SkPaint& paint, |
54 SkBlitter* customBlitter = NULL) const { | 58 SkBlitter* customBlitter = NULL) const { |
55 this->drawPath(path, paint, NULL, false, false, customBlitter); | 59 this->drawPath(path, paint, NULL, false, false, customBlitter); |
56 } | 60 } |
57 | 61 |
58 void drawBitmap(const SkBitmap&, const SkMatrix&, const SkPaint&) const; | 62 /* If dstOrNull is null, computes a dst by mapping the bitmap's bounds throu
gh the matrix. */ |
| 63 void drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull
, |
| 64 const SkPaint&) const; |
59 void drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const; | 65 void drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const; |
60 void drawText(const char text[], size_t byteLength, SkScalar x, | 66 void drawText(const char text[], size_t byteLength, SkScalar x, |
61 SkScalar y, const SkPaint& paint) const; | 67 SkScalar y, const SkPaint& paint) const; |
62 void drawPosText(const char text[], size_t byteLength, | 68 void drawPosText(const char text[], size_t byteLength, |
63 const SkScalar pos[], int scalarsPerPosition, | 69 const SkScalar pos[], int scalarsPerPosition, |
64 const SkPoint& offset, const SkPaint& paint) const; | 70 const SkPoint& offset, const SkPaint& paint) const; |
65 void drawTextOnPath(const char text[], size_t byteLength, | 71 void drawTextOnPath(const char text[], size_t byteLength, |
66 const SkPath&, const SkMatrix*, const SkPaint&) const; | 72 const SkPath&, const SkMatrix*, const SkPaint&) const; |
67 void drawVertices(SkCanvas::VertexMode mode, int count, | 73 void drawVertices(SkCanvas::VertexMode mode, int count, |
68 const SkPoint vertices[], const SkPoint textures[], | 74 const SkPoint vertices[], const SkPoint textures[], |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 SkDrawProcs* fProcs; // optional | 152 SkDrawProcs* fProcs; // optional |
147 | 153 |
148 #ifdef SK_DEBUG | 154 #ifdef SK_DEBUG |
149 void validate() const; | 155 void validate() const; |
150 #else | 156 #else |
151 void validate() const {} | 157 void validate() const {} |
152 #endif | 158 #endif |
153 }; | 159 }; |
154 | 160 |
155 #endif | 161 #endif |
OLD | NEW |