aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-04-14 09:42:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-14 09:42:34 -0700
commitfbcfd6d060f4d42e6b9de70f676564fcf1d97eb5 (patch)
tree9dc94a618eebc067b7c3af06fa0769ba926da42b /dm
parentccb0de64f38d05522353fcdcbd51a063c1d29b08 (diff)
mojo -> nojo
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp1
-rw-r--r--dm/DMSrcSink.cpp53
2 files changed, 0 insertions, 54 deletions
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> 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.