summaryrefslogtreecommitdiff
path: root/libs/hwui/SkiaCanvas.cpp
diff options
context:
space:
mode:
author Mike Reed <reed@google.com> 2017-04-04 15:32:04 -0400
committer Mike Reed <reed@google.com> 2017-04-05 14:20:38 +0000
commit826deefda55ead0036cdb0924bc14f17d2a85420 (patch)
tree200ec673d02e096b02a3991f8821816533b863ff /libs/hwui/SkiaCanvas.cpp
parent06d6b4d9b0cc895c7d28e56019213800d4d522cf (diff)
switch over to SkVertices object, and stop using deprecated methods.
This allows Skia to remove SK_SUPPORT_LEGACY_CANVAS_VERTICES SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF SK_SUPPORT_LEGACY_PIXELREFFACTORY Test: Existing CTS cover these changes Running CtsGraphicsTestCases, there were 6 failures w/ and w/o this CL. None of the 6 seems related to this CL. Change-Id: I724082357d9f6cb699770df3c0b9ef555b957697
Diffstat (limited to 'libs/hwui/SkiaCanvas.cpp')
-rw-r--r--libs/hwui/SkiaCanvas.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index d344528c01ef..434e01dc5445 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -515,17 +515,8 @@ void SkiaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
mCanvas->drawPath(path, paint);
}
-void SkiaCanvas::drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
- const float* verts, const float* texs, const int* colors,
- const uint16_t* indices, int indexCount, const SkPaint& paint) {
-#ifndef SK_SCALAR_IS_FLOAT
- SkDEBUGFAIL("SkScalar must be a float for these conversions to be valid");
-#endif
- const int ptCount = vertexCount >> 1;
- mCanvas->drawVertices(SkVertices::MakeCopy(vertexMode, ptCount, (SkPoint*)verts,
- (SkPoint*)texs, (SkColor*)colors,
- indexCount, indices),
- SkBlendMode::kModulate, paint);
+void SkiaCanvas::drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) {
+ mCanvas->drawVertices(vertices, mode, paint);
}
// ----------------------------------------------------------------------------
@@ -566,7 +557,7 @@ void SkiaCanvas::drawBitmapMesh(Bitmap& hwuiBitmap, int meshWidth, int meshHeigh
if (colors) {
flags |= SkVertices::kHasColors_BuilderFlag;
}
- SkVertices::Builder builder(SkCanvas::kTriangles_VertexMode, ptCount, indexCount, flags);
+ SkVertices::Builder builder(SkVertices::kTriangles_VertexMode, ptCount, indexCount, flags);
memcpy(builder.positions(), vertices, ptCount * sizeof(SkPoint));
if (colors) {
memcpy(builder.colors(), colors, ptCount * sizeof(SkColor));