1e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com/* 2e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com * Copyright 2012 Google Inc. 3e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com * 4e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com * Use of this source code is governed by a BSD-style license that can be 5e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com * found in the LICENSE file. 6e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com */ 7e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 8e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com#include "GrPathRenderer.h" 9e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 10e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com// This path renderer is made to create geometry (i.e. primitives) from the original path (before 11e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com// the path is stroked) and render using the GPU directly rather than using any software rendering 12e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com// step. It can be rendered in a single pass for simple cases and use multiple passes for features 13e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com// like AA or opacity support. 14e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 15e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.comclass GrStrokePathRenderer : public GrPathRenderer { 16e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 17e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.compublic: 18e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com GrStrokePathRenderer(); 19e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 20e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com virtual bool canDrawPath(const SkPath& path, 21e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com const SkStrokeRec& stroke, 22e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com const GrDrawTarget* target, 2336352bf5e38f45a70ee4f4fc132a38048d38206dmtklein bool antiAlias) const override; 24e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com 25e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.comprotected: 26e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com virtual bool onDrawPath(const SkPath& path, 27e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com const SkStrokeRec& stroke, 28e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com GrDrawTarget* target, 2936352bf5e38f45a70ee4f4fc132a38048d38206dmtklein bool antiAlias) override; 30e3453cbd20d00d685131a09d9141b1c70f0c5710sugoi@google.com}; 31