3 * Copyright 2012 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
9 #include "SkClipStack.h"
12 namespace GrReducedClip {
14 typedef SkTLList<SkClipStack::Element> ElementList;
22 * This function takes a clip stack and a query rectangle and it produces a reduced set of
23 * SkClipStack::Elements that are equivalent to applying the full stack to the rectangle. The
24 * initial state of the query rectangle before the first clip element is applied is returned via
25 * initialState. Optionally, the caller can request a tighter bounds on the clip be returned via
26 * tighterBounds. If not NULL, tighterBounds will always be contained by queryBounds after return.
27 * If tighterBounds is specified then it is assumed that the caller will implicitly clip against it.
28 * If the caller specifies non-NULL for requiresAA then it will indicate whether anti-aliasing is
29 * required to process any of the elements in the result.
31 * This may become a member function of SkClipStack when its interface is determined to be stable.
33 void ReduceClipStack(const SkClipStack& stack,
34 const SkIRect& queryBounds,
36 InitialState* initialState,
37 SkIRect* tighterBounds = NULL,
38 bool* requiresAA = NULL);
40 } // namespace GrReducedClip