diff options
author | Mike Klein <mtklein@google.com> | 2018-07-25 13:28:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-25 18:17:26 +0000 |
commit | 48b649060c8d3ae104274703553d7c03a58f3ddd (patch) | |
tree | 6f29689578387a2c1234a6aeb89803d3f6924c59 /dm | |
parent | 1c94a8fabed7196e985a0ed81ce8325c8f606940 (diff) |
remove SkThreadedBMPDevice and friends
It is unused, is becoming a maintainence burden and source of bugs,
and takes up a lot of time on the *SAN bots.
Change-Id: If383eb6e4838ca23140f9e16d518b1bfc655fa12
Reviewed-on: https://skia-review.googlesource.com/143307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 1 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 33 | ||||
-rw-r--r-- | dm/DMSrcSink.h | 3 |
3 files changed, 3 insertions, 34 deletions
@@ -906,7 +906,6 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi SINK("rgbx", RasterSink, kRGB_888x_SkColorType); SINK("1010102", RasterSink, kRGBA_1010102_SkColorType); SINK("101010x", RasterSink, kRGB_101010x_SkColorType); - SINK("t8888", ThreadedSink, kN32_SkColorType); SINK("pdf", PDFSink, false, SK_ScalarDefaultRasterDPI); SINK("skp", SKPSink); SINK("pipe", PipeSink); diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index d3f7ab61fe..6ba59620b8 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -56,11 +56,11 @@ #include "SkRecordDraw.h" #include "SkRecorder.h" #include "SkStream.h" +#include "SkSurface.h" #include "SkSurfaceCharacterization.h" #include "SkSwizzler.h" #include "SkTLogic.h" #include "SkTaskGroup.h" -#include "SkThreadedBMPDevice.h" #if defined(SK_BUILD_FOR_WIN) #include "SkAutoCoInitialize.h" #include "SkHRESULT.h" @@ -1804,7 +1804,7 @@ RasterSink::RasterSink(SkColorType colorType, sk_sp<SkColorSpace> colorSpace) : fColorType(colorType) , fColorSpace(std::move(colorSpace)) {} -void RasterSink::allocPixels(const Src& src, SkBitmap* dst) const { +Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) const { const SkISize size = src.size(); // If there's an appropriate alpha type for this color type, use it, otherwise use premul. SkAlphaType alphaType = kPremul_SkAlphaType; @@ -1813,42 +1813,13 @@ void RasterSink::allocPixels(const Src& src, SkBitmap* dst) const { dst->allocPixelsFlags(SkImageInfo::Make(size.width(), size.height(), fColorType, alphaType, fColorSpace), SkBitmap::kZeroPixels_AllocFlag); -} -Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) const { - this->allocPixels(src, dst); SkCanvas canvas(*dst); return src.draw(&canvas); } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -ThreadedSink::ThreadedSink(SkColorType colorType, sk_sp<SkColorSpace> colorSpace) - : RasterSink(colorType, colorSpace) {} - -Error ThreadedSink::draw(const Src& src, SkBitmap* dst, SkWStream* stream, SkString* str) const { - this->allocPixels(src, dst); - - auto canvas = skstd::make_unique<SkCanvas>( - sk_make_sp<SkThreadedBMPDevice>( - *dst, FLAGS_backendTiles, FLAGS_backendThreads)); - Error result = src.draw(canvas.get()); - canvas->flush(); - return result; - - // ??? yuqian: why does the following give me segmentation fault while the above one works? - // The seg fault occurs right in the beginning of ThreadedSink::draw with invalid - // memory address (it would crash without even calling this->allocPixels). - - // SkThreadedBMPDevice device(*dst, tileCnt, FLAGS_cpuThreads, fExecutor.get()); - // SkCanvas canvas(&device); - // Error result = src.draw(&canvas); - // canvas.flush(); - // return result; -} - -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - // Handy for front-patching a Src. Do whatever up-front work you need, then call draw_to_canvas(), // passing the Sink draw() arguments, a size, and a function draws into an SkCanvas. // Several examples below. diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 86c2279439..d42c1868aa 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -441,9 +441,8 @@ 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 }; } -protected: - void allocPixels(const Src& src, SkBitmap*) const; +private: SkColorType fColorType; sk_sp<SkColorSpace> fColorSpace; }; |