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

Unified Diff: dm/DMGpuTask.cpp

Issue 179233005: DM: make GPU tasks multithreaded again. Big refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: default 1 GPU thread Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMGpuTask.h ('k') | dm/DMPipeTask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMGpuTask.cpp
diff --git a/dm/DMGpuTask.cpp b/dm/DMGpuTask.cpp
deleted file mode 100644
index c285d88fd708d5f9cb1a916dded79f66cc648f99..0000000000000000000000000000000000000000
--- a/dm/DMGpuTask.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "DMGpuTask.h"
-
-#include "DMExpectationsTask.h"
-#include "DMUtil.h"
-#include "DMWriteTask.h"
-#include "SkCommandLineFlags.h"
-#include "SkSurface.h"
-#include "SkTLS.h"
-
-namespace DM {
-
-GpuTask::GpuTask(const char* config,
- Reporter* reporter,
- TaskRunner* taskRunner,
- const Expectations& expectations,
- skiagm::GMRegistry::Factory gmFactory,
- GrContextFactory::GLContextType contextType,
- int sampleCount)
- : Task(reporter, taskRunner)
- , fGM(gmFactory(NULL))
- , fName(UnderJoin(fGM->getName(), config))
- , fExpectations(expectations)
- , fContextType(contextType)
- , fSampleCount(sampleCount)
- {}
-
-void GpuTask::draw() {
- SkImageInfo info = SkImageInfo::Make(SkScalarCeilToInt(fGM->width()),
- SkScalarCeilToInt(fGM->height()),
- kPMColor_SkColorType,
- kPremul_SkAlphaType);
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(
- this->getGrContextFactory()->get(fContextType), info, fSampleCount));
- SkCanvas* canvas = surface->getCanvas();
-
- canvas->concat(fGM->getInitialTransform());
- fGM->draw(canvas);
- canvas->flush();
-
- SkBitmap bitmap;
- bitmap.setConfig(info);
- canvas->readPixels(&bitmap, 0, 0);
-
-#if GR_CACHE_STATS
- gr->printCacheStats();
-#endif
-
- this->spawnChild(SkNEW_ARGS(ExpectationsTask, (*this, fExpectations, bitmap)));
- this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
-}
-
-bool GpuTask::shouldSkip() const {
- return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag);
-}
-
-} // namespace DM
« no previous file with comments | « dm/DMGpuTask.h ('k') | dm/DMPipeTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698