X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fskia%2Ftools%2Fbench_pictures_main.cpp;h=ade93fc3e6f05108df5aa8695818d41b929269cf;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=ac66dc50d644b1be2a27b6896487def4964bc457;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/skia/tools/bench_pictures_main.cpp b/src/third_party/skia/tools/bench_pictures_main.cpp index ac66dc5..ade93fc 100644 --- a/src/third_party/skia/tools/bench_pictures_main.cpp +++ b/src/third_party/skia/tools/bench_pictures_main.cpp @@ -54,6 +54,11 @@ DEFINE_bool(trackDeferredCaching, false, "Only meaningful with --deferImageDecod "SK_LAZY_CACHE_STATS set to true. Report percentage of cache hits when using " "deferred image decoding."); +#if GR_GPU_STATS +DEFINE_bool(gpuStats, false, "Only meaningful with gpu configurations. " + "Report some GPU call statistics."); +#endif + DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing before timing."); // Buildbot-specific parameters @@ -201,13 +206,17 @@ static bool run_single_benchmark(const SkString& inputPath, // Because the GPU preprocessing step relies on the in-memory picture // statistics we need to rerecord the picture here SkPictureRecorder recorder; - picture->draw(recorder.beginRecording(picture->width(), picture->height(), NULL, 0)); + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), + NULL, 0)); picture.reset(recorder.endRecording()); } SkString filename = SkOSPath::Basename(inputPath.c_str()); - gWriter.bench(filename.c_str(), picture->width(), picture->height()); + gWriter.bench(filename.c_str(), + SkScalarCeilToInt(picture->cullRect().width()), + SkScalarCeilToInt(picture->cullRect().height())); benchmark.run(picture); @@ -472,6 +481,15 @@ int tool_main(int argc, char** argv) { (double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses)); } #endif + +#if GR_GPU_STATS + if (FLAGS_gpuStats && benchmark.renderer()->isUsingGpuDevice()) { + GrContext* ctx = benchmark.renderer()->getGrContext(); + SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds()); + SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilations()); + } +#endif + gWriter.end(); return 0; }