OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |