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

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

Issue 48593003: Avoid re-rendering stencil clip for every draw with reducable clip stack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: gcc-4.2 mac os 10.6 fix Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkTLList.h" 10 #include "SkTLList.h"
11 11
12 namespace GrReducedClip { 12 namespace GrReducedClip {
13 13
14 typedef SkTLList<SkClipStack::Element> ElementList; 14 typedef SkTLList<SkClipStack::Element> ElementList;
15 15
16 enum InitialState { 16 enum InitialState {
17 kAllIn_InitialState, 17 kAllIn_InitialState,
18 kAllOut_InitialState, 18 kAllOut_InitialState,
19 }; 19 };
20 20
21 /** 21 /**
22 * This function takes a clip stack and a query rectangle and it produces a redu ced set of 22 * This function takes a clip stack and a query rectangle and it produces a redu ced set of
23 * SkClipStack::Elements that are equivalent to applying the full stack to the r ectangle. The 23 * SkClipStack::Elements that are equivalent to applying the full stack to the r ectangle. The clip
24 * stack generation id that represents the list of elements is returned in resul tGenID. The
24 * initial state of the query rectangle before the first clip element is applied is returned via 25 * 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 * 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 queryBo unds after return. 27 * tighterBounds. If not NULL, tighterBounds will always be contained by queryBo unds after return.
27 * If tighterBounds is specified then it is assumed that the caller will implici tly clip against it. 28 * If tighterBounds is specified then it is assumed that the caller will implici tly clip against it.
28 * If the caller specifies non-NULL for requiresAA then it will indicate whether anti-aliasing is 29 * 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. 30 * required to process any of the elements in the result.
30 * 31 *
31 * This may become a member function of SkClipStack when its interface is determ ined to be stable. 32 * This may become a member function of SkClipStack when its interface is determ ined to be stable.
32 */ 33 */
33 void ReduceClipStack(const SkClipStack& stack, 34 void ReduceClipStack(const SkClipStack& stack,
34 const SkIRect& queryBounds, 35 const SkIRect& queryBounds,
35 ElementList* result, 36 ElementList* result,
37 int32_t* resultGenID,
36 InitialState* initialState, 38 InitialState* initialState,
37 SkIRect* tighterBounds = NULL, 39 SkIRect* tighterBounds = NULL,
38 bool* requiresAA = NULL); 40 bool* requiresAA = NULL);
39 41
40 } // namespace GrReducedClip 42 } // namespace GrReducedClip
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698