Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: src/gpu/GrReducedClip.h

Issue 653393003: Cleanup: Turn GrReducedClip into a class with a static function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1
2 /* 1 /*
3 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9 #ifndef GrReducedClip_DEFINED 8 #ifndef GrReducedClip_DEFINED
10 #define GrReducedClip_DEFINED 9 #define GrReducedClip_DEFINED
11 10
12 #include "SkClipStack.h" 11 #include "SkClipStack.h"
13 #include "SkTLList.h" 12 #include "SkTLList.h"
14 13
15 namespace GrReducedClip { 14 class SK_API GrReducedClip {
15 public:
16 typedef SkTLList<SkClipStack::Element> ElementList;
16 17
17 typedef SkTLList<SkClipStack::Element> ElementList; 18 enum InitialState {
19 kAllIn_InitialState,
20 kAllOut_InitialState,
21 };
18 22
19 enum InitialState { 23 /**
robertphillips 2014/10/23 12:24:17 overlength lines due to new indentation ?
tfarina 2014/10/24 00:38:57 Done.
20 kAllIn_InitialState, 24 * This function takes a clip stack and a query rectangle and it produces a reduced set of
21 kAllOut_InitialState, 25 * SkClipStack::Elements that are equivalent to applying the full stack to t he rectangle. The clip
26 * stack generation id that represents the list of elements is returned in r esultGenID. The
27 * initial state of the query rectangle before the first clip element is app lied is returned via
28 * initialState. Optionally, the caller can request a tighter bounds on the clip be returned via
29 * tighterBounds. If not NULL, tighterBounds will always be contained by que ryBounds after return.
30 * If tighterBounds is specified then it is assumed that the caller will imp licitly clip against it.
31 * If the caller specifies non-NULL for requiresAA then it will indicate whe ther anti-aliasing is
32 * required to process any of the elements in the result.
33 *
34 * This may become a member function of SkClipStack when its interface is de termined to be stable.
35 * Marked SK_API so that SkLua can call this in a shared library build.
36 */
37 static void ReduceClipStack(const SkClipStack& stack,
38 const SkIRect& queryBounds,
39 ElementList* result,
40 int32_t* resultGenID,
41 InitialState* initialState,
42 SkIRect* tighterBounds = NULL,
43 bool* requiresAA = NULL);
22 }; 44 };
23 45
24 /**
25 * This function takes a clip stack and a query rectangle and it produces a redu ced set of
26 * SkClipStack::Elements that are equivalent to applying the full stack to the r ectangle. The clip
27 * stack generation id that represents the list of elements is returned in resul tGenID. The
28 * initial state of the query rectangle before the first clip element is applied is returned via
29 * initialState. Optionally, the caller can request a tighter bounds on the clip be returned via
30 * tighterBounds. If not NULL, tighterBounds will always be contained by queryBo unds after return.
31 * If tighterBounds is specified then it is assumed that the caller will implici tly clip against it.
32 * If the caller specifies non-NULL for requiresAA then it will indicate whether anti-aliasing is
33 * required to process any of the elements in the result.
34 *
35 * This may become a member function of SkClipStack when its interface is determ ined to be stable.
36 * Marked SK_API so that SkLua can call this in a shared library build.
37 */
38 SK_API void ReduceClipStack(const SkClipStack& stack,
39 const SkIRect& queryBounds,
40 ElementList* result,
41 int32_t* resultGenID,
42 InitialState* initialState,
43 SkIRect* tighterBounds = NULL,
44 bool* requiresAA = NULL);
45
46 } // namespace GrReducedClip
47
48 #endif 46 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698