| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 canvas->concat(matrix); | 181 canvas->concat(matrix); |
| 182 break; | 182 break; |
| 183 } | 183 } |
| 184 case DRAW_ANNOTATION: { | 184 case DRAW_ANNOTATION: { |
| 185 SkRect rect; | 185 SkRect rect; |
| 186 reader->readRect(&rect); | 186 reader->readRect(&rect); |
| 187 SkString key; | 187 SkString key; |
| 188 reader->readString(&key); | 188 reader->readString(&key); |
| 189 canvas->drawAnnotation(rect, key.c_str(), reader->readByteArrayAsDat
a().get()); | 189 canvas->drawAnnotation(rect, key.c_str(), reader->readByteArrayAsDat
a().get()); |
| 190 } break; | 190 } break; |
| 191 case DRAW_ARC: { |
| 192 const SkPaint* paint = fPictureData->getPaint(reader); |
| 193 SkRect rect; |
| 194 reader->readRect(&rect); |
| 195 SkScalar startAngle = reader->readScalar(); |
| 196 SkScalar sweepAngle = reader->readScalar(); |
| 197 int useCenter = reader->readInt(); |
| 198 if (paint) { |
| 199 canvas->drawArc(rect, startAngle, sweepAngle, SkToBool(useCenter
), *paint); |
| 200 } |
| 201 } break; |
| 191 case DRAW_ATLAS: { | 202 case DRAW_ATLAS: { |
| 192 const SkPaint* paint = fPictureData->getPaint(reader); | 203 const SkPaint* paint = fPictureData->getPaint(reader); |
| 193 const SkImage* atlas = fPictureData->getImage(reader); | 204 const SkImage* atlas = fPictureData->getImage(reader); |
| 194 const uint32_t flags = reader->readUInt(); | 205 const uint32_t flags = reader->readUInt(); |
| 195 const int count = reader->readUInt(); | 206 const int count = reader->readUInt(); |
| 196 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size
of(SkRSXform)); | 207 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size
of(SkRSXform)); |
| 197 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec
t)); | 208 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec
t)); |
| 198 const SkColor* colors = nullptr; | 209 const SkColor* colors = nullptr; |
| 199 SkXfermode::Mode mode = SkXfermode::kDst_Mode; | 210 SkXfermode::Mode mode = SkXfermode::kDst_Mode; |
| 200 if (flags & DRAW_ATLAS_HAS_COLORS) { | 211 if (flags & DRAW_ATLAS_HAS_COLORS) { |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 case TRANSLATE_Z: { | 649 case TRANSLATE_Z: { |
| 639 #ifdef SK_EXPERIMENTAL_SHADOWING | 650 #ifdef SK_EXPERIMENTAL_SHADOWING |
| 640 SkScalar dz = reader->readScalar(); | 651 SkScalar dz = reader->readScalar(); |
| 641 canvas->translateZ(dz); | 652 canvas->translateZ(dz); |
| 642 #endif | 653 #endif |
| 643 } break; | 654 } break; |
| 644 default: | 655 default: |
| 645 SkASSERTF(false, "Unknown draw type: %d", op); | 656 SkASSERTF(false, "Unknown draw type: %d", op); |
| 646 } | 657 } |
| 647 } | 658 } |
| OLD | NEW |