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

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

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 years, 6 months 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/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 canvas.drawBitmapNine(bitmap, src, dst, paint); 851 canvas.drawBitmapNine(bitmap, src, dst, paint);
852 } break; 852 } break;
853 case DRAW_CLEAR: 853 case DRAW_CLEAR:
854 canvas.clear(reader.readInt()); 854 canvas.clear(reader.readInt());
855 break; 855 break;
856 case DRAW_DATA: { 856 case DRAW_DATA: {
857 size_t length = reader.readInt(); 857 size_t length = reader.readInt();
858 canvas.drawData(reader.skip(length), length); 858 canvas.drawData(reader.skip(length), length);
859 // skip handles padding the read out to a multiple of 4 859 // skip handles padding the read out to a multiple of 4
860 } break; 860 } break;
861 case BEGIN_COMMENT_GROUP: {
862 const char* desc = reader.readString();
863 canvas.beginCommentGroup(desc);
864 } break;
865 case COMMENT: {
866 const char* kywd = reader.readString();
867 const char* value = reader.readString();
868 canvas.addComment(kywd, value);
869 } break;
870 case END_COMMENT_GROUP: {
871 canvas.endCommentGroup();
872 } break;
861 case DRAW_OVAL: { 873 case DRAW_OVAL: {
862 const SkPaint& paint = *getPaint(reader); 874 const SkPaint& paint = *getPaint(reader);
863 canvas.drawOval(reader.skipT<SkRect>(), paint); 875 canvas.drawOval(reader.skipT<SkRect>(), paint);
864 } break; 876 } break;
865 case DRAW_PAINT: 877 case DRAW_PAINT:
866 canvas.drawPaint(*getPaint(reader)); 878 canvas.drawPaint(*getPaint(reader));
867 break; 879 break;
868 case DRAW_PATH: { 880 case DRAW_PATH: {
869 const SkPaint& paint = *getPaint(reader); 881 const SkPaint& paint = *getPaint(reader);
870 canvas.drawPath(getPath(reader), paint); 882 canvas.drawPath(getPath(reader), paint);
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 for (index = 0; index < fRegionCount; index++) 1610 for (index = 0; index < fRegionCount; index++)
1599 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1611 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1600 "region%p, ", &fRegions[index]); 1612 "region%p, ", &fRegions[index]);
1601 if (fRegionCount > 0) 1613 if (fRegionCount > 0)
1602 SkDebugf("%s0};\n", pBuffer); 1614 SkDebugf("%s0};\n", pBuffer);
1603 1615
1604 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1616 const_cast<SkPicturePlayback*>(this)->dumpStream();
1605 } 1617 }
1606 1618
1607 #endif 1619 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698