OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkDeduper.h" | 9 #include "SkDeduper.h" |
10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 552 } |
553 lattice.fXDivs = skip<int32_t>(reader, lattice.fXCount); | 553 lattice.fXDivs = skip<int32_t>(reader, lattice.fXCount); |
554 lattice.fYDivs = skip<int32_t>(reader, lattice.fYCount); | 554 lattice.fYDivs = skip<int32_t>(reader, lattice.fYCount); |
555 if (packedVerb & kHasFlags_DrawImageLatticeMask) { | 555 if (packedVerb & kHasFlags_DrawImageLatticeMask) { |
556 int32_t count = (lattice.fXCount + 1) * (lattice.fYCount + 1); | 556 int32_t count = (lattice.fXCount + 1) * (lattice.fYCount + 1); |
557 SkASSERT(count > 0); | 557 SkASSERT(count > 0); |
558 lattice.fFlags = skip<SkCanvas::Lattice::Flags>(reader, SkAlign4(count))
; | 558 lattice.fFlags = skip<SkCanvas::Lattice::Flags>(reader, SkAlign4(count))
; |
559 } else { | 559 } else { |
560 lattice.fFlags = nullptr; | 560 lattice.fFlags = nullptr; |
561 } | 561 } |
| 562 lattice.fBounds = *skip<SkIRect>(reader); |
562 const SkRect* dst = skip<SkRect>(reader); | 563 const SkRect* dst = skip<SkRect>(reader); |
563 | 564 |
564 SkPaint paintStorage, *paint = nullptr; | 565 SkPaint paintStorage, *paint = nullptr; |
565 if (packedVerb & kHasPaint_DrawImageLatticeMask) { | 566 if (packedVerb & kHasPaint_DrawImageLatticeMask) { |
566 paintStorage = read_paint(reader); | 567 paintStorage = read_paint(reader); |
567 paint = &paintStorage; | 568 paint = &paintStorage; |
568 } | 569 } |
569 canvas->drawImageLattice(image.get(), lattice, *dst, paint); | 570 canvas->drawImageLattice(image.get(), lattice, *dst, paint); |
570 } | 571 } |
571 | 572 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 958 |
958 bool SkPipeDeserializer::playback(const void* data, size_t size, SkCanvas* canva
s) { | 959 bool SkPipeDeserializer::playback(const void* data, size_t size, SkCanvas* canva
s) { |
959 SkPipeInflator inflator(&fImpl->fImages, &fImpl->fPictures, | 960 SkPipeInflator inflator(&fImpl->fImages, &fImpl->fPictures, |
960 &fImpl->fTypefaces, &fImpl->fFactories, | 961 &fImpl->fTypefaces, &fImpl->fFactories, |
961 fImpl->fTFDeserializer); | 962 fImpl->fTFDeserializer); |
962 SkPipeReader reader(this, data, size); | 963 SkPipeReader reader(this, data, size); |
963 reader.setInflator(&inflator); | 964 reader.setInflator(&inflator); |
964 return do_playback(reader, canvas); | 965 return do_playback(reader, canvas); |
965 } | 966 } |
966 | 967 |
OLD | NEW |