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

Side by Side Diff: src/gpu/gl/GrGLRenderTarget.cpp

Issue 1344033002: Minor fix to attaching stencils (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « src/gpu/GrRenderTarget.cpp ('k') | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLRenderTarget.h" 8 #include "GrGLRenderTarget.h"
9 9
10 #include "GrRenderTargetPriv.h" 10 #include "GrRenderTargetPriv.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 size_t GrGLRenderTarget::onGpuMemorySize() const { 83 size_t GrGLRenderTarget::onGpuMemorySize() const {
84 return fGpuMemorySize; 84 return fGpuMemorySize;
85 } 85 }
86 86
87 bool GrGLRenderTarget::completeStencilAttachment() { 87 bool GrGLRenderTarget::completeStencilAttachment() {
88 GrGLGpu* gpu = this->getGLGpu(); 88 GrGLGpu* gpu = this->getGLGpu();
89 const GrGLInterface* interface = gpu->glInterface(); 89 const GrGLInterface* interface = gpu->glInterface();
90 GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAttachment (); 90 GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAttachment ();
91 if (nullptr == stencil) { 91 if (nullptr == stencil) {
92 if (this->renderTargetPriv().getStencilAttachment()) { 92 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
93 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, 93 GR_GL_STENCIL_ATTACHMENT,
94 GR_GL_STENCIL_ATTACHME NT, 94 GR_GL_RENDERBUFFER, 0));
95 GR_GL_RENDERBUFFER, 0) ); 95 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
96 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, 96 GR_GL_DEPTH_ATTACHMENT,
97 GR_GL_DEPTH_ATTACHMENT , 97 GR_GL_RENDERBUFFER, 0));
98 GR_GL_RENDERBUFFER, 0) );
99 #ifdef SK_DEBUG 98 #ifdef SK_DEBUG
100 GrGLenum status; 99 GrGLenum status;
101 GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAME BUFFER)); 100 GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAMEBUFF ER));
102 SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status); 101 SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status);
103 #endif 102 #endif
104 }
105 return true; 103 return true;
106 } else { 104 } else {
107 const GrGLStencilAttachment* glStencil = static_cast<const GrGLStencilAt tachment*>(stencil); 105 const GrGLStencilAttachment* glStencil = static_cast<const GrGLStencilAt tachment*>(stencil);
108 GrGLuint rb = glStencil->renderbufferID(); 106 GrGLuint rb = glStencil->renderbufferID();
109 107
110 gpu->invalidateBoundRenderTarget(); 108 gpu->invalidateBoundRenderTarget();
111 gpu->stats()->incRenderTargetBinds(); 109 gpu->stats()->incRenderTargetBinds();
112 GR_GL_CALL(interface, BindFramebuffer(GR_GL_FRAMEBUFFER, this->renderFBO ID())); 110 GR_GL_CALL(interface, BindFramebuffer(GR_GL_FRAMEBUFFER, this->renderFBO ID()));
113 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, 111 GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
114 GR_GL_STENCIL_ATTACHMENT, 112 GR_GL_STENCIL_ATTACHMENT,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 fTexFBOID = 0; 153 fTexFBOID = 0;
156 fMSColorRenderbufferID = 0; 154 fMSColorRenderbufferID = 0;
157 INHERITED::onAbandon(); 155 INHERITED::onAbandon();
158 } 156 }
159 157
160 GrGLGpu* GrGLRenderTarget::getGLGpu() const { 158 GrGLGpu* GrGLRenderTarget::getGLGpu() const {
161 SkASSERT(!this->wasDestroyed()); 159 SkASSERT(!this->wasDestroyed());
162 return static_cast<GrGLGpu*>(this->getGpu()); 160 return static_cast<GrGLGpu*>(this->getGpu());
163 } 161 }
164 162
OLDNEW
« no previous file with comments | « src/gpu/GrRenderTarget.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698