| 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 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, | 1213 canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, |
| 1214 indices, iCount, paint); | 1214 indices, iCount, paint); |
| 1215 } break; | 1215 } break; |
| 1216 case RESTORE: | 1216 case RESTORE: |
| 1217 canvas.restore(); | 1217 canvas.restore(); |
| 1218 break; | 1218 break; |
| 1219 case ROTATE: | 1219 case ROTATE: |
| 1220 canvas.rotate(reader.readScalar()); | 1220 canvas.rotate(reader.readScalar()); |
| 1221 break; | 1221 break; |
| 1222 case SAVE: | 1222 case SAVE: |
| 1223 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS |
| 1223 canvas.save((SkCanvas::SaveFlags) reader.readInt()); | 1224 canvas.save((SkCanvas::SaveFlags) reader.readInt()); |
| 1225 #else |
| 1226 reader.readInt(); // Consume SaveFlags. |
| 1227 canvas.save(); |
| 1228 #endif |
| 1224 break; | 1229 break; |
| 1225 case SAVE_LAYER: { | 1230 case SAVE_LAYER: { |
| 1226 const SkRect* boundsPtr = this->getRectPtr(reader); | 1231 const SkRect* boundsPtr = this->getRectPtr(reader); |
| 1227 const SkPaint* paint = this->getPaint(reader); | 1232 const SkPaint* paint = this->getPaint(reader); |
| 1233 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS |
| 1228 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); | 1234 canvas.saveLayer(boundsPtr, paint, (SkCanvas::SaveFlags) reader.
readInt()); |
| 1235 #else |
| 1236 reader.readInt(); // Consume SaveFlags. |
| 1237 canvas.saveLayer(boundsPtr, paint); |
| 1238 #endif |
| 1229 } break; | 1239 } break; |
| 1230 case SCALE: { | 1240 case SCALE: { |
| 1231 SkScalar sx = reader.readScalar(); | 1241 SkScalar sx = reader.readScalar(); |
| 1232 SkScalar sy = reader.readScalar(); | 1242 SkScalar sy = reader.readScalar(); |
| 1233 canvas.scale(sx, sy); | 1243 canvas.scale(sx, sy); |
| 1234 } break; | 1244 } break; |
| 1235 case SET_MATRIX: { | 1245 case SET_MATRIX: { |
| 1236 SkMatrix matrix; | 1246 SkMatrix matrix; |
| 1237 this->getMatrix(reader, &matrix); | 1247 this->getMatrix(reader, &matrix); |
| 1238 matrix.postConcat(initialMatrix); | 1248 matrix.postConcat(initialMatrix); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 for (index = 0; index < fPictureCount; index++) | 1792 for (index = 0; index < fPictureCount; index++) |
| 1783 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1793 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
| 1784 "picture%p, ", fPictureRefs[index]); | 1794 "picture%p, ", fPictureRefs[index]); |
| 1785 if (fPictureCount > 0) | 1795 if (fPictureCount > 0) |
| 1786 SkDebugf("%s0};\n", pBuffer); | 1796 SkDebugf("%s0};\n", pBuffer); |
| 1787 | 1797 |
| 1788 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1798 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
| 1789 } | 1799 } |
| 1790 | 1800 |
| 1791 #endif | 1801 #endif |
| OLD | NEW |