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

Unified Diff: dm/DMGpuGMTask.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/DMGpuGMTask.h ('k') | dm/DMGpuTask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMGpuGMTask.cpp
diff --git a/dm/DMGpuTask.cpp b/dm/DMGpuGMTask.cpp
similarity index 68%
rename from dm/DMGpuTask.cpp
rename to dm/DMGpuGMTask.cpp
index c285d88fd708d5f9cb1a916dded79f66cc648f99..cffa2291c53f7a6303e7f282a220e6cc4e3b7f71 100644
--- a/dm/DMGpuTask.cpp
+++ b/dm/DMGpuGMTask.cpp
@@ -1,4 +1,4 @@
-#include "DMGpuTask.h"
+#include "DMGpuGMTask.h"
#include "DMExpectationsTask.h"
#include "DMUtil.h"
@@ -9,14 +9,14 @@
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)
+GpuGMTask::GpuGMTask(const char* config,
+ Reporter* reporter,
+ TaskRunner* taskRunner,
+ const Expectations& expectations,
+ skiagm::GMRegistry::Factory gmFactory,
+ GrContextFactory::GLContextType contextType,
+ int sampleCount)
+ : GpuTask(reporter, taskRunner)
, fGM(gmFactory(NULL))
, fName(UnderJoin(fGM->getName(), config))
, fExpectations(expectations)
@@ -24,13 +24,13 @@ GpuTask::GpuTask(const char* config,
, fSampleCount(sampleCount)
{}
-void GpuTask::draw() {
+void GpuGMTask::draw(GrContextFactory* grFactory) {
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));
+ grFactory->get(fContextType), info, fSampleCount));
SkCanvas* canvas = surface->getCanvas();
canvas->concat(fGM->getInitialTransform());
@@ -49,7 +49,7 @@ void GpuTask::draw() {
this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
}
-bool GpuTask::shouldSkip() const {
+bool GpuGMTask::shouldSkip() const {
return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag);
}
« no previous file with comments | « dm/DMGpuGMTask.h ('k') | dm/DMGpuTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698