diff options
author | 2014-08-12 08:34:29 -0700 | |
---|---|---|
committer | 2014-08-12 08:34:29 -0700 | |
commit | b3c9d1c33caf325aada244204215eb790c228c12 (patch) | |
tree | 067c0017914891d0aff2b6d6163f2de1c2b20c54 /src/core/SkRecords.h | |
parent | 9c7695b0b59b97da933cd11014c922344a8d7654 (diff) |
SkCanvas::drawPatch param SkPoint[12]
drawPatch now receives as parameter const SkPoint cubics[12]
Adjusted derived classes and serialization.
Ajusted GM's and benches that take into account combinations of optional
parameters, the scale of the patch and 4 different types of patches.
Planning on adding the extra functionality of SkPatch in another CL.
BUG=skia:
R=egdaniel@google.com, reed@google.com
Author: dandov@google.com
Review URL: https://codereview.chromium.org/463493002
Diffstat (limited to 'src/core/SkRecords.h')
-rw-r--r-- | src/core/SkRecords.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h index 6aefd195c9..1efdf28b14 100644 --- a/src/core/SkRecords.h +++ b/src/core/SkRecords.h @@ -232,7 +232,7 @@ RECORD3(DrawDRRect, SkPaint, paint, SkRRect, outer, SkRRect, inner); RECORD2(DrawOval, SkPaint, paint, SkRect, oval); RECORD1(DrawPaint, SkPaint, paint); RECORD2(DrawPath, SkPaint, paint, SkPath, path); -RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); +//RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); RECORD3(DrawPicture, Optional<SkPaint>, paint, SkPictureBox, picture, Optional<SkMatrix>, matrix); RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, SkPoint*, pts); RECORD4(DrawPosText, SkPaint, paint, @@ -291,6 +291,24 @@ struct DrawVertices { PODArray<uint16_t> indices; int indexCount; }; + +struct DrawPatch { + static const Type kType = DrawPatch_Type; + + DrawPatch(const SkPaint& paint, SkPoint cubics[12], SkColor colors[4], + SkPoint texCoords[4], SkXfermode* xmode) + : paint(paint) + , cubics(cubics) + , colors(colors) + , texCoords(texCoords) + , xmode(SkSafeRef(xmode)) { } + + SkPaint paint; + PODArray<SkPoint> cubics; + PODArray<SkColor> colors; + PODArray<SkPoint> texCoords; + SkAutoTUnref<SkXfermode> xmode; +}; #undef RECORD0 #undef RECORD1 |