| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 } break; | 169 } break; |
| 170 case PUSH_CULL: break; // Deprecated, safe to ignore both push and pop. | 170 case PUSH_CULL: break; // Deprecated, safe to ignore both push and pop. |
| 171 case POP_CULL: break; | 171 case POP_CULL: break; |
| 172 case CONCAT: { | 172 case CONCAT: { |
| 173 SkMatrix matrix; | 173 SkMatrix matrix; |
| 174 reader->readMatrix(&matrix); | 174 reader->readMatrix(&matrix); |
| 175 canvas->concat(matrix); | 175 canvas->concat(matrix); |
| 176 break; | 176 break; |
| 177 } | 177 } |
| 178 case DRAW_ANNOTATION: { |
| 179 const SkRect& rect = reader->skipT<SkRect>(); |
| 180 const char* key = reader->readString(); |
| 181 SkAutoTUnref<SkData> value(reader->readData()); |
| 182 canvas->drawAnnotation(rect, key, value); |
| 183 } break; |
| 178 case DRAW_ATLAS: { | 184 case DRAW_ATLAS: { |
| 179 const SkPaint* paint = fPictureData->getPaint(reader); | 185 const SkPaint* paint = fPictureData->getPaint(reader); |
| 180 const SkImage* atlas = fPictureData->getImage(reader); | 186 const SkImage* atlas = fPictureData->getImage(reader); |
| 181 const uint32_t flags = reader->readU32(); | 187 const uint32_t flags = reader->readU32(); |
| 182 const int count = reader->readU32(); | 188 const int count = reader->readU32(); |
| 183 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size
of(SkRSXform)); | 189 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size
of(SkRSXform)); |
| 184 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec
t)); | 190 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec
t)); |
| 185 const SkColor* colors = nullptr; | 191 const SkColor* colors = nullptr; |
| 186 SkXfermode::Mode mode = SkXfermode::kDst_Mode; | 192 SkXfermode::Mode mode = SkXfermode::kDst_Mode; |
| 187 if (flags & DRAW_ATLAS_HAS_COLORS) { | 193 if (flags & DRAW_ATLAS_HAS_COLORS) { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 case TRANSLATE: { | 527 case TRANSLATE: { |
| 522 SkScalar dx = reader->readScalar(); | 528 SkScalar dx = reader->readScalar(); |
| 523 SkScalar dy = reader->readScalar(); | 529 SkScalar dy = reader->readScalar(); |
| 524 canvas->translate(dx, dy); | 530 canvas->translate(dx, dy); |
| 525 } break; | 531 } break; |
| 526 default: | 532 default: |
| 527 SkASSERTF(false, "Unknown draw type: %d", op); | 533 SkASSERTF(false, "Unknown draw type: %d", op); |
| 528 } | 534 } |
| 529 } | 535 } |
| 530 | 536 |
| OLD | NEW |