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

Side by Side Diff: src/core/SkPicturePlayback.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/core/SkLiteDL.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 const SkPaint* paint = fPictureData->getPaint(reader); 315 const SkPaint* paint = fPictureData->getPaint(reader);
316 const SkImage* image = fPictureData->getImage(reader); 316 const SkImage* image = fPictureData->getImage(reader);
317 SkCanvas::Lattice lattice; 317 SkCanvas::Lattice lattice;
318 lattice.fXCount = reader->readInt(); 318 lattice.fXCount = reader->readInt();
319 lattice.fXDivs = (const int*) reader->skip(lattice.fXCount * sizeof( int32_t)); 319 lattice.fXDivs = (const int*) reader->skip(lattice.fXCount * sizeof( int32_t));
320 lattice.fYCount = reader->readInt(); 320 lattice.fYCount = reader->readInt();
321 lattice.fYDivs = (const int*) reader->skip(lattice.fYCount * sizeof( int32_t)); 321 lattice.fYDivs = (const int*) reader->skip(lattice.fYCount * sizeof( int32_t));
322 int flagCount = reader->readInt(); 322 int flagCount = reader->readInt();
323 lattice.fFlags = (0 == flagCount) ? nullptr : (const SkCanvas::Latti ce::Flags*) 323 lattice.fFlags = (0 == flagCount) ? nullptr : (const SkCanvas::Latti ce::Flags*)
324 reader->skip(SkAlign4(flagCount * sizeof(SkCanvas::Lattice:: Flags))); 324 reader->skip(SkAlign4(flagCount * sizeof(SkCanvas::Lattice:: Flags)));
325 SkIRect src;
326 reader->readIRect(&src);
327 lattice.fBounds = &src;
325 SkRect dst; 328 SkRect dst;
326 reader->readRect(&dst); 329 reader->readRect(&dst);
327 canvas->drawImageLattice(image, lattice, dst, paint); 330 canvas->drawImageLattice(image, lattice, dst, paint);
328 } break; 331 } break;
329 case DRAW_IMAGE_NINE: { 332 case DRAW_IMAGE_NINE: {
330 const SkPaint* paint = fPictureData->getPaint(reader); 333 const SkPaint* paint = fPictureData->getPaint(reader);
331 const SkImage* image = fPictureData->getImage(reader); 334 const SkImage* image = fPictureData->getImage(reader);
332 SkIRect center; 335 SkIRect center;
333 reader->readIRect(&center); 336 reader->readIRect(&center);
334 SkRect dst; 337 SkRect dst;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 case TRANSLATE_Z: { 668 case TRANSLATE_Z: {
666 #ifdef SK_EXPERIMENTAL_SHADOWING 669 #ifdef SK_EXPERIMENTAL_SHADOWING
667 SkScalar dz = reader->readScalar(); 670 SkScalar dz = reader->readScalar();
668 canvas->translateZ(dz); 671 canvas->translateZ(dz);
669 #endif 672 #endif
670 } break; 673 } break;
671 default: 674 default:
672 SkASSERTF(false, "Unknown draw type: %d", op); 675 SkASSERTF(false, "Unknown draw type: %d", op);
673 } 676 }
674 } 677 }
OLDNEW
« no previous file with comments | « src/core/SkLiteDL.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698