Print GPU cache stats in nanobench/dm with veryVerbose

Review URL: https://codereview.chromium.org/680553002
This commit is contained in:
bsalomon 2014-10-24 10:40:50 -07:00 committed by Commit bot
parent efb7e42e37
commit 06cddec857
3 changed files with 19 additions and 4 deletions

View File

@ -576,6 +576,10 @@ int nanobench_main() {
gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts)));
#endif
if (FLAGS_veryVerbose) {
FLAGS_verbose = true;
}
if (kAutoTuneLoops != FLAGS_loops) {
FLAGS_samples = 1;
FLAGS_gpuFrameLag = 0;
@ -719,17 +723,23 @@ int nanobench_main() {
, bench->getUniqueName()
);
}
#if SK_SUPPORT_GPU && GR_CACHE_STATS
if (FLAGS_veryVerbose &&
Benchmark::kGPU_Backend == targets[j]->config.backend) {
gGrFactory->get(targets[j]->config.ctxType)->printCacheStats();
}
#endif
}
targets.deleteAll();
#if SK_SUPPORT_GPU
#if SK_SUPPORT_GPU
if (FLAGS_abandonGpuContext) {
gGrFactory->abandonContexts();
}
if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) {
gGrFactory->destroyContexts();
}
#endif
#endif
}
return 0;

View File

@ -189,7 +189,7 @@ int dm_main() {
SkAutoGraphics ag;
SkTaskGroup::Enabler enabled(FLAGS_threads);
if (FLAGS_dryRun) {
if (FLAGS_dryRun || FLAGS_veryVerbose) {
FLAGS_verbose = true;
}
#if SK_ENABLE_INST_COUNT

View File

@ -1,7 +1,7 @@
#include "DMGpuGMTask.h"
#include "DMUtil.h"
#include "DMWriteTask.h"
#include "SkCommandLineFlags.h"
#include "SkCommonFlags.h"
#include "SkSurface.h"
#include "SkTLS.h"
@ -39,6 +39,11 @@ void GpuGMTask::draw(GrContextFactory* grFactory) {
canvas->concat(fGM->getInitialTransform());
fGM->draw(canvas);
canvas->flush();
#if GR_CACHE_STATS && SK_SUPPORT_GPU
if (FLAGS_veryVerbose) {
grFactory->get(fContextType)->printCacheStats();
}
#endif
SkBitmap bitmap;
bitmap.setInfo(info);