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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } break; | 250 } break; |
251 case DRAW_CLEAR: | 251 case DRAW_CLEAR: |
252 canvas->clear(reader->readInt()); | 252 canvas->clear(reader->readInt()); |
253 break; | 253 break; |
254 case DRAW_DATA: { | 254 case DRAW_DATA: { |
255 // This opcode is now dead, just need to skip it for backwards compa
tibility | 255 // This opcode is now dead, just need to skip it for backwards compa
tibility |
256 size_t length = reader->readInt(); | 256 size_t length = reader->readInt(); |
257 (void)reader->skip(length); | 257 (void)reader->skip(length); |
258 // skip handles padding the read out to a multiple of 4 | 258 // skip handles padding the read out to a multiple of 4 |
259 } break; | 259 } break; |
260 case DRAW_DRAWABLE: | |
261 canvas->drawDrawable(fPictureData->getDrawable(reader)); | |
262 break; | |
263 case DRAW_DRAWABLE_MATRIX: { | |
264 SkMatrix matrix; | |
265 reader->readMatrix(&matrix); | |
266 SkDrawable* drawable = fPictureData->getDrawable(reader); | |
267 canvas->drawDrawable(drawable, &matrix); | |
268 } break; | |
269 case DRAW_DRRECT: { | 260 case DRAW_DRRECT: { |
270 const SkPaint& paint = *fPictureData->getPaint(reader); | 261 const SkPaint& paint = *fPictureData->getPaint(reader); |
271 SkRRect outer, inner; | 262 SkRRect outer, inner; |
272 reader->readRRect(&outer); | 263 reader->readRRect(&outer); |
273 reader->readRRect(&inner); | 264 reader->readRRect(&inner); |
274 canvas->drawDRRect(outer, inner, paint); | 265 canvas->drawDRRect(outer, inner, paint); |
275 } break; | 266 } break; |
276 case BEGIN_COMMENT_GROUP: { | 267 case BEGIN_COMMENT_GROUP: { |
277 SkString tmp; | 268 SkString tmp; |
278 reader->readString(&tmp); | 269 reader->readString(&tmp); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 } break; | 560 } break; |
570 case TRANSLATE: { | 561 case TRANSLATE: { |
571 SkScalar dx = reader->readScalar(); | 562 SkScalar dx = reader->readScalar(); |
572 SkScalar dy = reader->readScalar(); | 563 SkScalar dy = reader->readScalar(); |
573 canvas->translate(dx, dy); | 564 canvas->translate(dx, dy); |
574 } break; | 565 } break; |
575 default: | 566 default: |
576 SkASSERTF(false, "Unknown draw type: %d", op); | 567 SkASSERTF(false, "Unknown draw type: %d", op); |
577 } | 568 } |
578 } | 569 } |
OLD | NEW |