diff options
author | Yuqian Li <liyuqian@google.com> | 2018-02-23 14:13:36 +0800 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-25 16:36:24 +0000 |
commit | b8b6253df6e60e5cce71ae584921bd9da35c1b93 (patch) | |
tree | 826849c4b6f2b55af159eae88eaa8760cf6c5bd0 /dm/DMSrcSink.h | |
parent | 3fd84fa4bff159db472db166ca31bdf969f143bb (diff) |
Add threaded backend sink to DM. Fix a scheduler bug.
The bug is spotted by the new sink. I'd expect more bugs to be revealed
and fixed using the new sink.
Bug: skia:
Change-Id: I6b0c9267079fbd6149004f0ecd55ddb179702588
Reviewed-on: https://skia-review.googlesource.com/109720
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'dm/DMSrcSink.h')
-rw-r--r-- | dm/DMSrcSink.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 1ad2eca79f..6cc5df690f 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -424,11 +424,22 @@ public: Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; const char* fileExtension() const override { return "png"; } SinkFlags flags() const override { return SinkFlags{ SinkFlags::kRaster, SinkFlags::kDirect }; } -private: +protected: + void allocPixels(const Src& src, SkBitmap*) const; + SkColorType fColorType; sk_sp<SkColorSpace> fColorSpace; }; +class ThreadedSink : public RasterSink { +public: + explicit ThreadedSink(SkColorType, sk_sp<SkColorSpace> = nullptr); + Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; + +private: + std::unique_ptr<SkExecutor> fExecutor; +}; + class SKPSink : public Sink { public: SKPSink(); |