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

Side by Side Diff: src/pdf/SkPDFTypes.cpp

Issue 2227673002: std::move(SkTDArray) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-08 (Monday) 09:19:06 EDT Created 4 years, 4 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 | « src/pdf/SkPDFTypes.h ('k') | src/utils/SkMultiPictureDocument.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkDeflate.h" 9 #include "SkDeflate.h"
10 #include "SkPDFTypes.h" 10 #include "SkPDFTypes.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 SkASSERT(!fDumped); 390 SkASSERT(!fDumped);
391 for (int i = 0; i < fRecords.count(); i++) { 391 for (int i = 0; i < fRecords.count(); i++) {
392 fRecords[i].fKey.addResources(catalog, substitutes); 392 fRecords[i].fKey.addResources(catalog, substitutes);
393 fRecords[i].fValue.addResources(catalog, substitutes); 393 fRecords[i].fValue.addResources(catalog, substitutes);
394 } 394 }
395 } 395 }
396 396
397 SkPDFDict::Record::Record(SkPDFUnion&& k, SkPDFUnion&& v) 397 SkPDFDict::Record::Record(SkPDFUnion&& k, SkPDFUnion&& v)
398 : fKey(std::move(k)), fValue(std::move(v)) {} 398 : fKey(std::move(k)), fValue(std::move(v)) {}
399 399
400 SkPDFDict::Record::Record(SkPDFDict::Record&& o)
401 : fKey(std::move(o.fKey)), fValue(std::move(o.fValue)) {}
402
403 SkPDFDict::Record& SkPDFDict::Record::operator=(SkPDFDict::Record&& o) {
404 fKey = std::move(o.fKey);
405 fValue = std::move(o.fValue);
406 return *this;
407 }
408
409 int SkPDFDict::size() const { return fRecords.count(); } 400 int SkPDFDict::size() const { return fRecords.count(); }
410 401
411 void SkPDFDict::insertObjRef(const char key[], sk_sp<SkPDFObject> objSp) { 402 void SkPDFDict::insertObjRef(const char key[], sk_sp<SkPDFObject> objSp) {
412 fRecords.emplace_back(SkPDFUnion::Name(key), SkPDFUnion::ObjRef(std::move(ob jSp))); 403 fRecords.emplace_back(SkPDFUnion::Name(key), SkPDFUnion::ObjRef(std::move(ob jSp)));
413 } 404 }
414 405
415 void SkPDFDict::insertObjRef(const SkString& key, sk_sp<SkPDFObject> objSp) { 406 void SkPDFDict::insertObjRef(const SkString& key, sk_sp<SkPDFObject> objSp) {
416 fRecords.emplace_back(SkPDFUnion::Name(key), SkPDFUnion::ObjRef(std::move(ob jSp))); 407 fRecords.emplace_back(SkPDFUnion::Name(key), SkPDFUnion::ObjRef(std::move(ob jSp)));
417 } 408 }
418 409
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 640
650 void SkPDFImageDumpStats() { 641 void SkPDFImageDumpStats() {
651 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n" 642 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n"
652 "total PDF jpeg images: %d\n" 643 "total PDF jpeg images: %d\n"
653 "total PDF regular images: %d\n", 644 "total PDF regular images: %d\n",
654 gDrawImageCalls.load(), 645 gDrawImageCalls.load(),
655 gJpegImageObjects.load(), 646 gJpegImageObjects.load(),
656 gRegularImageObjects.load()); 647 gRegularImageObjects.load());
657 } 648 }
658 #endif // SK_PDF_IMAGE_STATS 649 #endif // SK_PDF_IMAGE_STATS
OLDNEW
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | src/utils/SkMultiPictureDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698