| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
| 9 #include "Resources.h" | 9 #include "Resources.h" |
| 10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
| 11 #include "SkCodec.h" | 11 #include "SkCodec.h" |
| 12 #include "SkCodecImageGenerator.h" | 12 #include "SkCodecImageGenerator.h" |
| 13 #include "SkColorSpace.h" | 13 #include "SkColorSpace.h" |
| 14 #include "SkColorSpace_Base.h" | 14 #include "SkColorSpace_Base.h" |
| 15 #include "SkColorSpaceXform.h" | 15 #include "SkColorSpaceXform.h" |
| 16 #include "SkCommonFlags.h" | 16 #include "SkCommonFlags.h" |
| 17 #include "SkData.h" | 17 #include "SkData.h" |
| 18 #include "SkDeferredCanvas.h" | 18 #include "SkDeferredCanvas.h" |
| 19 #include "SkDocument.h" | 19 #include "SkDocument.h" |
| 20 #include "SkError.h" | 20 #include "SkError.h" |
| 21 #include "SkImageGenerator.h" | 21 #include "SkImageGenerator.h" |
| 22 #include "SkImageGeneratorCG.h" | 22 #include "SkImageGeneratorCG.h" |
| 23 #include "SkImageGeneratorWIC.h" | 23 #include "SkImageGeneratorWIC.h" |
| 24 #include "SkLiteDL.h" |
| 25 #include "SkLiteRecorder.h" |
| 24 #include "SkMallocPixelRef.h" | 26 #include "SkMallocPixelRef.h" |
| 25 #include "SkMultiPictureDraw.h" | 27 #include "SkMultiPictureDraw.h" |
| 26 #include "SkNullCanvas.h" | 28 #include "SkNullCanvas.h" |
| 27 #include "SkOSFile.h" | 29 #include "SkOSFile.h" |
| 28 #include "SkOpts.h" | 30 #include "SkOpts.h" |
| 29 #include "SkPictureData.h" | 31 #include "SkPictureData.h" |
| 30 #include "SkPictureRecorder.h" | 32 #include "SkPictureRecorder.h" |
| 31 #include "SkRandom.h" | 33 #include "SkRandom.h" |
| 32 #include "SkRecordDraw.h" | 34 #include "SkRecordDraw.h" |
| 33 #include "SkRecorder.h" | 35 #include "SkRecorder.h" |
| (...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 for (int i = 0; i < skr.count(); i++) { | 1604 for (int i = 0; i < skr.count(); i++) { |
| 1603 skr.visit(i, drawsAsSingletonPictures); | 1605 skr.visit(i, drawsAsSingletonPictures); |
| 1604 } | 1606 } |
| 1605 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); | 1607 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); |
| 1606 | 1608 |
| 1607 canvas->drawPicture(macroPic); | 1609 canvas->drawPicture(macroPic); |
| 1608 return check_against_reference(bitmap, src, fSink); | 1610 return check_against_reference(bitmap, src, fSink); |
| 1609 }); | 1611 }); |
| 1610 } | 1612 } |
| 1611 | 1613 |
| 1614 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 1615 |
| 1616 Error ViaLite::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStrin
g* log) const { |
| 1617 auto size = src.size(); |
| 1618 SkRect bounds = {0,0, (SkScalar)size.width(), (SkScalar)size.height()}; |
| 1619 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas
) -> Error { |
| 1620 sk_sp<SkLiteDL> dl = SkLiteDL::New(bounds); |
| 1621 |
| 1622 SkLiteRecorder rec; |
| 1623 rec.reset(dl.get()); |
| 1624 |
| 1625 Error err = src.draw(&rec); |
| 1626 if (!err.isEmpty()) { |
| 1627 return err; |
| 1628 } |
| 1629 dl->draw(canvas); |
| 1630 return ""; //check_against_reference(bitmap, src, fSink); |
| 1631 }); |
| 1632 } |
| 1633 |
| 1612 } // namespace DM | 1634 } // namespace DM |
| OLD | NEW |