| 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 "SkPicturePlayback.h" | 9 #include "SkPicturePlayback.h" |
| 10 #include "SkPictureRecord.h" | 10 #include "SkPictureRecord.h" |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, | 1272 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, |
| 1273 indices, iCount, paint); | 1273 indices, iCount, paint); |
| 1274 } break; | 1274 } break; |
| 1275 case RESTORE: | 1275 case RESTORE: |
| 1276 canvas.restore(); | 1276 canvas.restore(); |
| 1277 break; | 1277 break; |
| 1278 case ROTATE: | 1278 case ROTATE: |
| 1279 canvas.rotate(reader.readScalar()); | 1279 canvas.rotate(reader.readScalar()); |
| 1280 break; | 1280 break; |
| 1281 case SAVE: | 1281 case SAVE: |
| 1282 canvas.save((SkCanvas::SaveFlags) reader.readInt()); | 1282 // SKPs with version < 29 also store a SaveFlags param. |
| 1283 if (size > 4) { |
| 1284 SkASSERT(8 == size); |
| 1285 reader.readInt(); |
| 1286 } |
| 1287 canvas.save(); |
| 1283 break; | 1288 break; |
| 1284 case SAVE_LAYER: { | 1289 case SAVE_LAYER: { |
| 1285 const SkRect* boundsPtr = this->getRectPtr(reader); | 1290 const SkRect* boundsPtr = this->getRectPtr(reader); |
| 1286 const SkPaint* paint = this->getPaint(reader); | 1291 const SkPaint* paint = this->getPaint(reader); |
| 1287 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); | 1292 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); |
| 1288 } break; | 1293 } break; |
| 1289 case SCALE: { | 1294 case SCALE: { |
| 1290 SkScalar sx = reader.readScalar(); | 1295 SkScalar sx = reader.readScalar(); |
| 1291 SkScalar sy = reader.readScalar(); | 1296 SkScalar sy = reader.readScalar(); |
| 1292 canvas.scale(sx, sy); | 1297 canvas.scale(sx, sy); |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 for (index = 0; index < fPictureCount; index++) | 1894 for (index = 0; index < fPictureCount; index++) |
| 1890 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1895 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
| 1891 "picture%p, ", fPictureRefs[index]); | 1896 "picture%p, ", fPictureRefs[index]); |
| 1892 if (fPictureCount > 0) | 1897 if (fPictureCount > 0) |
| 1893 SkDebugf("%s0};\n", pBuffer); | 1898 SkDebugf("%s0};\n", pBuffer); |
| 1894 | 1899 |
| 1895 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1900 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
| 1896 } | 1901 } |
| 1897 | 1902 |
| 1898 #endif | 1903 #endif |
| OLD | NEW |