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

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

Issue 137433003: Convert SkWriter32 to use an SkTDArray for its internal storage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: of course 0's fine too... Created 6 years, 11 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
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 fPictureRefs[i]->serialize(stream, encoder); 431 fPictureRefs[i]->serialize(stream, encoder);
432 } 432 }
433 } 433 }
434 434
435 // Write some of our data into a writebuffer, and then serialize that 435 // Write some of our data into a writebuffer, and then serialize that
436 // into our stream 436 // into our stream
437 { 437 {
438 SkRefCntSet typefaceSet; 438 SkRefCntSet typefaceSet;
439 SkFactorySet factSet; 439 SkFactorySet factSet;
440 440
441 SkOrderedWriteBuffer buffer(1024); 441 SkOrderedWriteBuffer buffer;
442
443 buffer.setFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag); 442 buffer.setFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag);
444 buffer.setTypefaceRecorder(&typefaceSet); 443 buffer.setTypefaceRecorder(&typefaceSet);
445 buffer.setFactoryRecorder(&factSet); 444 buffer.setFactoryRecorder(&factSet);
446 buffer.setBitmapEncoder(encoder); 445 buffer.setBitmapEncoder(encoder);
447 446
448 this->flattenToBuffer(buffer); 447 this->flattenToBuffer(buffer);
449 448
450 // We have to write these to sets into the stream *before* we write 449 // We have to write these to sets into the stream *before* we write
451 // the buffer, since parsing that buffer will require that we already 450 // the buffer, since parsing that buffer will require that we already
452 // have these sets available to use. 451 // have these sets available to use.
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 for (index = 0; index < fRegionCount; index++) 1666 for (index = 0; index < fRegionCount; index++)
1668 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1667 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1669 "region%p, ", &fRegions[index]); 1668 "region%p, ", &fRegions[index]);
1670 if (fRegionCount > 0) 1669 if (fRegionCount > 0)
1671 SkDebugf("%s0};\n", pBuffer); 1670 SkDebugf("%s0};\n", pBuffer);
1672 1671
1673 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1672 const_cast<SkPicturePlayback*>(this)->dumpStream();
1674 } 1673 }
1675 1674
1676 #endif 1675 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698