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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1689683002: SkDocument: remove use of SkTArray (part 1/3). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: size_t -> int Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkDocument.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 return "SkDocument::CreatePDF() returned nullptr"; 972 return "SkDocument::CreatePDF() returned nullptr";
973 } 973 }
974 SkTArray<SkDocument::Attribute> info; 974 SkTArray<SkDocument::Attribute> info;
975 info.emplace_back(SkString("Title"), src.name()); 975 info.emplace_back(SkString("Title"), src.name());
976 info.emplace_back(SkString("Subject"), 976 info.emplace_back(SkString("Subject"),
977 SkString("rendering correctness test")); 977 SkString("rendering correctness test"));
978 info.emplace_back(SkString("Creator"), SkString("Skia/DM")); 978 info.emplace_back(SkString("Creator"), SkString("Skia/DM"));
979 979
980 info.emplace_back(SkString("Keywords"), 980 info.emplace_back(SkString("Keywords"),
981 SkStringPrintf("Rasterizer:%s;", fRasterizer)); 981 SkStringPrintf("Rasterizer:%s;", fRasterizer));
982 doc->setMetadata(info, nullptr, nullptr); 982 doc->setMetadata(&info[0], info.count(), nullptr, nullptr);
983 return draw_skdocument(src, doc.get(), dst); 983 return draw_skdocument(src, doc.get(), dst);
984 } 984 }
985 985
986 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 986 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
987 987
988 XPSSink::XPSSink() {} 988 XPSSink::XPSSink() {}
989 989
990 Error XPSSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const { 990 Error XPSSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
991 SkAutoTUnref<SkDocument> doc(SkDocument::CreateXPS(dst)); 991 SkAutoTUnref<SkDocument> doc(SkDocument::CreateXPS(dst));
992 if (!doc) { 992 if (!doc) {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 skr.visit<void>(i, drawsAsSingletonPictures); 1410 skr.visit<void>(i, drawsAsSingletonPictures);
1411 } 1411 }
1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1413 1413
1414 canvas->drawPicture(macroPic); 1414 canvas->drawPicture(macroPic);
1415 return check_against_reference(bitmap, src, fSink); 1415 return check_against_reference(bitmap, src, fSink);
1416 }); 1416 });
1417 } 1417 }
1418 1418
1419 } // namespace DM 1419 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | include/core/SkDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698