Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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. |
| 163 // Direct GrGLRenderTarget instances are always created with CreateWrapped. | 163 return this->fRTFBOOwnership == GrBackendObjectOwnership::kOwned; |
|
Kimmo Kinnunen
2016/05/04 06:46:22
This was not the intention, though.
The "owns" doe
| |
| 164 SkASSERT(this->resourcePriv().refsWrappedObjects()); | |
| 165 return false; | |
| 166 } | 164 } |
| 167 | 165 |
| 168 void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 166 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 | 167 // Don't log the backing texture's contribution to the memory size. This wil l be handled by the |
| 170 // texture object. | 168 // texture object. |
| 171 | 169 |
| 172 // Log any renderbuffer's contribution to memory. We only do this if we own the renderbuffer | 170 // Log any renderbuffer's contribution to memory. We only do this if we own the renderbuffer |
| 173 // (have a fMSColorRenderbufferID). | 171 // (have a fMSColorRenderbufferID). |
| 174 if (fMSColorRenderbufferID) { | 172 if (fMSColorRenderbufferID) { |
| 175 size_t size = this->msaaSamples() * this->totalBytesPerSample(); | 173 size_t size = this->msaaSamples() * this->totalBytesPerSample(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 int GrGLRenderTarget::totalSamples() const { | 215 int GrGLRenderTarget::totalSamples() const { |
| 218 int total_samples = this->msaaSamples(); | 216 int total_samples = this->msaaSamples(); |
| 219 | 217 |
| 220 if (fTexFBOID != kUnresolvableFBOID) { | 218 if (fTexFBOID != kUnresolvableFBOID) { |
| 221 // If we own the resolve buffer then that is one more sample per pixel. | 219 // If we own the resolve buffer then that is one more sample per pixel. |
| 222 total_samples += 1; | 220 total_samples += 1; |
| 223 } | 221 } |
| 224 | 222 |
| 225 return total_samples; | 223 return total_samples; |
| 226 } | 224 } |
| OLD | NEW |