aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-03-07 17:30:10 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-08 02:19:50 +0000
commit622650a1949f9a68793ac895d9fbadee7177d860 (patch)
tree3718d4b63745f71bbc8381e8aac86c40b0aac7c8 /samplecode
parentdf04ce29490a24f9d5b4f5caafd8f6a3368a19e0 (diff)
ccpr: Simplify triangle corners
Modifies triangle corner shaders to just approximate their coverage with linear values that ramp to zero at bloat vertices outside the triangle. For the vertex backend, since corners now have the same fragment shader as the rest of the triangle, we fold them in with the other steps and draw triangles in a single pass. The geometry backend still draws triangles in two passes, as there is not an apparent performance advantage in combining them. Bug: skia: Change-Id: Ib4a89d793a3c706f734d0271875c8a3e5c87c49b Reviewed-on: https://skia-review.googlesource.com/112632 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleCCPRGeometry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp
index 2a7d6640a6..272c59fbff 100644
--- a/samplecode/SampleCCPRGeometry.cpp
+++ b/samplecode/SampleCCPRGeometry.cpp
@@ -280,7 +280,7 @@ void CCPRGeometryView::Op::onExecute(GrOpFlushState* state) {
if (!mesh.empty()) {
SkASSERT(1 == mesh.count());
- state->rtCommandBuffer()->draw(pipeline, proc, mesh.begin(), nullptr, 1, this->bounds());
+ proc.draw(state, pipeline, mesh.begin(), nullptr, 1, this->bounds());
}
if (glGpu) {
@@ -337,7 +337,7 @@ bool CCPRGeometryView::onQuery(SkEvent* evt) {
}
SkUnichar unichar;
if (SampleCode::CharQ(*evt, &unichar)) {
- if (unichar >= '1' && unichar <= '4') {
+ if (unichar >= '1' && unichar <= '3') {
fRenderPass = RenderPass(unichar - '1');
this->updateAndInval();
return true;