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

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

Issue 910283002: Switch font embedding to a compile-time flag, with a todo for runtime. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | 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 * 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698