OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrDrawContext.h" | 8 #include "GrDrawContext.h" |
9 #include "GrDrawingManager.h" | 9 #include "GrDrawingManager.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 fFlushState.reset(); | 57 fFlushState.reset(); |
58 } | 58 } |
59 | 59 |
60 void GrDrawingManager::flush() { | 60 void GrDrawingManager::flush() { |
61 if (fFlushing || this->abandoned()) { | 61 if (fFlushing || this->abandoned()) { |
62 return; | 62 return; |
63 } | 63 } |
64 fFlushing = true; | 64 fFlushing = true; |
65 | 65 |
66 SkDEBUGCODE(bool result =) | 66 SkDEBUGCODE(bool result =) |
67 SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(
&fDrawTargets); | 67 SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(
&fDrawTargets); |
68 SkASSERT(result); | 68 SkASSERT(result); |
69 | 69 |
70 #if 0 | 70 #if 0 |
71 for (int i = 0; i < fDrawTargets.count(); ++i) { | 71 for (int i = 0; i < fDrawTargets.count(); ++i) { |
72 SkDEBUGCODE(fDrawTargets[i]->dump();) | 72 SkDEBUGCODE(fDrawTargets[i]->dump();) |
73 } | 73 } |
74 #endif | 74 #endif |
75 | 75 |
76 for (int i = 0; i < fDrawTargets.count(); ++i) { | 76 for (int i = 0; i < fDrawTargets.count(); ++i) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // DrawingManager gets the creation ref - this ref is for the caller | 122 // DrawingManager gets the creation ref - this ref is for the caller |
123 return SkRef(fDrawTargets[0]); | 123 return SkRef(fDrawTargets[0]); |
124 } | 124 } |
125 #endif | 125 #endif |
126 | 126 |
127 GrDrawTarget* dt = new GrDrawTarget(rt, fContext->getGpu(), fContext->resour
ceProvider(), | 127 GrDrawTarget* dt = new GrDrawTarget(rt, fContext->getGpu(), fContext->resour
ceProvider(), |
128 fContext->getAuditTrail(), fOptionsForDr
awTargets); | 128 fContext->getAuditTrail(), fOptionsForDr
awTargets); |
129 | 129 |
130 *fDrawTargets.append() = dt; | 130 *fDrawTargets.append() = dt; |
131 | 131 |
132 // DrawingManager gets the creation ref - this ref is for the caller | 132 // DrawingManager gets the creation ref - this ref is for the caller |
133 return SkRef(dt); | 133 return SkRef(dt); |
134 } | 134 } |
135 | 135 |
136 /* | 136 /* |
137 * This method finds a path renderer that can draw the specified path on | 137 * This method finds a path renderer that can draw the specified path on |
138 * the provided target. | 138 * the provided target. |
139 * Due to its expense, the software path renderer has split out so it can | 139 * Due to its expense, the software path renderer has split out so it can |
140 * can be individually allowed/disallowed via the "allowSW" boolean. | 140 * can be individually allowed/disallowed via the "allowSW" boolean. |
141 */ | 141 */ |
142 GrPathRenderer* GrDrawingManager::getPathRenderer(const GrPathRenderer::CanDrawP
athArgs& args, | 142 GrPathRenderer* GrDrawingManager::getPathRenderer(const GrPathRenderer::CanDrawP
athArgs& args, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); | 176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); |
177 if (sb) { | 177 if (sb) { |
178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro
ps, | 178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro
ps, |
179 fContext->getAuditTrail(), fSi
ngleOwner); | 179 fContext->getAuditTrail(), fSi
ngleOwner); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), | 183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), |
184 fSingleOwner); | 184 fSingleOwner); |
185 } | 185 } |
OLD | NEW |