Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 429343004: Stopped skipping tests in dm of SkPatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dumped corners and colors and used enum for 12's and 4's Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index ab4c3fa38eaf353b4ff793f1b94f70b2dbb41ed7..defd1e5a26afb9eccca9ac769e4070c993777be9 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,21 @@ void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount,
this->validate(initialOffset, size);
}
+void SkPictureRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) {
+#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
+ fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
+#endif
+
+ // op + paint index + patch 12 control points + patch 4 colors
+ size_t size = 2 * kUInt32Size + SkPatch::kNumCtrlPts * sizeof(SkPoint) +
+ SkPatch::kNumColors * 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 +1629,10 @@ void SkPictureRecord::addPath(const SkPath& path) {
this->addInt(this->addPathToHeap(path));
}
+void SkPictureRecord::addPatch(const SkPatch& patch) {
+ fWriter.writePatch(patch);
+}
+
void SkPictureRecord::addPicture(const SkPicture* picture) {
int index = fPictureRefs.find(picture);
if (index < 0) { // not found

Powered by Google App Engine
This is Rietveld 408576698