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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 return tex; | 76 return tex; |
77 } | 77 } |
78 | 78 |
79 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { | 79 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { |
80 SkASSERT(NULL == rt->renderTargetPriv().getStencilBuffer()); | 80 SkASSERT(NULL == rt->renderTargetPriv().getStencilBuffer()); |
81 GrUniqueKey sbKey; | 81 GrUniqueKey sbKey; |
82 | 82 |
83 int width = rt->width(); | 83 int width = rt->width(); |
84 int height = rt->height(); | 84 int height = rt->height(); |
| 85 #if 0 |
85 if (this->caps()->oversizedStencilSupport()) { | 86 if (this->caps()->oversizedStencilSupport()) { |
86 width = SkNextPow2(width); | 87 width = SkNextPow2(width); |
87 height = SkNextPow2(height); | 88 height = SkNextPow2(height); |
88 } | 89 } |
| 90 #endif |
89 | 91 |
90 GrStencilBuffer::ComputeSharedStencilBufferKey(width, height, rt->numSamples
(), &sbKey); | 92 GrStencilBuffer::ComputeSharedStencilBufferKey(width, height, rt->numSamples
(), &sbKey); |
91 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( | 93 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( |
92 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey))
); | 94 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey))
); |
93 if (sb) { | 95 if (sb) { |
94 if (this->attachStencilBufferToRenderTarget(sb, rt)) { | 96 if (this->attachStencilBufferToRenderTarget(sb, rt)) { |
95 rt->renderTargetPriv().didAttachStencilBuffer(sb); | 97 rt->renderTargetPriv().didAttachStencilBuffer(sb); |
96 return true; | 98 return true; |
97 } | 99 } |
98 return false; | 100 return false; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 GrDrawTarget::PathIndexType indexType, | 315 GrDrawTarget::PathIndexType indexType, |
314 const float transformValues[], | 316 const float transformValues[], |
315 GrDrawTarget::PathTransformType transformType, | 317 GrDrawTarget::PathTransformType transformType, |
316 int count, | 318 int count, |
317 const GrStencilSettings& stencilSettings) { | 319 const GrStencilSettings& stencilSettings) { |
318 this->handleDirtyContext(); | 320 this->handleDirtyContext(); |
319 pathRange->willDrawPaths(indices, indexType, count); | 321 pathRange->willDrawPaths(indices, indexType, count); |
320 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, | 322 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, |
321 transformType, count, stencilSettings); | 323 transformType, count, stencilSettings); |
322 } | 324 } |
OLD | NEW |