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

Unified Diff: dm/DMSrcSink.cpp

Issue 1889543003: mojo -> nojo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/DM.cpp ('k') | experimental/mojo/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 815a728266bad8d41ce17fac57223abc5d18d431..c99f3260817413427e4741d5791e77c435ae40cb 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.
« no previous file with comments | « dm/DM.cpp ('k') | experimental/mojo/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698