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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 449433003: Fix drawVertices() on GPU when texs=colors=shaders=indices=null (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra space 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7c4f4519d1b9496917c2ecadf84d096539e0627a..48ae845e3bb36afcc8f5d520c34d0e4bae717d1d 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1622,7 +1622,7 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
SkAutoTDeleteArray<uint16_t> outAlloc(NULL);
GrPrimitiveType primType;
GrPaint grPaint;
-
+
// If both textures and vertex-colors are NULL, strokes hairlines with the paint's color.
if ((NULL == texs || NULL == paint.getShader()) && NULL == colors) {
@@ -1638,13 +1638,14 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
primType = kLines_GrPrimitiveType;
int triangleCount = 0;
+ int n = (NULL == indices) ? vertexCount : indexCount;
switch (vmode) {
case SkCanvas::kTriangles_VertexMode:
- triangleCount = indexCount / 3;
+ triangleCount = n / 3;
break;
case SkCanvas::kTriangleStrip_VertexMode:
case SkCanvas::kTriangleFan_VertexMode:
- triangleCount = indexCount - 2;
+ triangleCount = n - 2;
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698