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

Side by Side Diff: dm/DMTask.cpp

Issue 422903002: Test abandoning GL context in dm/nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build Created 6 years, 4 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/DMGpuSupport.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMTask.h" 1 #include "DMTask.h"
2 #include "DMTaskRunner.h" 2 #include "DMTaskRunner.h"
3 #include "SkCommonFlags.h" 3 #include "SkCommonFlags.h"
4 4
5 namespace DM { 5 namespace DM {
6 6
7 Task::Task(Reporter* reporter, TaskRunner* taskRunner) 7 Task::Task(Reporter* reporter, TaskRunner* taskRunner)
8 : fReporter(reporter) 8 : fReporter(reporter)
9 , fTaskRunner(taskRunner) 9 , fTaskRunner(taskRunner)
10 , fDepth(0) { 10 , fDepth(0) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 task->run(); 61 task->run();
62 } 62 }
63 63
64 GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta skRunner) {} 64 GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta skRunner) {}
65 65
66 void GpuTask::run(GrContextFactory& factory) { 66 void GpuTask::run(GrContextFactory& factory) {
67 if (FLAGS_gpu && !this->shouldSkip()) { 67 if (FLAGS_gpu && !this->shouldSkip()) {
68 this->start(); 68 this->start();
69 if (!FLAGS_dryRun) this->draw(&factory); 69 if (!FLAGS_dryRun) this->draw(&factory);
70 this->finish(); 70 this->finish();
71 if (FLAGS_resetGpuContext) { 71 if (FLAGS_abandonGpuContext) {
72 factory.abandonContexts();
73 }
74 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) {
72 factory.destroyContexts(); 75 factory.destroyContexts();
73 } 76 }
74 } 77 }
75 SkDELETE(this); 78 SkDELETE(this);
76 } 79 }
77 80
78 void GpuTask::spawnChild(CpuTask* task) { 81 void GpuTask::spawnChild(CpuTask* task) {
79 // Really spawn a new task so it runs on the CPU threadpool instead of the G PU one we're on now. 82 // Really spawn a new task so it runs on the CPU threadpool instead of the G PU one we're on now.
80 // It goes on the front of the queue to minimize the time we must hold refer ence bitmaps in RAM. 83 // It goes on the front of the queue to minimize the time we must hold refer ence bitmaps in RAM.
81 this->spawnChildNext(task); 84 this->spawnChildNext(task);
82 } 85 }
83 86
84 } // namespace DM 87 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698