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

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

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/SkPath.cpp ('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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (record.fTextWrites != 0) 59 if (record.fTextWrites != 0)
60 SkDebugf("text size %zd (text strings:%d) ", record.fTextBytes, record.f TextWrites); 60 SkDebugf("text size %zd (text strings:%d) ", record.fTextBytes, record.f TextWrites);
61 61
62 SkDebugf("\n"); 62 SkDebugf("\n");
63 #endif 63 #endif
64 #ifdef SK_DEBUG_DUMP 64 #ifdef SK_DEBUG_DUMP
65 record.dumpMatrices(); 65 record.dumpMatrices();
66 record.dumpPaints(); 66 record.dumpPaints();
67 #endif 67 #endif
68 68
69 record.validate(record.writeStream().size(), 0); 69 record.validate(record.writeStream().bytesWritten(), 0);
70 const SkWriter32& writer = record.writeStream(); 70 const SkWriter32& writer = record.writeStream();
71 init(); 71 init();
72 if (writer.size() == 0) { 72 if (writer.bytesWritten() == 0) {
73 fOpData = SkData::NewEmpty(); 73 fOpData = SkData::NewEmpty();
74 return; 74 return;
75 } 75 }
76 76
77 fBoundingHierarchy = record.fBoundingHierarchy; 77 fBoundingHierarchy = record.fBoundingHierarchy;
78 fStateTree = record.fStateTree; 78 fStateTree = record.fStateTree;
79 79
80 SkSafeRef(fBoundingHierarchy); 80 SkSafeRef(fBoundingHierarchy);
81 SkSafeRef(fStateTree); 81 SkSafeRef(fStateTree);
82 82
83 if (NULL != fBoundingHierarchy) { 83 if (NULL != fBoundingHierarchy) {
84 fBoundingHierarchy->flushDeferredInserts(); 84 fBoundingHierarchy->flushDeferredInserts();
85 } 85 }
86 86
87 { 87 {
88 size_t size = writer.size(); 88 size_t size = writer.bytesWritten();
89 void* buffer = sk_malloc_throw(size); 89 void* buffer = sk_malloc_throw(size);
90 writer.flatten(buffer); 90 writer.flatten(buffer);
91 SkASSERT(!fOpData); 91 SkASSERT(!fOpData);
92 fOpData = SkData::NewFromMalloc(buffer, size); 92 fOpData = SkData::NewFromMalloc(buffer, size);
93 } 93 }
94 94
95 // copy over the refcnt dictionary to our reader 95 // copy over the refcnt dictionary to our reader
96 record.fFlattenableHeap.setupPlaybacks(); 96 record.fFlattenableHeap.setupPlaybacks();
97 97
98 fBitmaps = record.fBitmapHeap->extractBitmaps(); 98 fBitmaps = record.fBitmapHeap->extractBitmaps();
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 for (index = 0; index < fRegionCount; index++) 1669 for (index = 0; index < fRegionCount; index++)
1670 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1670 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1671 "region%p, ", &fRegions[index]); 1671 "region%p, ", &fRegions[index]);
1672 if (fRegionCount > 0) 1672 if (fRegionCount > 0)
1673 SkDebugf("%s0};\n", pBuffer); 1673 SkDebugf("%s0};\n", pBuffer);
1674 1674
1675 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1675 const_cast<SkPicturePlayback*>(this)->dumpStream();
1676 } 1676 }
1677 1677
1678 #endif 1678 #endif
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698