diff options
author | Brian Osman <brianosman@google.com> | 2017-05-26 10:39:51 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-26 18:36:20 +0000 |
commit | 0b403f8b6b0d07f115bc15dd65af69a850fa8172 (patch) | |
tree | 2548b8a91f68ef375a6d8e416bdfa8567ed373ad /src | |
parent | eb9f278e8c5af0fe4c39df3d5647b7ea1441d861 (diff) |
Fix two more drawVertices "bugs"
1) Prior to SkVertices, drawing with local coords but no shader triggered
wireframe mode (as if no local coords were supplied, and assuming no
colors). I find the wireframe thing to be strange, but restore that
behavior to match CPU backend.
2) More importantly: If we *do* fall into the wireframe mode, make sure to
not *also* draw in non-wireframe. Yesterday's bugfix to paint
conversion caused those kinds of draws to draw wireframe, then draw in
fill mode on top.
Bug: skia:
Change-Id: Ie579b54480b4488a09c207fecbbe3badbddc5d68
Reviewed-on: https://skia-review.googlesource.com/18032
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 56dc4cc80d..6585e856d7 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1634,8 +1634,7 @@ void SkGpuDevice::wireframeVertices(SkVertices::VertexMode vmode, int vertexCoun &primitiveType); } -void SkGpuDevice::drawVertices(const SkVertices* vertices, SkBlendMode mode, - const SkPaint& paint) { +void SkGpuDevice::drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) { ASSERT_SINGLE_OWNER CHECK_SHOULD_DRAW(); GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawVertices", fContext.get()); @@ -1644,10 +1643,11 @@ void SkGpuDevice::drawVertices(const SkVertices* vertices, SkBlendMode mode, GrPaint grPaint; bool hasColors = vertices->hasColors(); bool hasTexs = vertices->hasTexCoords(); - if (!hasTexs && !hasColors) { + if ((!hasTexs || !paint.getShader()) && !hasColors) { // The dreaded wireframe mode. Fallback to drawVertices and go so slooooooow. this->wireframeVertices(vertices->mode(), vertices->vertexCount(), vertices->positions(), mode, vertices->indices(), vertices->indexCount(), paint); + return; } if (!init_vertices_paint(fContext.get(), fRenderTargetContext.get(), paint, this->ctm(), mode, hasTexs, hasColors, &grPaint)) { |