/* Copyright 2010 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef GrPathIter_DEFINED #define GrPathIter_DEFINED #include "GrTypes.h" struct GrPoint; /** 2D Path iterator. Porting layer creates a subclass of this. It allows Ganesh to parse the top-level API's 2D paths. Supports lines, quadratics, and cubic pieces and moves (multi-part paths). */ class GrPathIter { public: /** Returned by next(). Indicates the next piece of the path. */ enum Command { kMove_Command, //!< next() returns 1 pt // Starts a new subpath at // at the returned point kLine_Command, //!< next() returns 2 pts // Adds a line segment kQuadratic_Command, //!< next() returns 3 pts // Adds a quadratic segment kCubic_Command, //!< next() returns 4 pts // Adds a cubic segment kClose_Command, //!< next() returns 0 pts kEnd_Command //!< next() returns 0 pts // Implictly closes the last // point }; enum ConvexHint { kNone_ConvexHint, //