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

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

Issue 1941353003: Allow stencils to be attached to render targets created via SkSurface::MakeFromBackendTextureAsRend… (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fix unit tests to avoid ANGLE issues 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 // When we have not created the FBO ID we do not attempt to modify its attac hments. 162 // Only modify the FBO's attachments if we have created the FBO. Public APIs do not currently
163 // Direct GrGLRenderTarget instances are always created with CreateWrapped. 163 // allow for borrowed FBO ownership, so we can safely assume that if an obje ct is owned,
164 SkASSERT(this->resourcePriv().refsWrappedObjects()); 164 // Skia created it.
165 return false; 165 return this->fRTFBOOwnership == GrBackendObjectOwnership::kOwned;
166 } 166 }
167 167
168 void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 168 void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
169 // 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
170 // texture object. 170 // texture object.
171 171
172 // 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
173 // (have a fMSColorRenderbufferID). 173 // (have a fMSColorRenderbufferID).
174 if (fMSColorRenderbufferID) { 174 if (fMSColorRenderbufferID) {
175 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
217 int GrGLRenderTarget::totalSamples() const { 217 int GrGLRenderTarget::totalSamples() const {
218 int total_samples = this->msaaSamples(); 218 int total_samples = this->msaaSamples();
219 219
220 if (fTexFBOID != kUnresolvableFBOID) { 220 if (fTexFBOID != kUnresolvableFBOID) {
221 // 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.
222 total_samples += 1; 222 total_samples += 1;
223 } 223 }
224 224
225 return total_samples; 225 return total_samples;
226 } 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