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" |
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1764 Error err = src.draw(&recorder); | 1764 Error err = src.draw(&recorder); |
1765 if (!err.isEmpty()) { | 1765 if (!err.isEmpty()) { |
1766 return err; | 1766 return err; |
1767 } | 1767 } |
1768 | 1768 |
1769 // Record our macro-picture, with each draw op as its own sub-picture. | 1769 // Record our macro-picture, with each draw op as its own sub-picture. |
1770 SkPictureRecorder macroRec; | 1770 SkPictureRecorder macroRec; |
1771 SkCanvas* macroCanvas = macroRec.beginRecording(SkIntToScalar(size.width
()), | 1771 SkCanvas* macroCanvas = macroRec.beginRecording(SkIntToScalar(size.width
()), |
1772 SkIntToScalar(size.heigh
t())); | 1772 SkIntToScalar(size.heigh
t())); |
1773 | 1773 |
1774 SkAutoTDelete<SkDrawableList> drawables(recorder.detachDrawableList()); | 1774 std::unique_ptr<SkDrawableList> drawables(recorder.detachDrawableList())
; |
1775 const SkDrawableList empty; | 1775 const SkDrawableList empty; |
1776 | 1776 |
1777 DrawsAsSingletonPictures drawsAsSingletonPictures = { | 1777 DrawsAsSingletonPictures drawsAsSingletonPictures = { |
1778 macroCanvas, | 1778 macroCanvas, |
1779 drawables ? *drawables : empty, | 1779 drawables ? *drawables : empty, |
1780 SkRect::MakeWH((SkScalar)size.width(), (SkScalar)size.height()), | 1780 SkRect::MakeWH((SkScalar)size.width(), (SkScalar)size.height()), |
1781 }; | 1781 }; |
1782 for (int i = 0; i < skr.count(); i++) { | 1782 for (int i = 0; i < skr.count(); i++) { |
1783 skr.visit(i, drawsAsSingletonPictures); | 1783 skr.visit(i, drawsAsSingletonPictures); |
1784 } | 1784 } |
(...skipping 18 matching lines...) Expand all Loading... |
1803 Error err = src.draw(&rec); | 1803 Error err = src.draw(&rec); |
1804 if (!err.isEmpty()) { | 1804 if (!err.isEmpty()) { |
1805 return err; | 1805 return err; |
1806 } | 1806 } |
1807 dl->draw(canvas); | 1807 dl->draw(canvas); |
1808 return check_against_reference(bitmap, src, fSink); | 1808 return check_against_reference(bitmap, src, fSink); |
1809 }); | 1809 }); |
1810 } | 1810 } |
1811 | 1811 |
1812 } // namespace DM | 1812 } // namespace DM |
OLD | NEW |