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

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

Issue 1947143002: Revert of Allow stencils to be attached to render targets created via SkSurface::MakeFromBackendTextureAsRend… (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | tests/SurfaceTest.cpp » ('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 * 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 "GrGLGpu.h" 10 #include "GrGLGpu.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 fMSColorRenderbufferID = 0; 152 fMSColorRenderbufferID = 0;
153 INHERITED::onAbandon(); 153 INHERITED::onAbandon();
154 } 154 }
155 155
156 GrGLGpu* GrGLRenderTarget::getGLGpu() const { 156 GrGLGpu* GrGLRenderTarget::getGLGpu() const {
157 SkASSERT(!this->wasDestroyed()); 157 SkASSERT(!this->wasDestroyed());
158 return static_cast<GrGLGpu*>(this->getGpu()); 158 return static_cast<GrGLGpu*>(this->getGpu());
159 } 159 }
160 160
161 bool GrGLRenderTarget::canAttemptStencilAttachment() const { 161 bool GrGLRenderTarget::canAttemptStencilAttachment() const {
162 // Only modify the FBO's attachments if we have created the FBO. 162 // When we have not created the FBO ID we do not attempt to modify its attac hments.
163 return this->fRTFBOOwnership == GrBackendObjectOwnership::kOwned; 163 // Direct GrGLRenderTarget instances are always created with CreateWrapped.
164 SkASSERT(this->resourcePriv().refsWrappedObjects());
165 return false;
164 } 166 }
165 167
166 void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 168 void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
167 // Don't log the backing texture's contribution to the memory size. This wil l be handled by the 169 // Don't log the backing texture's contribution to the memory size. This wil l be handled by the
168 // texture object. 170 // texture object.
169 171
170 // Log any renderbuffer's contribution to memory. We only do this if we own the renderbuffer 172 // Log any renderbuffer's contribution to memory. We only do this if we own the renderbuffer
171 // (have a fMSColorRenderbufferID). 173 // (have a fMSColorRenderbufferID).
172 if (fMSColorRenderbufferID) { 174 if (fMSColorRenderbufferID) {
173 size_t size = this->msaaSamples() * this->totalBytesPerSample(); 175 size_t size = this->msaaSamples() * this->totalBytesPerSample();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 int GrGLRenderTarget::totalSamples() const { 217 int GrGLRenderTarget::totalSamples() const {
216 int total_samples = this->msaaSamples(); 218 int total_samples = this->msaaSamples();
217 219
218 if (fTexFBOID != kUnresolvableFBOID) { 220 if (fTexFBOID != kUnresolvableFBOID) {
219 // If we own the resolve buffer then that is one more sample per pixel. 221 // If we own the resolve buffer then that is one more sample per pixel.
220 total_samples += 1; 222 total_samples += 1;
221 } 223 }
222 224
223 return total_samples; 225 return total_samples;
224 } 226 }
OLDNEW
« no previous file with comments | « no previous file | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698