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

Side by Side Diff: src/pdf/SkPDFTypes.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | 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 /* 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 8
9 9
10 #include "SkPDFCatalog.h" 10 #include "SkPDFCatalog.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // static 136 // static
137 void SkPDFScalar::Append(SkScalar value, SkWStream* stream) { 137 void SkPDFScalar::Append(SkScalar value, SkWStream* stream) {
138 // The range of reals in PDF/A is the same as SkFixed: +/- 32,767 and 138 // The range of reals in PDF/A is the same as SkFixed: +/- 32,767 and
139 // +/- 1/65,536 (though integers can range from 2^31 - 1 to -2^31). 139 // +/- 1/65,536 (though integers can range from 2^31 - 1 to -2^31).
140 // When using floats that are outside the whole value range, we can use 140 // When using floats that are outside the whole value range, we can use
141 // integers instead. 141 // integers instead.
142 142
143 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS) 143 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS)
144 if (value > 32767 || value < -32767) { 144 if (value > 32767 || value < -32767) {
145 stream->writeDecAsText(SkScalarRound(value)); 145 stream->writeDecAsText(SkScalarRoundToInt(value));
146 return; 146 return;
147 } 147 }
148 148
149 char buffer[SkStrAppendScalar_MaxSize]; 149 char buffer[SkStrAppendScalar_MaxSize];
150 char* end = SkStrAppendFixed(buffer, SkScalarToFixed(value)); 150 char* end = SkStrAppendFixed(buffer, SkScalarToFixed(value));
151 stream->write(buffer, end - buffer); 151 stream->write(buffer, end - buffer);
152 return; 152 return;
153 #endif // !SK_ALLOW_LARGE_PDF_SCALARS 153 #endif // !SK_ALLOW_LARGE_PDF_SCALARS
154 154
155 #if defined(SK_ALLOW_LARGE_PDF_SCALARS) 155 #if defined(SK_ALLOW_LARGE_PDF_SCALARS)
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 SkPDFName* SkPDFDict::Iter::next(SkPDFObject** value) { 476 SkPDFName* SkPDFDict::Iter::next(SkPDFObject** value) {
477 if (fIter != fStop) { 477 if (fIter != fStop) {
478 const Rec* cur = fIter; 478 const Rec* cur = fIter;
479 fIter++; 479 fIter++;
480 *value = cur->value; 480 *value = cur->value;
481 return cur->key; 481 return cur->key;
482 } 482 }
483 *value = NULL; 483 *value = NULL;
484 return NULL; 484 return NULL;
485 } 485 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698