Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: src/core/SkPicturePlayback.cpp

Issue 88233003: Code cleanup following recapture of skps (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: More cleanup Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 const SkBitmap& bitmap = getBitmap(reader); 875 const SkBitmap& bitmap = getBitmap(reader);
876 const SkPoint& loc = reader.skipT<SkPoint>(); 876 const SkPoint& loc = reader.skipT<SkPoint>();
877 canvas.drawBitmap(bitmap, loc.fX, loc.fY, paint); 877 canvas.drawBitmap(bitmap, loc.fX, loc.fY, paint);
878 } break; 878 } break;
879 case DRAW_BITMAP_RECT_TO_RECT: { 879 case DRAW_BITMAP_RECT_TO_RECT: {
880 const SkPaint* paint = getPaint(reader); 880 const SkPaint* paint = getPaint(reader);
881 const SkBitmap& bitmap = getBitmap(reader); 881 const SkBitmap& bitmap = getBitmap(reader);
882 const SkRect* src = this->getRectPtr(reader); // may be null 882 const SkRect* src = this->getRectPtr(reader); // may be null
883 const SkRect& dst = reader.skipT<SkRect>(); // required 883 const SkRect& dst = reader.skipT<SkRect>(); // required
884 SkCanvas::DrawBitmapRectFlags flags; 884 SkCanvas::DrawBitmapRectFlags flags;
885 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TO O 885 flags = (SkCanvas::DrawBitmapRectFlags) reader.readInt();
886 flags = SkCanvas::kNone_DrawBitmapRectFlag;
887 // TODO: remove this backwards compatibility code once the .skps are
888 // regenerated
889 SkASSERT(32 == size || 48 == size || // old sizes
890 36 == size || 52 == size); // new sizes
891 if (36 == size || 52 == size) {
892 #endif
893 flags = (SkCanvas::DrawBitmapRectFlags) reader.readInt();
894 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TO O
895 }
896 #endif
897 canvas.drawBitmapRectToRect(bitmap, src, dst, paint, flags); 886 canvas.drawBitmapRectToRect(bitmap, src, dst, paint, flags);
898 } break; 887 } break;
899 case DRAW_BITMAP_MATRIX: { 888 case DRAW_BITMAP_MATRIX: {
900 const SkPaint* paint = getPaint(reader); 889 const SkPaint* paint = getPaint(reader);
901 const SkBitmap& bitmap = getBitmap(reader); 890 const SkBitmap& bitmap = getBitmap(reader);
902 const SkMatrix* matrix = getMatrix(reader); 891 const SkMatrix* matrix = getMatrix(reader);
903 canvas.drawBitmapMatrix(bitmap, *matrix, paint); 892 canvas.drawBitmapMatrix(bitmap, *matrix, paint);
904 } break; 893 } break;
905 case DRAW_BITMAP_NINE: { 894 case DRAW_BITMAP_NINE: {
906 const SkPaint* paint = getPaint(reader); 895 const SkPaint* paint = getPaint(reader);
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 for (index = 0; index < fRegionCount; index++) 1659 for (index = 0; index < fRegionCount; index++)
1671 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1660 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1672 "region%p, ", &fRegions[index]); 1661 "region%p, ", &fRegions[index]);
1673 if (fRegionCount > 0) 1662 if (fRegionCount > 0)
1674 SkDebugf("%s0};\n", pBuffer); 1663 SkDebugf("%s0};\n", pBuffer);
1675 1664
1676 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1665 const_cast<SkPicturePlayback*>(this)->dumpStream();
1677 } 1666 }
1678 1667
1679 #endif 1668 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698