OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkProxyCanvas.h" | 8 #include "SkProxyCanvas.h" |
9 | 9 |
10 SkProxyCanvas::SkProxyCanvas(SkCanvas* proxy) : fProxy(proxy) { | 10 SkProxyCanvas::SkProxyCanvas(SkCanvas* proxy) : fProxy(proxy) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 void SkProxyCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { | 60 void SkProxyCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { |
61 fProxy->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle); | 61 fProxy->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle); |
62 } | 62 } |
63 | 63 |
64 void SkProxyCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 64 void SkProxyCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
65 fProxy->clipRegion(deviceRgn, op); | 65 fProxy->clipRegion(deviceRgn, op); |
66 } | 66 } |
67 | 67 |
68 void SkProxyCanvas::drawPaint(const SkPaint& paint) { | 68 void SkProxyCanvas::onDrawPaint(const SkPaint& paint) { |
69 fProxy->drawPaint(paint); | 69 fProxy->drawPaint(paint); |
70 } | 70 } |
71 | 71 |
72 void SkProxyCanvas::drawPoints(PointMode mode, size_t count, | 72 void SkProxyCanvas::onDrawPoints(PointMode mode, size_t count, |
73 const SkPoint pts[], const SkPaint& paint) { | 73 const SkPoint pts[], const SkPaint& paint) { |
74 fProxy->drawPoints(mode, count, pts, paint); | 74 fProxy->drawPoints(mode, count, pts, paint); |
75 } | 75 } |
76 | 76 |
77 void SkProxyCanvas::drawOval(const SkRect& rect, const SkPaint& paint) { | 77 void SkProxyCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { |
78 fProxy->drawOval(rect, paint); | 78 fProxy->drawOval(rect, paint); |
79 } | 79 } |
80 | 80 |
81 void SkProxyCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { | 81 void SkProxyCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { |
82 fProxy->drawRect(rect, paint); | 82 fProxy->drawRect(rect, paint); |
83 } | 83 } |
84 | 84 |
85 void SkProxyCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { | 85 void SkProxyCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { |
86 fProxy->drawRRect(rrect, paint); | 86 fProxy->drawRRect(rrect, paint); |
87 } | 87 } |
88 | 88 |
89 void SkProxyCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, | 89 void SkProxyCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, |
90 const SkPaint& paint) { | 90 const SkPaint& paint) { |
91 fProxy->drawDRRect(outer, inner, paint); | 91 fProxy->drawDRRect(outer, inner, paint); |
92 } | 92 } |
93 | 93 |
94 void SkProxyCanvas::drawPath(const SkPath& path, const SkPaint& paint) { | 94 void SkProxyCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { |
95 fProxy->drawPath(path, paint); | 95 fProxy->drawPath(path, paint); |
96 } | 96 } |
97 | 97 |
98 void SkProxyCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top, | 98 void SkProxyCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar to
p, |
99 const SkPaint* paint) { | 99 const SkPaint* paint) { |
100 fProxy->drawImage(image, left, top, paint); | 100 fProxy->drawImage(image, left, top, paint); |
101 } | 101 } |
102 | 102 |
103 void SkProxyCanvas::drawImageRect(const SkImage* image, const SkRect* src, | 103 void SkProxyCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, con
st SkRect& dst, |
104 const SkRect& dst, | 104 const SkPaint* paint) { |
105 const SkPaint* paint) { | |
106 fProxy->drawImageRect(image, src, dst, paint); | 105 fProxy->drawImageRect(image, src, dst, paint); |
107 } | 106 } |
108 | 107 |
109 void SkProxyCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, | 108 void SkProxyCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
110 const SkPaint* paint) { | 109 const SkPaint* paint) { |
111 fProxy->drawBitmap(bitmap, x, y, paint); | 110 fProxy->drawBitmap(bitmap, x, y, paint); |
112 } | 111 } |
113 | 112 |
114 void SkProxyCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* s
rc, | 113 void SkProxyCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, |
115 const SkRect& dst, const SkPaint* paint, | 114 const SkPaint* paint, DrawBitmapRectFlags f
lags) { |
116 DrawBitmapRectFlags flags) { | |
117 fProxy->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 115 fProxy->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
118 } | 116 } |
119 | 117 |
120 void SkProxyCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, | 118 void SkProxyCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cent
er, |
121 const SkPaint* paint) { | 119 const SkRect& dst, const SkPaint* paint) { |
| 120 fProxy->drawBitmapNine(bitmap, center, dst, paint); |
| 121 } |
| 122 |
| 123 void SkProxyCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkP
aint* paint) { |
122 fProxy->drawSprite(bitmap, x, y, paint); | 124 fProxy->drawSprite(bitmap, x, y, paint); |
123 } | 125 } |
124 | 126 |
125 void SkProxyCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x,
SkScalar y, | 127 void SkProxyCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x,
SkScalar y, |
126 const SkPaint& paint) { | 128 const SkPaint& paint) { |
127 fProxy->drawText(text, byteLength, x, y, paint); | 129 fProxy->drawText(text, byteLength, x, y, paint); |
128 } | 130 } |
129 | 131 |
130 void SkProxyCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], | 132 void SkProxyCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], |
131 const SkPaint& paint) { | 133 const SkPaint& paint) { |
(...skipping 13 matching lines...) Expand all Loading... |
145 void SkProxyCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar
y, | 147 void SkProxyCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar
y, |
146 const SkPaint& paint) { | 148 const SkPaint& paint) { |
147 fProxy->drawTextBlob(blob, x, y, paint); | 149 fProxy->drawTextBlob(blob, x, y, paint); |
148 } | 150 } |
149 | 151 |
150 void SkProxyCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matr
ix, | 152 void SkProxyCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matr
ix, |
151 const SkPaint* paint) { | 153 const SkPaint* paint) { |
152 fProxy->drawPicture(picture, matrix, paint); | 154 fProxy->drawPicture(picture, matrix, paint); |
153 } | 155 } |
154 | 156 |
155 void SkProxyCanvas::drawVertices(VertexMode vmode, int vertexCount, | 157 void SkProxyCanvas::onDrawVertices(VertexMode vmode, int vertexCount, |
156 const SkPoint vertices[], const SkPoint texs[], | 158 const SkPoint vertices[], const SkPoint texs[
], |
157 const SkColor colors[], SkXfermode* xmode, | 159 const SkColor colors[], SkXfermode* xmode, |
158 const uint16_t indices[], int indexCount, | 160 const uint16_t indices[], int indexCount, |
159 const SkPaint& paint) { | 161 const SkPaint& paint) { |
160 fProxy->drawVertices(vmode, vertexCount, vertices, texs, colors, | 162 fProxy->drawVertices(vmode, vertexCount, vertices, texs, colors, |
161 xmode, indices, indexCount, paint); | 163 xmode, indices, indexCount, paint); |
162 } | 164 } |
163 | 165 |
164 void SkProxyCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4
], | 166 void SkProxyCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4
], |
165 const SkPoint texCoords[4], SkXfermode* xmode, | 167 const SkPoint texCoords[4], SkXfermode* xmode, |
166 const SkPaint& paint) { | 168 const SkPaint& paint) { |
167 fProxy->drawPatch(cubics, colors, texCoords, xmode, paint); | 169 fProxy->drawPatch(cubics, colors, texCoords, xmode, paint); |
168 } | 170 } |
169 | 171 |
170 void SkProxyCanvas::beginCommentGroup(const char* description) { | 172 void SkProxyCanvas::beginCommentGroup(const char* description) { |
171 fProxy->beginCommentGroup(description); | 173 fProxy->beginCommentGroup(description); |
172 } | 174 } |
173 | 175 |
174 void SkProxyCanvas::addComment(const char* kywd, const char* value) { | 176 void SkProxyCanvas::addComment(const char* kywd, const char* value) { |
175 fProxy->addComment(kywd, value); | 177 fProxy->addComment(kywd, value); |
176 } | 178 } |
177 | 179 |
178 void SkProxyCanvas::endCommentGroup() { | 180 void SkProxyCanvas::endCommentGroup() { |
179 fProxy->endCommentGroup(); | 181 fProxy->endCommentGroup(); |
180 } | 182 } |
181 | 183 |
182 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) { | 184 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) { |
183 return fProxy->setDrawFilter(filter); | 185 return fProxy->setDrawFilter(filter); |
184 } | 186 } |
OLD | NEW |