| 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 "SkPictureData.h" | 8 #include "SkPictureData.h" |
| 9 #include "SkPictureRecord.h" | 9 #include "SkPictureRecord.h" |
| 10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { | 170 void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { |
| 171 int count = rec.count(); | 171 int count = rec.count(); |
| 172 | 172 |
| 173 write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); | 173 write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); |
| 174 | 174 |
| 175 SkAutoSTMalloc<16, SkTypeface*> storage(count); | 175 SkAutoSTMalloc<16, SkTypeface*> storage(count); |
| 176 SkTypeface** array = (SkTypeface**)storage.get(); | 176 SkTypeface** array = (SkTypeface**)storage.get(); |
| 177 rec.copyToArray((SkRefCnt**)array); | 177 rec.copyToArray((SkRefCnt**)array); |
| 178 | 178 |
| 179 for (int i = 0; i < count; i++) { | 179 for (int i = 0; i < count; i++) { |
| 180 #ifdef SK_BUILD_FOR_UNIX | 180 #ifdef SK_PICTURE_FORCE_FONT_EMBEDDING |
| 181 array[i]->serializeForcingEmbedding(stream); | 181 array[i]->serializeForcingEmbedding(stream); |
| 182 #else | 182 #else |
| 183 // FIXME: Macs and Windows don't draw pixel-perfect if we embed fonts in
the SKP. | 183 // TODO: if (embedFonts) { array[i]->serializeForcingEmbedding(stream) }
else |
| 184 array[i]->serialize(stream); | 184 array[i]->serialize(stream); |
| 185 #endif | 185 #endif |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer) const { | 189 void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer) const { |
| 190 int i, n; | 190 int i, n; |
| 191 | 191 |
| 192 if ((n = fBitmaps.count()) > 0) { | 192 if ((n = fBitmaps.count()) > 0) { |
| 193 write_tag_size(buffer, SK_PICT_BITMAP_BUFFER_TAG, n); | 193 write_tag_size(buffer, SK_PICT_BITMAP_BUFFER_TAG, n); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 575 } |
| 576 } | 576 } |
| 577 | 577 |
| 578 bool SkPictureData::suitableForLayerOptimization() const { | 578 bool SkPictureData::suitableForLayerOptimization() const { |
| 579 return fContentInfo.numLayers() > 0; | 579 return fContentInfo.numLayers() > 0; |
| 580 } | 580 } |
| 581 #endif | 581 #endif |
| 582 /////////////////////////////////////////////////////////////////////////////// | 582 /////////////////////////////////////////////////////////////////////////////// |
| 583 | 583 |
| 584 | 584 |
| OLD | NEW |