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

Side by Side Diff: include/gpu/GrPathRendererChain.h

Issue 732693002: Drawstate on stack (Closed) Base URL: https://skia.googlesource.com/skia.git@real_def_gp
Patch Set: tiny fix Created 6 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
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrAAConvexPathRenderer.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * 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
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrPathRendererChain_DEFINED 8 #ifndef GrPathRendererChain_DEFINED
9 #define GrPathRendererChain_DEFINED 9 #define GrPathRendererChain_DEFINED
10 10
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 #include "SkTArray.h" 12 #include "SkTArray.h"
13 13
14 class GrContext; 14 class GrContext;
15 class GrDrawState;
15 class GrDrawTarget; 16 class GrDrawTarget;
16 class GrPathRenderer; 17 class GrPathRenderer;
17 class SkPath; 18 class SkPath;
18 class SkStrokeRec; 19 class SkStrokeRec;
19 20
20 /** 21 /**
21 * Keeps track of an ordered list of path renderers. When a path needs to be 22 * Keeps track of an ordered list of path renderers. When a path needs to be
22 * drawn this list is scanned to find the most preferred renderer. To add your 23 * drawn this list is scanned to find the most preferred renderer. To add your
23 * path renderer to the list implement the GrPathRenderer::AddPathRenderers 24 * path renderer to the list implement the GrPathRenderer::AddPathRenderers
24 * function. 25 * function.
(...skipping 23 matching lines...) Expand all
48 kColorAntiAlias_DrawType, // draw to color buffer, with partia l coverage AA 49 kColorAntiAlias_DrawType, // draw to color buffer, with partia l coverage AA
49 kStencilOnly_DrawType, // draw just to the stencil buffer 50 kStencilOnly_DrawType, // draw just to the stencil buffer
50 kStencilAndColor_DrawType, // draw the stencil and color buffer , no AA 51 kStencilAndColor_DrawType, // draw the stencil and color buffer , no AA
51 kStencilAndColorAntiAlias_DrawType // draw the stencil and color buffer , with partial 52 kStencilAndColorAntiAlias_DrawType // draw the stencil and color buffer , with partial
52 // coverage AA. 53 // coverage AA.
53 }; 54 };
54 /** Returns a GrPathRenderer compatible with the request if one is available . If the caller 55 /** Returns a GrPathRenderer compatible with the request if one is available . If the caller
55 is drawing the path to the stencil buffer then stencilSupport can be use d to determine 56 is drawing the path to the stencil buffer then stencilSupport can be use d to determine
56 whether the path can be rendered with arbitrary stencil rules or not. Se e comments on 57 whether the path can be rendered with arbitrary stencil rules or not. Se e comments on
57 StencilSupport in GrPathRenderer.h. */ 58 StencilSupport in GrPathRenderer.h. */
58 GrPathRenderer* getPathRenderer(const SkPath& path, 59 GrPathRenderer* getPathRenderer(const GrDrawTarget* target,
60 const GrDrawState*,
61 const SkPath& path,
59 const SkStrokeRec& rec, 62 const SkStrokeRec& rec,
60 const GrDrawTarget* target,
61 DrawType drawType, 63 DrawType drawType,
62 StencilSupport* stencilSupport); 64 StencilSupport* stencilSupport);
63 65
64 private: 66 private:
65 GrPathRendererChain(); 67 GrPathRendererChain();
66 68
67 void init(); 69 void init();
68 70
69 enum { 71 enum {
70 kPreAllocCount = 8, 72 kPreAllocCount = 8,
71 }; 73 };
72 bool fInit; 74 bool fInit;
73 GrContext* fOwner; 75 GrContext* fOwner;
74 SkSTArray<kPreAllocCount, GrPathRenderer*, true> fChain; 76 SkSTArray<kPreAllocCount, GrPathRenderer*, true> fChain;
75 77
76 typedef SkRefCnt INHERITED; 78 typedef SkRefCnt INHERITED;
77 }; 79 };
78 80
79 #endif 81 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrAAConvexPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698