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

Side by Side Diff: src/pipe/SkPipeReader.cpp

Issue 2382893002: Add a src rect to drawImageLattice() API (Closed)
Patch Set: Simplify impl Created 4 years, 2 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/pipe/SkPipeCanvas.cpp ('k') | no next file » | 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 * 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
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
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
OLDNEW
« no previous file with comments | « src/pipe/SkPipeCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698