| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include <new> | 7 #include <new> |
| 8 #include "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
| 9 #include "SkDrawPictureCallback.h" | 9 #include "SkDrawPictureCallback.h" |
| 10 #include "SkPictureData.h" | 10 #include "SkPictureData.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { | 173 void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { |
| 174 int count = rec.count(); | 174 int count = rec.count(); |
| 175 | 175 |
| 176 write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); | 176 write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); |
| 177 | 177 |
| 178 SkAutoSTMalloc<16, SkTypeface*> storage(count); | 178 SkAutoSTMalloc<16, SkTypeface*> storage(count); |
| 179 SkTypeface** array = (SkTypeface**)storage.get(); | 179 SkTypeface** array = (SkTypeface**)storage.get(); |
| 180 rec.copyToArray((SkRefCnt**)array); | 180 rec.copyToArray((SkRefCnt**)array); |
| 181 | 181 |
| 182 for (int i = 0; i < count; i++) { | 182 for (int i = 0; i < count; i++) { |
| 183 #ifdef SK_BUILD_FOR_UNIX |
| 184 array[i]->serializeForcingEmbedding(stream); |
| 185 #else |
| 186 // FIXME: Macs and Windows don't draw pixel-perfect if we embed fonts in
the SKP. |
| 183 array[i]->serialize(stream); | 187 array[i]->serialize(stream); |
| 188 #endif |
| 184 } | 189 } |
| 185 } | 190 } |
| 186 | 191 |
| 187 void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer) const { | 192 void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer) const { |
| 188 int i, n; | 193 int i, n; |
| 189 | 194 |
| 190 if ((n = fBitmaps.count()) > 0) { | 195 if ((n = fBitmaps.count()) > 0) { |
| 191 write_tag_size(buffer, SK_PICT_BITMAP_BUFFER_TAG, n); | 196 write_tag_size(buffer, SK_PICT_BITMAP_BUFFER_TAG, n); |
| 192 for (i = 0; i < n; i++) { | 197 for (i = 0; i < n; i++) { |
| 193 buffer.writeBitmap(fBitmaps[i]); | 198 buffer.writeBitmap(fBitmaps[i]); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } | 578 } |
| 574 } | 579 } |
| 575 | 580 |
| 576 bool SkPictureData::suitableForLayerOptimization() const { | 581 bool SkPictureData::suitableForLayerOptimization() const { |
| 577 return fContentInfo.numLayers() > 0; | 582 return fContentInfo.numLayers() > 0; |
| 578 } | 583 } |
| 579 #endif | 584 #endif |
| 580 /////////////////////////////////////////////////////////////////////////////// | 585 /////////////////////////////////////////////////////////////////////////////// |
| 581 | 586 |
| 582 | 587 |
| OLD | NEW |