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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 tex->unref(); | 69 tex->unref(); |
70 return NULL; | 70 return NULL; |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
74 return tex; | 74 return tex; |
75 } | 75 } |
76 | 76 |
77 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { | 77 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { |
78 SkASSERT(NULL == rt->getStencilBuffer()); | 78 SkASSERT(NULL == rt->getStencilBuffer()); |
79 GrResourceKey sbKey = GrStencilBuffer::ComputeKey(rt->width(), rt->height(),
rt->numSamples()); | 79 GrScratchKey sbKey; |
| 80 GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples(), &sb
Key); |
80 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( | 81 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( |
81 this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey
))); | 82 this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey
))); |
82 if (sb) { | 83 if (sb) { |
83 rt->setStencilBuffer(sb); | 84 rt->setStencilBuffer(sb); |
84 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); | 85 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); |
85 if (!attached) { | 86 if (!attached) { |
86 rt->setStencilBuffer(NULL); | 87 rt->setStencilBuffer(NULL); |
87 } | 88 } |
88 return attached; | 89 return attached; |
89 } | 90 } |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 GrDrawTarget::PathIndexType indexType, | 299 GrDrawTarget::PathIndexType indexType, |
299 const float transformValues[], | 300 const float transformValues[], |
300 GrDrawTarget::PathTransformType transformType, | 301 GrDrawTarget::PathTransformType transformType, |
301 int count, | 302 int count, |
302 const GrStencilSettings& stencilSettings) { | 303 const GrStencilSettings& stencilSettings) { |
303 this->handleDirtyContext(); | 304 this->handleDirtyContext(); |
304 pathRange->willDrawPaths(indices, indexType, count); | 305 pathRange->willDrawPaths(indices, indexType, count); |
305 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues, | 306 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues, |
306 transformType, count, stencilSettings); | 307 transformType, count, stencilSettings); |
307 } | 308 } |
OLD | NEW |