OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkPicturePlayback.h" | 8 #include "SkPicturePlayback.h" |
9 #include "SkPictureRecord.h" | 9 #include "SkPictureRecord.h" |
10 #include "SkTypeface.h" | 10 #include "SkTypeface.h" |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 const SkPaint* paint = getPaint(reader); | 827 const SkPaint* paint = getPaint(reader); |
828 const SkBitmap& bitmap = getBitmap(reader); | 828 const SkBitmap& bitmap = getBitmap(reader); |
829 const SkPoint& loc = reader.skipT<SkPoint>(); | 829 const SkPoint& loc = reader.skipT<SkPoint>(); |
830 canvas.drawBitmap(bitmap, loc.fX, loc.fY, paint); | 830 canvas.drawBitmap(bitmap, loc.fX, loc.fY, paint); |
831 } break; | 831 } break; |
832 case DRAW_BITMAP_RECT_TO_RECT: { | 832 case DRAW_BITMAP_RECT_TO_RECT: { |
833 const SkPaint* paint = getPaint(reader); | 833 const SkPaint* paint = getPaint(reader); |
834 const SkBitmap& bitmap = getBitmap(reader); | 834 const SkBitmap& bitmap = getBitmap(reader); |
835 const SkRect* src = this->getRectPtr(reader); // may be null | 835 const SkRect* src = this->getRectPtr(reader); // may be null |
836 const SkRect& dst = reader.skipT<SkRect>(); // required | 836 const SkRect& dst = reader.skipT<SkRect>(); // required |
837 canvas.drawBitmapRectToRect(bitmap, src, dst, paint); | 837 SkCanvas::DrawBitmapRectFlags flags; |
| 838 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TO
O |
| 839 flags = SkCanvas::kNone_DrawBitmapRectflag; |
| 840 // TODO: remove this backwards compatibility code once the .skps
are |
| 841 // regenerated |
| 842 SkASSERT(32 == size || 48 == size || // old sizes |
| 843 36 == size || 52 == size); // new sizes |
| 844 if (36 == size || 52 == size) { |
| 845 #endif |
| 846 flags = (SkCanvas::DrawBitmapRectFlags) reader.readInt(); |
| 847 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TO
O |
| 848 } |
| 849 #endif |
| 850 canvas.drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
838 } break; | 851 } break; |
839 case DRAW_BITMAP_MATRIX: { | 852 case DRAW_BITMAP_MATRIX: { |
840 const SkPaint* paint = getPaint(reader); | 853 const SkPaint* paint = getPaint(reader); |
841 const SkBitmap& bitmap = getBitmap(reader); | 854 const SkBitmap& bitmap = getBitmap(reader); |
842 const SkMatrix* matrix = getMatrix(reader); | 855 const SkMatrix* matrix = getMatrix(reader); |
843 canvas.drawBitmapMatrix(bitmap, *matrix, paint); | 856 canvas.drawBitmapMatrix(bitmap, *matrix, paint); |
844 } break; | 857 } break; |
845 case DRAW_BITMAP_NINE: { | 858 case DRAW_BITMAP_NINE: { |
846 const SkPaint* paint = getPaint(reader); | 859 const SkPaint* paint = getPaint(reader); |
847 const SkBitmap& bitmap = getBitmap(reader); | 860 const SkBitmap& bitmap = getBitmap(reader); |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 for (index = 0; index < fRegionCount; index++) | 1622 for (index = 0; index < fRegionCount; index++) |
1610 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1623 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
1611 "region%p, ", &fRegions[index]); | 1624 "region%p, ", &fRegions[index]); |
1612 if (fRegionCount > 0) | 1625 if (fRegionCount > 0) |
1613 SkDebugf("%s0};\n", pBuffer); | 1626 SkDebugf("%s0};\n", pBuffer); |
1614 | 1627 |
1615 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1628 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
1616 } | 1629 } |
1617 | 1630 |
1618 #endif | 1631 #endif |
OLD | NEW |