OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 int width = rt->width(); | 140 int width = rt->width(); |
141 int height = rt->height(); | 141 int height = rt->height(); |
142 #if 0 | 142 #if 0 |
143 if (this->caps()->oversizedStencilSupport()) { | 143 if (this->caps()->oversizedStencilSupport()) { |
144 width = SkNextPow2(width); | 144 width = SkNextPow2(width); |
145 height = SkNextPow2(height); | 145 height = SkNextPow2(height); |
146 } | 146 } |
147 #endif | 147 #endif |
148 | 148 |
149 GrStencilAttachment::ComputeSharedStencilAttachmentKey(width, height, rt->nu
mSamples(), &sbKey); | 149 GrStencilAttachment::ComputeSharedStencilAttachmentKey(width, height, |
| 150 rt->numStencilSamples(), &sbKey); |
150 SkAutoTUnref<GrStencilAttachment> sb(static_cast<GrStencilAttachment*>( | 151 SkAutoTUnref<GrStencilAttachment> sb(static_cast<GrStencilAttachment*>( |
151 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey))
); | 152 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey))
); |
152 if (sb) { | 153 if (sb) { |
153 if (this->attachStencilAttachmentToRenderTarget(sb, rt)) { | 154 if (this->attachStencilAttachmentToRenderTarget(sb, rt)) { |
154 rt->renderTargetPriv().didAttachStencilAttachment(sb); | 155 rt->renderTargetPriv().didAttachStencilAttachment(sb); |
155 return true; | 156 return true; |
156 } | 157 } |
157 return false; | 158 return false; |
158 } | 159 } |
159 if (this->createStencilAttachmentForRenderTarget(rt, width, height)) { | 160 if (this->createStencilAttachmentForRenderTarget(rt, width, height)) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 //////////////////////////////////////////////////////////////////////////////// | 295 //////////////////////////////////////////////////////////////////////////////// |
295 | 296 |
296 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 297 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
297 this->handleDirtyContext(); | 298 this->handleDirtyContext(); |
298 GrVertices::Iterator iter; | 299 GrVertices::Iterator iter; |
299 const GrNonInstancedVertices* verts = iter.init(vertices); | 300 const GrNonInstancedVertices* verts = iter.init(vertices); |
300 do { | 301 do { |
301 this->onDraw(args, *verts); | 302 this->onDraw(args, *verts); |
302 } while ((verts = iter.next())); | 303 } while ((verts = iter.next())); |
303 } | 304 } |
OLD | NEW |