OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include <new> | 7 #include <new> |
8 #include "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkDrawPictureCallback.h" | 9 #include "SkDrawPictureCallback.h" |
10 #include "SkPicturePlayback.h" | 10 #include "SkPicturePlayback.h" |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, | 1300 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, |
1301 indices, iCount, paint); | 1301 indices, iCount, paint); |
1302 } break; | 1302 } break; |
1303 case RESTORE: | 1303 case RESTORE: |
1304 canvas.restore(); | 1304 canvas.restore(); |
1305 break; | 1305 break; |
1306 case ROTATE: | 1306 case ROTATE: |
1307 canvas.rotate(reader.readScalar()); | 1307 canvas.rotate(reader.readScalar()); |
1308 break; | 1308 break; |
1309 case SAVE: | 1309 case SAVE: |
1310 canvas.save((SkCanvas::SaveFlags) reader.readInt()); | 1310 // SKPs with version < 29 also store a SaveFlags param. |
| 1311 if (size > 4) { |
| 1312 SkASSERT(8 == size); |
| 1313 reader.readInt(); |
| 1314 } |
| 1315 canvas.save(); |
1311 break; | 1316 break; |
1312 case SAVE_LAYER: { | 1317 case SAVE_LAYER: { |
1313 const SkRect* boundsPtr = this->getRectPtr(reader); | 1318 const SkRect* boundsPtr = this->getRectPtr(reader); |
1314 const SkPaint* paint = this->getPaint(reader); | 1319 const SkPaint* paint = this->getPaint(reader); |
1315 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); | 1320 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); |
1316 } break; | 1321 } break; |
1317 case SCALE: { | 1322 case SCALE: { |
1318 SkScalar sx = reader.readScalar(); | 1323 SkScalar sx = reader.readScalar(); |
1319 SkScalar sy = reader.readScalar(); | 1324 SkScalar sy = reader.readScalar(); |
1320 canvas.scale(sx, sy); | 1325 canvas.scale(sx, sy); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 for (index = 0; index < fPictureCount; index++) | 1922 for (index = 0; index < fPictureCount; index++) |
1918 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1923 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
1919 "picture%p, ", fPictureRefs[index]); | 1924 "picture%p, ", fPictureRefs[index]); |
1920 if (fPictureCount > 0) | 1925 if (fPictureCount > 0) |
1921 SkDebugf("%s0};\n", pBuffer); | 1926 SkDebugf("%s0};\n", pBuffer); |
1922 | 1927 |
1923 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1928 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
1924 } | 1929 } |
1925 | 1930 |
1926 #endif | 1931 #endif |
OLD | NEW |