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

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

Issue 941383003: clear stencil buffer using special purpose FBO (Closed) Base URL: https://skia.googlesource.com/skia.git@diff_clip
Patch Set: Address comment Created 5 years, 10 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 | src/gpu/gl/GrGLGpu.h » ('j') | 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( 90 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>(
91 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey)) ); 91 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey)) );
92 if (sb) { 92 if (sb) {
93 if (this->attachStencilBufferToRenderTarget(sb, rt)) { 93 if (this->attachStencilBufferToRenderTarget(sb, rt)) {
94 rt->renderTargetPriv().didAttachStencilBuffer(sb); 94 rt->renderTargetPriv().didAttachStencilBuffer(sb);
95 return true; 95 return true;
96 } 96 }
97 return false; 97 return false;
98 } 98 }
99 if (this->createStencilBufferForRenderTarget(rt, width, height)) { 99 if (this->createStencilBufferForRenderTarget(rt, width, height)) {
100 // Right now we're clearing the stencil buffer here after it is
101 // attached to an RT for the first time. When we start matching
102 // stencil buffers with smaller color targets this will no longer
103 // be correct because it won't be guaranteed to clear the entire
104 // sb.
105 // We used to clear down in the GL subclass using a special purpose
106 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
107 // FBO status.
108 this->clearStencil(rt);
109 GrStencilBuffer* sb = rt->renderTargetPriv().getStencilBuffer(); 100 GrStencilBuffer* sb = rt->renderTargetPriv().getStencilBuffer();
110 sb->resourcePriv().setUniqueKey(sbKey); 101 sb->resourcePriv().setUniqueKey(sbKey);
111 return true; 102 return true;
112 } else { 103 } else {
113 return false; 104 return false;
114 } 105 }
115 } 106 }
116 107
117 GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc) { 108 GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc) {
118 this->handleDirtyContext(); 109 this->handleDirtyContext();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 GrDrawTarget::PathIndexType indexType, 303 GrDrawTarget::PathIndexType indexType,
313 const float transformValues[], 304 const float transformValues[],
314 GrDrawTarget::PathTransformType transformType, 305 GrDrawTarget::PathTransformType transformType,
315 int count, 306 int count,
316 const GrStencilSettings& stencilSettings) { 307 const GrStencilSettings& stencilSettings) {
317 this->handleDirtyContext(); 308 this->handleDirtyContext();
318 pathRange->willDrawPaths(indices, indexType, count); 309 pathRange->willDrawPaths(indices, indexType, count);
319 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, 310 this->onDrawPaths(args, pathRange, indices, indexType, transformValues,
320 transformType, count, stencilSettings); 311 transformType, count, stencilSettings);
321 } 312 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698