OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkRecorder.h" | 8 #include "SkRecorder.h" |
| 9 #include "SkPatchUtils.h" |
9 #include "SkPicture.h" | 10 #include "SkPicture.h" |
10 | 11 |
11 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. | 12 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. |
12 SkRecorder::SkRecorder(SkRecord* record, int width, int height) | 13 SkRecorder::SkRecorder(SkRecord* record, int width, int height) |
13 : SkCanvas(width, height), fRecord(record) {} | 14 : SkCanvas(width, height), fRecord(record) {} |
14 | 15 |
15 void SkRecorder::forgetRecord() { | 16 void SkRecorder::forgetRecord() { |
16 fRecord = NULL; | 17 fRecord = NULL; |
17 } | 18 } |
18 | 19 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 vmode, | 200 vmode, |
200 vertexCount, | 201 vertexCount, |
201 this->copy(vertices, vertexCount), | 202 this->copy(vertices, vertexCount), |
202 texs ? this->copy(texs, vertexCount) : NULL, | 203 texs ? this->copy(texs, vertexCount) : NULL, |
203 colors ? this->copy(colors, vertexCount) : NULL, | 204 colors ? this->copy(colors, vertexCount) : NULL, |
204 xmode, | 205 xmode, |
205 this->copy(indices, indexCount), | 206 this->copy(indices, indexCount), |
206 indexCount); | 207 indexCount); |
207 } | 208 } |
208 | 209 |
209 void SkRecorder::drawPatch(const SkPatch& patch, const SkPaint& paint) { | 210 void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
210 APPEND(DrawPatch, delay_copy(paint), delay_copy(patch)); | 211 const SkPoint texCoords[4], SkXfermode* xmode, cons
t SkPaint& paint) { |
| 212 APPEND(DrawPatch, delay_copy(paint), |
| 213 cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL, |
| 214 colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL, |
| 215 texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL, |
| 216 xmode); |
211 } | 217 } |
212 | 218 |
213 void SkRecorder::willSave() { | 219 void SkRecorder::willSave() { |
214 APPEND(Save); | 220 APPEND(Save); |
215 INHERITED(willSave); | 221 INHERITED(willSave); |
216 } | 222 } |
217 | 223 |
218 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, | 224 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, |
219 const SkPaint* paint, | 225 const SkPaint* paint, |
220 SkCanvas::SaveFlags flags)
{ | 226 SkCanvas::SaveFlags flags)
{ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 264 |
259 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { | 265 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
260 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 266 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
261 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); | 267 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); |
262 } | 268 } |
263 | 269 |
264 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 270 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
265 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 271 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
266 INHERITED(onClipRegion, deviceRgn, op); | 272 INHERITED(onClipRegion, deviceRgn, op); |
267 } | 273 } |
OLD | NEW |