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

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

Issue 1071583003: SkPDF: Remove Array's unused set(i) and get(i) (leaving only append()) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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') | tests/PDFPrimitivesTest.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPDFTypes.h" 10 #include "SkPDFTypes.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 SkASSERT(substitutes.getSubstitute(fValue[i]) == fValue[i]); 248 SkASSERT(substitutes.getSubstitute(fValue[i]) == fValue[i]);
249 fValue[i]->addResources(catalog, substitutes); 249 fValue[i]->addResources(catalog, substitutes);
250 } 250 }
251 } 251 }
252 252
253 void SkPDFArray::reserve(int length) { 253 void SkPDFArray::reserve(int length) {
254 SkASSERT(length <= kMaxLen); 254 SkASSERT(length <= kMaxLen);
255 fValue.setReserve(length); 255 fValue.setReserve(length);
256 } 256 }
257 257
258 SkPDFObject* SkPDFArray::setAt(int offset, SkPDFObject* value) {
259 SkASSERT(offset < fValue.count());
260 value->ref();
261 fValue[offset]->unref();
262 fValue[offset] = value;
263 return value;
264 }
265
266 SkPDFObject* SkPDFArray::append(SkPDFObject* value) { 258 SkPDFObject* SkPDFArray::append(SkPDFObject* value) {
267 SkASSERT(fValue.count() < kMaxLen); 259 SkASSERT(fValue.count() < kMaxLen);
268 value->ref(); 260 value->ref();
269 fValue.push(value); 261 fValue.push(value);
270 return value; 262 return value;
271 } 263 }
272 264
273 void SkPDFArray::appendInt(int32_t value) { 265 void SkPDFArray::appendInt(int32_t value) {
274 SkASSERT(fValue.count() < kMaxLen); 266 SkASSERT(fValue.count() < kMaxLen);
275 fValue.push(new SkPDFInt(value)); 267 fValue.push(new SkPDFInt(value));
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 fObjects.push(obj); 411 fObjects.push(obj);
420 return true; 412 return true;
421 } 413 }
422 414
423 int32_t SkPDFObjNumMap::getObjectNumber(SkPDFObject* obj) const { 415 int32_t SkPDFObjNumMap::getObjectNumber(SkPDFObject* obj) const {
424 int32_t* objectNumberFound = fObjectNumbers.find(obj); 416 int32_t* objectNumberFound = fObjectNumbers.find(obj);
425 SkASSERT(objectNumberFound); 417 SkASSERT(objectNumberFound);
426 return *objectNumberFound; 418 return *objectNumberFound;
427 } 419 }
428 420
OLDNEW
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698