| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrTest.h" | 9 #include "GrTest.h" |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 fDrawContext->drawRect(clip, grPaint, mat, dst); | 166 fDrawContext->drawRect(clip, grPaint, mat, dst); |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 #if GR_GPU_STATS | 170 #if GR_GPU_STATS |
| 171 void GrGpu::Stats::dump(SkString* out) { | 171 void GrGpu::Stats::dump(SkString* out) { |
| 172 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds); | 172 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds); |
| 173 out->appendf("Shader Compilations: %d\n", fShaderCompilations); | 173 out->appendf("Shader Compilations: %d\n", fShaderCompilations); |
| 174 out->appendf("Textures Created: %d\n", fTextureCreates); | 174 out->appendf("Textures Created: %d\n", fTextureCreates); |
| 175 out->appendf("Texture Uploads: %d\n", fTextureUploads); | 175 out->appendf("Texture Uploads: %d\n", fTextureUploads); |
| 176 out->appendf("Transfers to Texture: %d\n", fTransfersToTexture); |
| 176 out->appendf("Stencil Buffer Creates: %d\n", fStencilAttachmentCreates); | 177 out->appendf("Stencil Buffer Creates: %d\n", fStencilAttachmentCreates); |
| 177 out->appendf("Number of draws: %d\n", fNumDraws); | 178 out->appendf("Number of draws: %d\n", fNumDraws); |
| 178 } | 179 } |
| 179 | 180 |
| 180 void GrGpu::Stats::dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>*
values) { | 181 void GrGpu::Stats::dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>*
values) { |
| 181 keys->push_back(SkString("render_target_binds")); values->push_back(fRenderT
argetBinds); | 182 keys->push_back(SkString("render_target_binds")); values->push_back(fRenderT
argetBinds); |
| 182 keys->push_back(SkString("shader_compilations")); values->push_back(fShaderC
ompilations); | 183 keys->push_back(SkString("shader_compilations")); values->push_back(fShaderC
ompilations); |
| 183 keys->push_back(SkString("textures_created")); values->push_back(fTextureCre
ates); | 184 keys->push_back(SkString("textures_created")); values->push_back(fTextureCre
ates); |
| 184 keys->push_back(SkString("texture_uploads")); values->push_back(fTextureUplo
ads); | 185 keys->push_back(SkString("texture_uploads")); values->push_back(fTextureUplo
ads); |
| 186 keys->push_back(SkString("transfers_to_texture")); values->push_back(fTransf
ersToTexture); |
| 185 keys->push_back(SkString("stencil_buffer_creates")); values->push_back(fSten
cilAttachmentCreates); | 187 keys->push_back(SkString("stencil_buffer_creates")); values->push_back(fSten
cilAttachmentCreates); |
| 186 keys->push_back(SkString("number_of_draws")); values->push_back(fNumDraws); | 188 keys->push_back(SkString("number_of_draws")); values->push_back(fNumDraws); |
| 187 } | 189 } |
| 188 | 190 |
| 189 #endif | 191 #endif |
| 190 | 192 |
| 191 #if GR_CACHE_STATS | 193 #if GR_CACHE_STATS |
| 192 void GrResourceCache::getStats(Stats* stats) const { | 194 void GrResourceCache::getStats(Stats* stats) const { |
| 193 stats->reset(); | 195 stats->reset(); |
| 194 | 196 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return false; | 332 return false; |
| 331 } | 333 } |
| 332 | 334 |
| 333 bool onWritePixels(GrSurface* surface, | 335 bool onWritePixels(GrSurface* surface, |
| 334 int left, int top, int width, int height, | 336 int left, int top, int width, int height, |
| 335 GrPixelConfig config, const void* buffer, | 337 GrPixelConfig config, const void* buffer, |
| 336 size_t rowBytes) override { | 338 size_t rowBytes) override { |
| 337 return false; | 339 return false; |
| 338 } | 340 } |
| 339 | 341 |
| 342 bool onTransferPixels(GrSurface* surface, |
| 343 int left, int top, int width, int height, |
| 344 GrPixelConfig config, GrTransferBuffer* buffer, |
| 345 size_t offset, size_t rowBytes) override { |
| 346 return false; |
| 347 } |
| 348 |
| 340 void onResolveRenderTarget(GrRenderTarget* target) override { return; } | 349 void onResolveRenderTarget(GrRenderTarget* target) override { return; } |
| 341 | 350 |
| 342 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, | 351 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, |
| 343 int width, | 352 int width, |
| 344 int height) over
ride { | 353 int height) over
ride { |
| 345 return nullptr; | 354 return nullptr; |
| 346 } | 355 } |
| 347 | 356 |
| 348 void clearStencil(GrRenderTarget* target) override {} | 357 void clearStencil(GrRenderTarget* target) override {} |
| 349 | 358 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 370 SkASSERT(nullptr == fGpu); | 379 SkASSERT(nullptr == fGpu); |
| 371 fGpu = new MockGpu(this, options); | 380 fGpu = new MockGpu(this, options); |
| 372 SkASSERT(fGpu); | 381 SkASSERT(fGpu); |
| 373 this->initCommon(options); | 382 this->initCommon(options); |
| 374 | 383 |
| 375 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 384 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 376 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 385 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 377 // resources in the buffer pools. | 386 // resources in the buffer pools. |
| 378 fDrawingManager->abandon(); | 387 fDrawingManager->abandon(); |
| 379 } | 388 } |
| OLD | NEW |