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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial