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 "GrResourceProvider.h" | 8 #include "GrResourceProvider.h" |
9 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Need to try and create a new stencil | 195 // Need to try and create a new stencil |
196 stencil = this->gpu()->createStencilAttachmentForRenderTarget(rt, wi
dth, height); | 196 stencil = this->gpu()->createStencilAttachmentForRenderTarget(rt, wi
dth, height); |
197 if (stencil) { | 197 if (stencil) { |
198 stencil->resourcePriv().setUniqueKey(sbKey); | 198 stencil->resourcePriv().setUniqueKey(sbKey); |
199 newStencil = true; | 199 newStencil = true; |
200 } | 200 } |
201 } | 201 } |
202 if (rt->renderTargetPriv().attachStencilAttachment(stencil)) { | 202 if (rt->renderTargetPriv().attachStencilAttachment(stencil)) { |
203 if (newStencil) { | 203 if (newStencil) { |
204 // Right now we're clearing the stencil attachment here after it
is | 204 // Right now we're clearing the stencil attachment here after it
is |
205 // attached to a RT for the first time. When we start matching | 205 // attached to an RT for the first time. When we start matching |
206 // stencil buffers with smaller color targets this will no longe
r | 206 // stencil buffers with smaller color targets this will no longe
r |
207 // be correct because it won't be guaranteed to clear the entire | 207 // be correct because it won't be guaranteed to clear the entire |
208 // sb. | 208 // sb. |
209 // We used to clear down in the GL subclass using a special purp
ose | 209 // We used to clear down in the GL subclass using a special purp
ose |
210 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns
upported | 210 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns
upported |
211 // FBO status. | 211 // FBO status. |
212 this->gpu()->clearStencil(rt); | 212 this->gpu()->clearStencil(rt); |
213 } | 213 } |
214 } | 214 } |
215 } | 215 } |
216 return rt->renderTargetPriv().getStencilAttachment(); | 216 return rt->renderTargetPriv().getStencilAttachment(); |
217 } | 217 } |
218 | 218 |
219 | 219 |
OLD | NEW |