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

Side by Side Diff: src/core/SkPicturePlayback.cpp

Issue 2305433002: Add option to skip rects to drawImageLattice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better detection for zero divs Created 4 years, 3 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 canvas->drawImage(image, loc.fX, loc.fY, paint); 309 canvas->drawImage(image, loc.fX, loc.fY, paint);
310 } break; 310 } break;
311 case DRAW_IMAGE_LATTICE: { 311 case DRAW_IMAGE_LATTICE: {
312 const SkPaint* paint = fPictureData->getPaint(reader); 312 const SkPaint* paint = fPictureData->getPaint(reader);
313 const SkImage* image = fPictureData->getImage(reader); 313 const SkImage* image = fPictureData->getImage(reader);
314 SkCanvas::Lattice lattice; 314 SkCanvas::Lattice lattice;
315 lattice.fXCount = reader->readInt(); 315 lattice.fXCount = reader->readInt();
316 lattice.fXDivs = (const int*) reader->skip(lattice.fXCount * sizeof( int32_t)); 316 lattice.fXDivs = (const int*) reader->skip(lattice.fXCount * sizeof( int32_t));
317 lattice.fYCount = reader->readInt(); 317 lattice.fYCount = reader->readInt();
318 lattice.fYDivs = (const int*) reader->skip(lattice.fYCount * sizeof( int32_t)); 318 lattice.fYDivs = (const int*) reader->skip(lattice.fYCount * sizeof( int32_t));
319 int flagCount = reader->readInt();
320 lattice.fFlags = (0 == flagCount) ? nullptr : (const SkCanvas::Latti ce::Flags*)
321 reader->skip(SkAlign4(flagCount * sizeof(SkCanvas::Lattice:: Flags)));
319 SkRect dst; 322 SkRect dst;
320 reader->readRect(&dst); 323 reader->readRect(&dst);
321 canvas->drawImageLattice(image, lattice, dst, paint); 324 canvas->drawImageLattice(image, lattice, dst, paint);
322 } break; 325 } break;
323 case DRAW_IMAGE_NINE: { 326 case DRAW_IMAGE_NINE: {
324 const SkPaint* paint = fPictureData->getPaint(reader); 327 const SkPaint* paint = fPictureData->getPaint(reader);
325 const SkImage* image = fPictureData->getImage(reader); 328 const SkImage* image = fPictureData->getImage(reader);
326 SkIRect center; 329 SkIRect center;
327 reader->readIRect(&center); 330 reader->readIRect(&center);
328 SkRect dst; 331 SkRect dst;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 case TRANSLATE_Z: { 660 case TRANSLATE_Z: {
658 #ifdef SK_EXPERIMENTAL_SHADOWING 661 #ifdef SK_EXPERIMENTAL_SHADOWING
659 SkScalar dz = reader->readScalar(); 662 SkScalar dz = reader->readScalar();
660 canvas->translateZ(dz); 663 canvas->translateZ(dz);
661 #endif 664 #endif
662 } break; 665 } break;
663 default: 666 default:
664 SkASSERTF(false, "Unknown draw type: %d", op); 667 SkASSERTF(false, "Unknown draw type: %d", op);
665 } 668 }
666 } 669 }
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