| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 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 #ifndef SkPDFTypes_DEFINED | 10 #ifndef SkPDFTypes_DEFINED |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 * @return The value argument is returned. | 385 * @return The value argument is returned. |
| 386 */ | 386 */ |
| 387 SkPDFObject* insert(const char key[], SkPDFObject* value); | 387 SkPDFObject* insert(const char key[], SkPDFObject* value); |
| 388 | 388 |
| 389 /** Add the int to the dictionary with the given key. | 389 /** Add the int to the dictionary with the given key. |
| 390 * @param key The text of the key for this dictionary entry. | 390 * @param key The text of the key for this dictionary entry. |
| 391 * @param value The int value for this dictionary entry. | 391 * @param value The int value for this dictionary entry. |
| 392 */ | 392 */ |
| 393 void insertInt(const char key[], int32_t value); | 393 void insertInt(const char key[], int32_t value); |
| 394 | 394 |
| 395 /** |
| 396 * Calls insertInt() but asserts in debug builds that the value can be repr
esented |
| 397 * by an int32_t. |
| 398 */ |
| 399 void insertInt(const char key[], size_t value) { |
| 400 this->insertInt(key, SkToS32(value)); |
| 401 } |
| 402 |
| 395 /** Add the scalar to the dictionary with the given key. | 403 /** Add the scalar to the dictionary with the given key. |
| 396 * @param key The text of the key for this dictionary entry. | 404 * @param key The text of the key for this dictionary entry. |
| 397 * @param value The scalar value for this dictionary entry. | 405 * @param value The scalar value for this dictionary entry. |
| 398 */ | 406 */ |
| 399 void insertScalar(const char key[], SkScalar value); | 407 void insertScalar(const char key[], SkScalar value); |
| 400 | 408 |
| 401 /** Add the name to the dictionary with the given key. | 409 /** Add the name to the dictionary with the given key. |
| 402 * @param key The text of the key for this dictionary entry. | 410 * @param key The text of the key for this dictionary entry. |
| 403 * @param name The name for this dictionary entry. | 411 * @param name The name for this dictionary entry. |
| 404 */ | 412 */ |
| (...skipping 30 matching lines...) Expand all Loading... |
| 435 | 443 |
| 436 private: | 444 private: |
| 437 static const int kMaxLen = 4095; | 445 static const int kMaxLen = 4095; |
| 438 | 446 |
| 439 SkTDArray<struct Rec> fValue; | 447 SkTDArray<struct Rec> fValue; |
| 440 | 448 |
| 441 typedef SkPDFObject INHERITED; | 449 typedef SkPDFObject INHERITED; |
| 442 }; | 450 }; |
| 443 | 451 |
| 444 #endif | 452 #endif |
| OLD | NEW |