OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkPathEffect.h" | 8 #include "SkPathEffect.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkDrawLooper.h" | 10 #include "SkDrawLooper.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 void SkPipeCanvas::didConcat(const SkMatrix& matrix) { | 311 void SkPipeCanvas::didConcat(const SkMatrix& matrix) { |
312 do_concat(fStream, matrix, false); | 312 do_concat(fStream, matrix, false); |
313 this->INHERITED::didConcat(matrix); | 313 this->INHERITED::didConcat(matrix); |
314 } | 314 } |
315 | 315 |
316 void SkPipeCanvas::didSetMatrix(const SkMatrix& matrix) { | 316 void SkPipeCanvas::didSetMatrix(const SkMatrix& matrix) { |
317 do_concat(fStream, matrix, true); | 317 do_concat(fStream, matrix, true); |
318 this->INHERITED::didSetMatrix(matrix); | 318 this->INHERITED::didSetMatrix(matrix); |
319 } | 319 } |
320 | 320 |
321 void SkPipeCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle
edgeStyle) { | 321 void SkPipeCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeS
tyle) { |
322 fStream->write32(pack_verb(SkPipeVerb::kClipRect, ((unsigned)op << 1) | edge
Style)); | 322 fStream->write32(pack_verb(SkPipeVerb::kClipRect, ((unsigned)op << 1) | edge
Style)); |
323 fStream->write(&rect, 4 * sizeof(SkScalar)); | 323 fStream->write(&rect, 4 * sizeof(SkScalar)); |
324 | 324 |
325 this->INHERITED::onClipRect(rect, op, edgeStyle); | 325 this->INHERITED::onClipRect(rect, op, edgeStyle); |
326 } | 326 } |
327 | 327 |
328 void SkPipeCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeSt
yle edgeStyle) { | 328 void SkPipeCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle ed
geStyle) { |
329 fStream->write32(pack_verb(SkPipeVerb::kClipRRect, ((unsigned)op << 1) | edg
eStyle)); | 329 fStream->write32(pack_verb(SkPipeVerb::kClipRRect, ((unsigned)op << 1) | edg
eStyle)); |
330 write_rrect(fStream, rrect); | 330 write_rrect(fStream, rrect); |
331 | 331 |
332 this->INHERITED::onClipRRect(rrect, op, edgeStyle); | 332 this->INHERITED::onClipRRect(rrect, op, edgeStyle); |
333 } | 333 } |
334 | 334 |
335 void SkPipeCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle
edgeStyle) { | 335 void SkPipeCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeS
tyle) { |
336 SkPipeWriter writer(this); | 336 SkPipeWriter writer(this); |
337 writer.write32(pack_verb(SkPipeVerb::kClipPath, ((unsigned)op << 1) | edgeSt
yle)); | 337 writer.write32(pack_verb(SkPipeVerb::kClipPath, ((unsigned)op << 1) | edgeSt
yle)); |
338 writer.writePath(path); | 338 writer.writePath(path); |
339 | 339 |
340 this->INHERITED::onClipPath(path, op, edgeStyle); | 340 this->INHERITED::onClipPath(path, op, edgeStyle); |
341 } | 341 } |
342 | 342 |
343 void SkPipeCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 343 void SkPipeCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) { |
344 SkPipeWriter writer(this); | 344 SkPipeWriter writer(this); |
345 writer.write32(pack_verb(SkPipeVerb::kClipRegion, (unsigned)op << 1)); | 345 writer.write32(pack_verb(SkPipeVerb::kClipRegion, (unsigned)op << 1)); |
346 writer.writeRegion(deviceRgn); | 346 writer.writeRegion(deviceRgn); |
347 | 347 |
348 this->INHERITED::onClipRegion(deviceRgn, op); | 348 this->INHERITED::onClipRegion(deviceRgn, op); |
349 } | 349 } |
350 | 350 |
351 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 351 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
352 | 352 |
353 void SkPipeCanvas::onDrawArc(const SkRect& bounds, SkScalar startAngle, SkScalar
sweepAngle, | 353 void SkPipeCanvas::onDrawArc(const SkRect& bounds, SkScalar startAngle, SkScalar
sweepAngle, |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 fImpl->fDeduper.setStream(stream); | 1067 fImpl->fDeduper.setStream(stream); |
1068 fImpl->fDeduper.setCanvas(fImpl->fCanvas.get()); | 1068 fImpl->fDeduper.setCanvas(fImpl->fCanvas.get()); |
1069 return fImpl->fCanvas.get(); | 1069 return fImpl->fCanvas.get(); |
1070 } | 1070 } |
1071 | 1071 |
1072 void SkPipeSerializer::endWrite() { | 1072 void SkPipeSerializer::endWrite() { |
1073 fImpl->fCanvas->restoreToCount(1); | 1073 fImpl->fCanvas->restoreToCount(1); |
1074 fImpl->fCanvas.reset(nullptr); | 1074 fImpl->fCanvas.reset(nullptr); |
1075 fImpl->fDeduper.setCanvas(nullptr); | 1075 fImpl->fDeduper.setCanvas(nullptr); |
1076 } | 1076 } |
OLD | NEW |