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 "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 } | 1004 } |
1005 canvas->flush(); | 1005 canvas->flush(); |
1006 if (FLAGS_gpuStats) { | 1006 if (FLAGS_gpuStats) { |
1007 canvas->getGrContext()->dumpCacheStats(log); | 1007 canvas->getGrContext()->dumpCacheStats(log); |
1008 canvas->getGrContext()->dumpGpuStats(log); | 1008 canvas->getGrContext()->dumpGpuStats(log); |
1009 } | 1009 } |
1010 dst->allocPixels(info); | 1010 dst->allocPixels(info); |
1011 canvas->readPixels(dst, 0, 0); | 1011 canvas->readPixels(dst, 0, 0); |
1012 if (FLAGS_abandonGpuContext) { | 1012 if (FLAGS_abandonGpuContext) { |
1013 factory.abandonContexts(); | 1013 factory.abandonContexts(); |
| 1014 } else if (FLAGS_releaseAndAbandonGpuContext) { |
| 1015 factory.releaseResourcesAndAbandonContexts(); |
1014 } | 1016 } |
1015 return ""; | 1017 return ""; |
1016 } | 1018 } |
1017 | 1019 |
1018 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 1020 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
1019 | 1021 |
1020 static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) { | 1022 static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) { |
1021 if (src.size().isEmpty()) { | 1023 if (src.size().isEmpty()) { |
1022 return "Source has empty dimensions"; | 1024 return "Source has empty dimensions"; |
1023 } | 1025 } |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 skr.visit(i, drawsAsSingletonPictures); | 1511 skr.visit(i, drawsAsSingletonPictures); |
1510 } | 1512 } |
1511 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); | 1513 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); |
1512 | 1514 |
1513 canvas->drawPicture(macroPic); | 1515 canvas->drawPicture(macroPic); |
1514 return check_against_reference(bitmap, src, fSink); | 1516 return check_against_reference(bitmap, src, fSink); |
1515 }); | 1517 }); |
1516 } | 1518 } |
1517 | 1519 |
1518 } // namespace DM | 1520 } // namespace DM |
OLD | NEW |