| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const SkPaint* paint = fPictureData->getPaint(reader); | 185 const SkPaint* paint = fPictureData->getPaint(reader); |
| 186 const SkBitmap bitmap = shallow_copy(fPictureData->getBitmap(reader)
); | 186 const SkBitmap bitmap = shallow_copy(fPictureData->getBitmap(reader)
); |
| 187 const SkIRect& src = reader->skipT<SkIRect>(); | 187 const SkIRect& src = reader->skipT<SkIRect>(); |
| 188 const SkRect& dst = reader->skipT<SkRect>(); | 188 const SkRect& dst = reader->skipT<SkRect>(); |
| 189 canvas->drawBitmapNine(bitmap, src, dst, paint); | 189 canvas->drawBitmapNine(bitmap, src, dst, paint); |
| 190 } break; | 190 } break; |
| 191 case DRAW_CLEAR: | 191 case DRAW_CLEAR: |
| 192 canvas->clear(reader->readInt()); | 192 canvas->clear(reader->readInt()); |
| 193 break; | 193 break; |
| 194 case DRAW_DATA: { | 194 case DRAW_DATA: { |
| 195 // This opcode is now dead, just need to skip it for backwards compa
tibility |
| 195 size_t length = reader->readInt(); | 196 size_t length = reader->readInt(); |
| 196 canvas->drawData(reader->skip(length), length); | 197 (void)reader->skip(length); |
| 197 // skip handles padding the read out to a multiple of 4 | 198 // skip handles padding the read out to a multiple of 4 |
| 198 } break; | 199 } break; |
| 199 case DRAW_DRRECT: { | 200 case DRAW_DRRECT: { |
| 200 const SkPaint& paint = *fPictureData->getPaint(reader); | 201 const SkPaint& paint = *fPictureData->getPaint(reader); |
| 201 SkRRect outer, inner; | 202 SkRRect outer, inner; |
| 202 reader->readRRect(&outer); | 203 reader->readRRect(&outer); |
| 203 reader->readRRect(&inner); | 204 reader->readRRect(&inner); |
| 204 canvas->drawDRRect(outer, inner, paint); | 205 canvas->drawDRRect(outer, inner, paint); |
| 205 } break; | 206 } break; |
| 206 case BEGIN_COMMENT_GROUP: { | 207 case BEGIN_COMMENT_GROUP: { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 case TRANSLATE: { | 433 case TRANSLATE: { |
| 433 SkScalar dx = reader->readScalar(); | 434 SkScalar dx = reader->readScalar(); |
| 434 SkScalar dy = reader->readScalar(); | 435 SkScalar dy = reader->readScalar(); |
| 435 canvas->translate(dx, dy); | 436 canvas->translate(dx, dy); |
| 436 } break; | 437 } break; |
| 437 default: | 438 default: |
| 438 SkASSERTF(false, "Unknown draw type: %d", op); | 439 SkASSERTF(false, "Unknown draw type: %d", op); |
| 439 } | 440 } |
| 440 } | 441 } |
| 441 | 442 |
| OLD | NEW |