Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: src/gpu/GrGpu.cpp

Issue 1020203002: Disable sharing of stencil buffers across differently sized rendertargets (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698