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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 fPictureRefs[i]->serialize(stream, encoder); | 404 fPictureRefs[i]->serialize(stream, encoder); |
405 } | 405 } |
406 } | 406 } |
407 | 407 |
408 // Write some of our data into a writebuffer, and then serialize that | 408 // Write some of our data into a writebuffer, and then serialize that |
409 // into our stream | 409 // into our stream |
410 { | 410 { |
411 SkRefCntSet typefaceSet; | 411 SkRefCntSet typefaceSet; |
412 SkFactorySet factSet; | 412 SkFactorySet factSet; |
413 | 413 |
414 SkWriteBuffer buffer; | 414 SkWriteBuffer buffer(SkWriteBuffer::kCrossProcess_Flag); |
415 buffer.setFlags(SkWriteBuffer::kCrossProcess_Flag); | |
416 buffer.setTypefaceRecorder(&typefaceSet); | 415 buffer.setTypefaceRecorder(&typefaceSet); |
417 buffer.setFactoryRecorder(&factSet); | 416 buffer.setFactoryRecorder(&factSet); |
418 buffer.setBitmapEncoder(encoder); | 417 buffer.setBitmapEncoder(encoder); |
419 | 418 |
420 this->flattenToBuffer(buffer); | 419 this->flattenToBuffer(buffer); |
421 | 420 |
422 // We have to write these to sets into the stream *before* we write | 421 // We have to write these to sets into the stream *before* we write |
423 // the buffer, since parsing that buffer will require that we already | 422 // the buffer, since parsing that buffer will require that we already |
424 // have these sets available to use. | 423 // have these sets available to use. |
425 writeFactories(stream, factSet); | 424 writeFactories(stream, factSet); |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 for (index = 0; index < fPictureCount; index++) | 1590 for (index = 0; index < fPictureCount; index++) |
1592 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1591 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
1593 "picture%p, ", fPictureRefs[index]); | 1592 "picture%p, ", fPictureRefs[index]); |
1594 if (fPictureCount > 0) | 1593 if (fPictureCount > 0) |
1595 SkDebugf("%s0};\n", pBuffer); | 1594 SkDebugf("%s0};\n", pBuffer); |
1596 | 1595 |
1597 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1596 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
1598 } | 1597 } |
1599 | 1598 |
1600 #endif | 1599 #endif |
OLD | NEW |