Index: src/core/SkPictureRecord.cpp |
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp |
index ab4c3fa38eaf353b4ff793f1b94f70b2dbb41ed7..73fff7bc45fa5189746466a0983514a4b56ebf37 100644 |
--- a/src/core/SkPictureRecord.cpp |
+++ b/src/core/SkPictureRecord.cpp |
@@ -93,6 +93,7 @@ static inline size_t getPaintOffset(DrawType op, size_t opSize) { |
0, // DRAW_DATA - no paint |
1, // DRAW_OVAL - right after op code |
1, // DRAW_PAINT - right after op code |
+ 1, // DRAW_PATCH - right after op code |
1, // DRAW_PATH - right after op code |
0, // DRAW_PICTURE - no paint |
1, // DRAW_POINTS - right after op code |
@@ -1480,6 +1481,22 @@ void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, |
this->validate(initialOffset, size); |
} |
+void SkPictureRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) { |
+ //TODO: drawPatch |
mtklein
2014/08/04 18:23:03
?
dandov
2014/08/04 19:59:27
Done.
|
+ |
+#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
+ fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); |
+#endif |
+ |
+ // op + paint index + path index |
mtklein
2014/08/04 18:23:03
please update comment
dandov
2014/08/04 19:59:27
Done.
|
+ size_t size = 2 * kUInt32Size + 12 * sizeof(SkPoint) + 4 * sizeof(SkColor); |
+ size_t initialOffset = this->addDraw(DRAW_PATCH, &size); |
+ SkASSERT(initialOffset+getPaintOffset(DRAW_PATCH, size) == fWriter.bytesWritten()); |
+ this->addPaint(paint); |
+ this->addPatch(patch); |
+ this->validate(initialOffset, size); |
+} |
+ |
void SkPictureRecord::drawData(const void* data, size_t length) { |
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
@@ -1613,6 +1630,18 @@ void SkPictureRecord::addPath(const SkPath& path) { |
this->addInt(this->addPathToHeap(path)); |
} |
+void SkPictureRecord::addPatch(const SkPatch& patch) { |
mtklein
2014/08/04 18:23:03
Isn't this just fWriter.writePatch(patch); ?
dandov
2014/08/04 19:59:27
Done.
|
+ const SkPoint* pts = patch.getControlPoints(); |
+ for (int i = 0; i < 12; i++) { |
+ this->addPoint(pts[i]); |
+ } |
+ |
+ const SkColor* colors = patch.getColors(); |
+ for (int i = 0; i < 4; i++) { |
+ this->addInt(colors[i]); |
+ } |
+} |
+ |
void SkPictureRecord::addPicture(const SkPicture* picture) { |
int index = fPictureRefs.find(picture); |
if (index < 0) { // not found |