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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 462 } |
463 } break; | 463 } break; |
464 case DRAW_RECT: { | 464 case DRAW_RECT: { |
465 const SkPaint* paint = fPictureData->getPaint(reader); | 465 const SkPaint* paint = fPictureData->getPaint(reader); |
466 SkRect rect; | 466 SkRect rect; |
467 reader->readRect(&rect); | 467 reader->readRect(&rect); |
468 if (paint) { | 468 if (paint) { |
469 canvas->drawRect(rect, *paint); | 469 canvas->drawRect(rect, *paint); |
470 } | 470 } |
471 } break; | 471 } break; |
| 472 case DRAW_REGION: { |
| 473 const SkPaint* paint = fPictureData->getPaint(reader); |
| 474 SkRegion region; |
| 475 reader->readRegion(®ion); |
| 476 if (paint) { |
| 477 canvas->drawRegion(region, *paint); |
| 478 } |
| 479 } break; |
472 case DRAW_RRECT: { | 480 case DRAW_RRECT: { |
473 const SkPaint* paint = fPictureData->getPaint(reader); | 481 const SkPaint* paint = fPictureData->getPaint(reader); |
474 SkRRect rrect; | 482 SkRRect rrect; |
475 reader->readRRect(&rrect); | 483 reader->readRRect(&rrect); |
476 if (paint) { | 484 if (paint) { |
477 canvas->drawRRect(rrect, *paint); | 485 canvas->drawRRect(rrect, *paint); |
478 } | 486 } |
479 } break; | 487 } break; |
480 case DRAW_SPRITE: { | 488 case DRAW_SPRITE: { |
481 /* const SkPaint* paint = */ fPictureData->getPaint(reader); | 489 /* const SkPaint* paint = */ fPictureData->getPaint(reader); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 case TRANSLATE_Z: { | 657 case TRANSLATE_Z: { |
650 #ifdef SK_EXPERIMENTAL_SHADOWING | 658 #ifdef SK_EXPERIMENTAL_SHADOWING |
651 SkScalar dz = reader->readScalar(); | 659 SkScalar dz = reader->readScalar(); |
652 canvas->translateZ(dz); | 660 canvas->translateZ(dz); |
653 #endif | 661 #endif |
654 } break; | 662 } break; |
655 default: | 663 default: |
656 SkASSERTF(false, "Unknown draw type: %d", op); | 664 SkASSERTF(false, "Unknown draw type: %d", op); |
657 } | 665 } |
658 } | 666 } |
OLD | NEW |