| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // texture object. | 183 // texture object. |
| 184 | 184 |
| 185 // Log any renderbuffer's contribution to memory. We only do this if we own
the renderbuffer | 185 // Log any renderbuffer's contribution to memory. We only do this if we own
the renderbuffer |
| 186 // (have a fMSColorRenderbufferID). | 186 // (have a fMSColorRenderbufferID). |
| 187 if (fMSColorRenderbufferID) { | 187 if (fMSColorRenderbufferID) { |
| 188 size_t size = this->msaaSamples() * this->totalBytesPerSample(); | 188 size_t size = this->msaaSamples() * this->totalBytesPerSample(); |
| 189 | 189 |
| 190 // Due to this resource having both a texture and a renderbuffer compone
nt, dump as | 190 // Due to this resource having both a texture and a renderbuffer compone
nt, dump as |
| 191 // skia/gpu_resources/resource_#/renderbuffer | 191 // skia/gpu_resources/resource_#/renderbuffer |
| 192 SkString dumpName("skia/gpu_resources/resource_"); | 192 SkString dumpName("skia/gpu_resources/resource_"); |
| 193 dumpName.appendS32(this->getUniqueID()); | 193 dumpName.appendS32(this->uniqueID()); |
| 194 dumpName.append("/renderbuffer"); | 194 dumpName.append("/renderbuffer"); |
| 195 | 195 |
| 196 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", siz
e); | 196 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", siz
e); |
| 197 | 197 |
| 198 if (this->isPurgeable()) { | 198 if (this->isPurgeable()) { |
| 199 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size"
, "bytes", size); | 199 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size"
, "bytes", size); |
| 200 } | 200 } |
| 201 | 201 |
| 202 SkString renderbuffer_id; | 202 SkString renderbuffer_id; |
| 203 renderbuffer_id.appendU32(fMSColorRenderbufferID); | 203 renderbuffer_id.appendU32(fMSColorRenderbufferID); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 230 int GrGLRenderTarget::totalSamples() const { | 230 int GrGLRenderTarget::totalSamples() const { |
| 231 int total_samples = this->msaaSamples(); | 231 int total_samples = this->msaaSamples(); |
| 232 | 232 |
| 233 if (fTexFBOID != kUnresolvableFBOID) { | 233 if (fTexFBOID != kUnresolvableFBOID) { |
| 234 // If we own the resolve buffer then that is one more sample per pixel. | 234 // If we own the resolve buffer then that is one more sample per pixel. |
| 235 total_samples += 1; | 235 total_samples += 1; |
| 236 } | 236 } |
| 237 | 237 |
| 238 return total_samples; | 238 return total_samples; |
| 239 } | 239 } |
| OLD | NEW |