Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: dm/DMGpuGMTask.cpp

Issue 680553002: Print GPU cache stats in nanobench/dm with veryVerbose (Closed) Base URL: https://skia.googlesource.com/skia.git@stats
Patch Set: Fix no-gpu build Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DM.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMGpuGMTask.h" 1 #include "DMGpuGMTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
4 #include "SkCommandLineFlags.h" 4 #include "SkCommonFlags.h"
5 #include "SkSurface.h" 5 #include "SkSurface.h"
6 #include "SkTLS.h" 6 #include "SkTLS.h"
7 7
8 namespace DM { 8 namespace DM {
9 9
10 GpuGMTask::GpuGMTask(const char* config, 10 GpuGMTask::GpuGMTask(const char* config,
11 Reporter* reporter, 11 Reporter* reporter,
12 TaskRunner* taskRunner, 12 TaskRunner* taskRunner,
13 skiagm::GMRegistry::Factory gmFactory, 13 skiagm::GMRegistry::Factory gmFactory,
14 GrContextFactory::GLContextType contextType, 14 GrContextFactory::GLContextType contextType,
(...skipping 17 matching lines...) Expand all
32 if (!surface) { 32 if (!surface) {
33 this->fail("Could not create context for the config and the api."); 33 this->fail("Could not create context for the config and the api.");
34 return; 34 return;
35 } 35 }
36 SkCanvas* canvas = surface->getCanvas(); 36 SkCanvas* canvas = surface->getCanvas();
37 CanvasPreflight(canvas); 37 CanvasPreflight(canvas);
38 38
39 canvas->concat(fGM->getInitialTransform()); 39 canvas->concat(fGM->getInitialTransform());
40 fGM->draw(canvas); 40 fGM->draw(canvas);
41 canvas->flush(); 41 canvas->flush();
42 #if GR_CACHE_STATS && SK_SUPPORT_GPU
43 if (FLAGS_veryVerbose) {
44 grFactory->get(fContextType)->printCacheStats();
45 }
46 #endif
42 47
43 SkBitmap bitmap; 48 SkBitmap bitmap;
44 bitmap.setInfo(info); 49 bitmap.setInfo(info);
45 canvas->readPixels(&bitmap, 0, 0); 50 canvas->readPixels(&bitmap, 0, 0);
46 51
47 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap))); 52 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap)));
48 } 53 }
49 54
50 bool GpuGMTask::shouldSkip() const { 55 bool GpuGMTask::shouldSkip() const {
51 return kGPUDisabled || SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag) ; 56 return kGPUDisabled || SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag) ;
52 } 57 }
53 58
54 } // namespace DM 59 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698