| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |