| OLD | NEW |
| 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 "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
| 9 #include "SkImage_Base.h" | 9 #include "SkImage_Base.h" |
| 10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); | 659 initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); |
| 660 this->addPaintPtr(paint); | 660 this->addPaintPtr(paint); |
| 661 this->addMatrix(m); | 661 this->addMatrix(m); |
| 662 this->addPicture(picture); | 662 this->addPicture(picture); |
| 663 } | 663 } |
| 664 this->validate(initialOffset, size); | 664 this->validate(initialOffset, size); |
| 665 } | 665 } |
| 666 | 666 |
| 667 void SkPictureRecord::onDrawShadowedPicture(const SkPicture* picture, | 667 void SkPictureRecord::onDrawShadowedPicture(const SkPicture* picture, |
| 668 const SkMatrix* matrix, | 668 const SkMatrix* matrix, |
| 669 const SkPaint* paint) { | 669 const SkPaint* paint, |
| 670 const SkShadowParams& params) { |
| 670 // op + picture index | 671 // op + picture index |
| 671 size_t size = 2 * kUInt32Size; | 672 size_t size = 2 * kUInt32Size; |
| 672 size_t initialOffset; | 673 size_t initialOffset; |
| 673 | 674 |
| 675 // TODO: handle recording params. |
| 674 if (nullptr == matrix && nullptr == paint) { | 676 if (nullptr == matrix && nullptr == paint) { |
| 675 initialOffset = this->addDraw(DRAW_PICTURE, &size); | 677 initialOffset = this->addDraw(DRAW_PICTURE, &size); |
| 676 this->addPicture(picture); | 678 this->addPicture(picture); |
| 677 } else { | 679 } else { |
| 678 const SkMatrix& m = matrix ? *matrix : SkMatrix::I(); | 680 const SkMatrix& m = matrix ? *matrix : SkMatrix::I(); |
| 679 size += m.writeToMemory(nullptr) + kUInt32Size; // matrix + paint | 681 size += m.writeToMemory(nullptr) + kUInt32Size; // matrix + paint |
| 680 initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); | 682 initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); |
| 681 this->addPaintPtr(paint); | 683 this->addPaintPtr(paint); |
| 682 this->addMatrix(m); | 684 this->addMatrix(m); |
| 683 this->addPicture(picture); | 685 this->addPicture(picture); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 974 |
| 973 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { | 975 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { |
| 974 int index = fTextBlobRefs.count(); | 976 int index = fTextBlobRefs.count(); |
| 975 *fTextBlobRefs.append() = blob; | 977 *fTextBlobRefs.append() = blob; |
| 976 blob->ref(); | 978 blob->ref(); |
| 977 // follow the convention of recording a 1-based index | 979 // follow the convention of recording a 1-based index |
| 978 this->addInt(index + 1); | 980 this->addInt(index + 1); |
| 979 } | 981 } |
| 980 | 982 |
| 981 /////////////////////////////////////////////////////////////////////////////// | 983 /////////////////////////////////////////////////////////////////////////////// |
| OLD | NEW |