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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 const SkPaint* paint = fPictureData->getPaint(reader); | 494 const SkPaint* paint = fPictureData->getPaint(reader); |
495 TextContainer text; | 495 TextContainer text; |
496 get_text(reader, &text); | 496 get_text(reader, &text); |
497 const SkPath& path = fPictureData->getPath(reader); | 497 const SkPath& path = fPictureData->getPath(reader); |
498 SkMatrix matrix; | 498 SkMatrix matrix; |
499 reader->readMatrix(&matrix); | 499 reader->readMatrix(&matrix); |
500 if (paint) { | 500 if (paint) { |
501 canvas->drawTextOnPath(text.text(), text.length(), path, &matrix
, *paint); | 501 canvas->drawTextOnPath(text.text(), text.length(), path, &matrix
, *paint); |
502 } | 502 } |
503 } break; | 503 } break; |
| 504 case DRAW_TEXT_RSXFORM: { |
| 505 const SkPaint* paint = fPictureData->getPaint(reader); |
| 506 int count = reader->readInt(); |
| 507 uint32_t flags = reader->read32(); |
| 508 TextContainer text; |
| 509 get_text(reader, &text); |
| 510 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size
of(SkRSXform)); |
| 511 const SkRect* cull = nullptr; |
| 512 if (flags & DRAW_TEXT_RSXFORM_HAS_CULL) { |
| 513 cull = (const SkRect*)reader->skip(sizeof(SkRect)); |
| 514 } |
| 515 canvas->drawTextRSXform(text.text(), text.length(), xform, cull, *pa
int); |
| 516 } break; |
504 case DRAW_VERTICES: { | 517 case DRAW_VERTICES: { |
505 sk_sp<SkXfermode> xfer; | 518 sk_sp<SkXfermode> xfer; |
506 const SkPaint* paint = fPictureData->getPaint(reader); | 519 const SkPaint* paint = fPictureData->getPaint(reader); |
507 DrawVertexFlags flags = (DrawVertexFlags)reader->readInt(); | 520 DrawVertexFlags flags = (DrawVertexFlags)reader->readInt(); |
508 SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader->readInt()
; | 521 SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader->readInt()
; |
509 int vCount = reader->readInt(); | 522 int vCount = reader->readInt(); |
510 const SkPoint* verts = (const SkPoint*)reader->skip(vCount * sizeof(
SkPoint)); | 523 const SkPoint* verts = (const SkPoint*)reader->skip(vCount * sizeof(
SkPoint)); |
511 const SkPoint* texs = nullptr; | 524 const SkPoint* texs = nullptr; |
512 const SkColor* colors = nullptr; | 525 const SkColor* colors = nullptr; |
513 const uint16_t* indices = nullptr; | 526 const uint16_t* indices = nullptr; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } break; | 613 } break; |
601 case TRANSLATE: { | 614 case TRANSLATE: { |
602 SkScalar dx = reader->readScalar(); | 615 SkScalar dx = reader->readScalar(); |
603 SkScalar dy = reader->readScalar(); | 616 SkScalar dy = reader->readScalar(); |
604 canvas->translate(dx, dy); | 617 canvas->translate(dx, dy); |
605 } break; | 618 } break; |
606 default: | 619 default: |
607 SkASSERTF(false, "Unknown draw type: %d", op); | 620 SkASSERTF(false, "Unknown draw type: %d", op); |
608 } | 621 } |
609 } | 622 } |
OLD | NEW |