OLD | NEW |
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 case END_COMMENT_GROUP: | 291 case END_COMMENT_GROUP: |
292 // deprecated (M44) | 292 // deprecated (M44) |
293 break; | 293 break; |
294 case DRAW_IMAGE: { | 294 case DRAW_IMAGE: { |
295 const SkPaint* paint = fPictureData->getPaint(reader); | 295 const SkPaint* paint = fPictureData->getPaint(reader); |
296 const SkImage* image = fPictureData->getImage(reader); | 296 const SkImage* image = fPictureData->getImage(reader); |
297 SkPoint loc; | 297 SkPoint loc; |
298 reader->readPoint(&loc); | 298 reader->readPoint(&loc); |
299 canvas->drawImage(image, loc.fX, loc.fY, paint); | 299 canvas->drawImage(image, loc.fX, loc.fY, paint); |
300 } break; | 300 } break; |
| 301 case DRAW_IMAGE_LATTICE: { |
| 302 const SkPaint* paint = fPictureData->getPaint(reader); |
| 303 const SkImage* image = fPictureData->getImage(reader); |
| 304 SkCanvas::Lattice lattice; |
| 305 lattice.fXCount = reader->readInt(); |
| 306 lattice.fXDivs = (const int*) reader->skip(lattice.fXCount * sizeof(
int32_t)); |
| 307 lattice.fYCount = reader->readInt(); |
| 308 lattice.fYDivs = (const int*) reader->skip(lattice.fYCount * sizeof(
int32_t)); |
| 309 SkRect dst; |
| 310 reader->readRect(&dst); |
| 311 canvas->drawImageLattice(image, lattice, dst, paint); |
| 312 } break; |
301 case DRAW_IMAGE_NINE: { | 313 case DRAW_IMAGE_NINE: { |
302 const SkPaint* paint = fPictureData->getPaint(reader); | 314 const SkPaint* paint = fPictureData->getPaint(reader); |
303 const SkImage* image = fPictureData->getImage(reader); | 315 const SkImage* image = fPictureData->getImage(reader); |
304 SkIRect center; | 316 SkIRect center; |
305 reader->readIRect(¢er); | 317 reader->readIRect(¢er); |
306 SkRect dst; | 318 SkRect dst; |
307 reader->readRect(&dst); | 319 reader->readRect(&dst); |
308 canvas->drawImageNine(image, center, dst, paint); | 320 canvas->drawImageNine(image, center, dst, paint); |
309 } break; | 321 } break; |
310 case DRAW_IMAGE_RECT_STRICT: | 322 case DRAW_IMAGE_RECT_STRICT: |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 case TRANSLATE_Z: { | 631 case TRANSLATE_Z: { |
620 #ifdef SK_EXPERIMENTAL_SHADOWING | 632 #ifdef SK_EXPERIMENTAL_SHADOWING |
621 SkScalar dz = reader->readScalar(); | 633 SkScalar dz = reader->readScalar(); |
622 canvas->translateZ(dz); | 634 canvas->translateZ(dz); |
623 #endif | 635 #endif |
624 } break; | 636 } break; |
625 default: | 637 default: |
626 SkASSERTF(false, "Unknown draw type: %d", op); | 638 SkASSERTF(false, "Unknown draw type: %d", op); |
627 } | 639 } |
628 } | 640 } |
OLD | NEW |