From fbcfd6d060f4d42e6b9de70f676564fcf1d97eb5 Mon Sep 17 00:00:00 2001 From: mtklein Date: Thu, 14 Apr 2016 09:42:34 -0700 Subject: mojo -> nojo BUG=skia:4891 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1889543003 Review URL: https://codereview.chromium.org/1889543003 --- dm/DM.cpp | 1 - dm/DMSrcSink.cpp | 53 ----------------------------------------------------- 2 files changed, 54 deletions(-) (limited to 'dm') diff --git a/dm/DM.cpp b/dm/DM.cpp index 388546d66f..86baa00701 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -870,7 +870,6 @@ static Sink* create_via(const SkString& tag, Sink* wrapped) { VIA("sp", ViaSingletonPictures, wrapped); VIA("tiles", ViaTiles, 256, 256, nullptr, wrapped); VIA("tiles_rt", ViaTiles, 256, 256, new SkRTreeFactory, wrapped); - VIA("mojo", ViaMojo, wrapped); if (FLAGS_matrix.count() == 4) { SkMatrix m; diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 815a728266..c99f326081 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -37,10 +37,6 @@ #include "SkAutoCoInitialize.h" #endif -#ifdef SK_MOJO - #include "SkMojo.mojom.h" -#endif - DEFINE_bool(multiPage, false, "For document-type backends, render the source" " into multiple pages"); DEFINE_bool(RAW_threading, true, "Allow RAW decodes to run on multiple threads?"); @@ -1395,55 +1391,6 @@ Error ViaTwice::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStri /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -#ifdef SK_MOJO - Error ViaMojo::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const { - SkPictureRecorder recorder; - SkRect size = SkRect::Make(SkIRect::MakeSize(src.size())); - Error err = src.draw(recorder.beginRecording(size)); - if (!err.isEmpty()) { - return err; - } - sk_sp skPicture(recorder.finishRecordingAsPicture()); - - SkASSERT(skPicture); - SkDynamicMemoryWStream buffer; - skPicture->serialize(&buffer); - skPicture.reset(); - SkMojo::FlattenedPicturePtr mojoPicture = SkMojo::FlattenedPicture::New(); - mojoPicture->data.resize(buffer.bytesWritten()); - buffer.copyTo(mojoPicture->data.data()); - buffer.reset(); - SkASSERT(mojoPicture.get() && mojoPicture->data); - - size_t flatSize = mojoPicture->GetSerializedSize(); - SkAutoMalloc storage(flatSize); - if (!mojoPicture->Serialize(storage.get(), flatSize)) { - return "SkMojo::FlattenedPicture::Serialize failed"; - } - mojoPicture = SkMojo::FlattenedPicture::New(); - mojoPicture->Deserialize(storage.get()); - storage.reset(); - if (!mojoPicture) { - return "SkMojo::FlattenedPicture::Deserialize failed"; - } - SkMemoryStream tmpStream(mojoPicture->data.data(), - mojoPicture->data.size()); - skPicture = SkPicture::MakeFromStream(&tmpStream); - mojoPicture.reset(); - auto fn = [&](SkCanvas* canvas) -> Error { - canvas->drawPicture(skPicture.get()); - return check_against_reference(bitmap, src, fSink); - }; - return draw_to_canvas(fSink, bitmap, stream, log, src.size(), fn); - } -#else // not SK_MOJO - Error ViaMojo::draw(const Src&, SkBitmap*, SkWStream*, SkString*) const { - return "Mojo is missing!"; - } -#endif - -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - // This is like SkRecords::Draw, in that it plays back SkRecords ops into a Canvas. // Unlike SkRecords::Draw, it builds a single-op sub-picture out of each Draw-type op. // This is an only-slightly-exaggerated simluation of Blink's Slimming Paint pictures. -- cgit v1.2.3