gfx/skia/trunk/src/gpu/GrReducedClip.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2012 Google Inc.
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9 #include "SkClipStack.h"
michael@0 10 #include "SkTLList.h"
michael@0 11
michael@0 12 namespace GrReducedClip {
michael@0 13
michael@0 14 typedef SkTLList<SkClipStack::Element> ElementList;
michael@0 15
michael@0 16 enum InitialState {
michael@0 17 kAllIn_InitialState,
michael@0 18 kAllOut_InitialState,
michael@0 19 };
michael@0 20
michael@0 21 /**
michael@0 22 * This function takes a clip stack and a query rectangle and it produces a reduced set of
michael@0 23 * SkClipStack::Elements that are equivalent to applying the full stack to the rectangle. The clip
michael@0 24 * stack generation id that represents the list of elements is returned in resultGenID. The
michael@0 25 * initial state of the query rectangle before the first clip element is applied is returned via
michael@0 26 * initialState. Optionally, the caller can request a tighter bounds on the clip be returned via
michael@0 27 * tighterBounds. If not NULL, tighterBounds will always be contained by queryBounds after return.
michael@0 28 * If tighterBounds is specified then it is assumed that the caller will implicitly clip against it.
michael@0 29 * If the caller specifies non-NULL for requiresAA then it will indicate whether anti-aliasing is
michael@0 30 * required to process any of the elements in the result.
michael@0 31 *
michael@0 32 * This may become a member function of SkClipStack when its interface is determined to be stable.
michael@0 33 * Marked SK_API so that SkLua can call this in a shared library build.
michael@0 34 */
michael@0 35 SK_API void ReduceClipStack(const SkClipStack& stack,
michael@0 36 const SkIRect& queryBounds,
michael@0 37 ElementList* result,
michael@0 38 int32_t* resultGenID,
michael@0 39 InitialState* initialState,
michael@0 40 SkIRect* tighterBounds = NULL,
michael@0 41 bool* requiresAA = NULL);
michael@0 42
michael@0 43 } // namespace GrReducedClip

mercurial