aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDevice.cpp
diff options
context:
space:
mode:
authorGravatar dandov <dandov@google.com>2014-08-12 08:34:29 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-12 08:34:29 -0700
commitb3c9d1c33caf325aada244204215eb790c228c12 (patch)
tree067c0017914891d0aff2b6d6163f2de1c2b20c54 /src/core/SkDevice.cpp
parent9c7695b0b59b97da933cd11014c922344a8d7654 (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/SkDevice.cpp')
-rw-r--r--src/core/SkDevice.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 6ceaffebb3..50755c94ed 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -79,15 +79,17 @@ void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
this->drawPath(draw, path, paint, preMatrix, pathIsMutable);
}
-void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPatch& patch, const SkPaint& paint) {
- SkPatch::VertexData data;
+void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const SkColor colors[4],
+ const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
+ SkPatchUtils::VertexData data;
- SkISize lod = SkPatchUtils::GetLevelOfDetail(patch, draw.fMatrix);
+ SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, draw.fMatrix);
// It automatically adjusts lodX and lodY in case it exceeds the number of indices.
- patch.getVertexData(&data, lod.width(), lod.height());
+ SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), lod.height());
this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints,
- data.fTexCoords, data.fColors, NULL, data.fIndices, data.fIndexCount, paint);
+ data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount,
+ paint);
}
bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowBytes, int x, int y) {