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

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

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium 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/SkPDFDevice.cpp ('k') | src/ports/SkFontHost_mac.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 * Copyright 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 7
8 #include "SkPDFImage.h" 8 #include "SkPDFImage.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 bitsPerComp = 4; 603 bitsPerComp = 4;
604 } else if (isAlpha && config == SkBitmap::kA1_Config) { 604 } else if (isAlpha && config == SkBitmap::kA1_Config) {
605 bitsPerComp = 1; 605 bitsPerComp = 1;
606 } 606 }
607 insertInt("BitsPerComponent", bitsPerComp); 607 insertInt("BitsPerComponent", bitsPerComp);
608 608
609 if (config == SkBitmap::kRGB_565_Config) { 609 if (config == SkBitmap::kRGB_565_Config) {
610 SkASSERT(!isAlpha); 610 SkASSERT(!isAlpha);
611 SkAutoTUnref<SkPDFInt> zeroVal(new SkPDFInt(0)); 611 SkAutoTUnref<SkPDFInt> zeroVal(new SkPDFInt(0));
612 SkAutoTUnref<SkPDFScalar> scale5Val( 612 SkAutoTUnref<SkPDFScalar> scale5Val(
613 new SkPDFScalar(SkFloatToScalar(8.2258f))); // 255/2^5-1 613 new SkPDFScalar(8.2258f)); // 255/2^5-1
614 SkAutoTUnref<SkPDFScalar> scale6Val( 614 SkAutoTUnref<SkPDFScalar> scale6Val(
615 new SkPDFScalar(SkFloatToScalar(4.0476f))); // 255/2^6-1 615 new SkPDFScalar(4.0476f)); // 255/2^6-1
616 SkAutoTUnref<SkPDFArray> decodeValue(new SkPDFArray()); 616 SkAutoTUnref<SkPDFArray> decodeValue(new SkPDFArray());
617 decodeValue->reserve(6); 617 decodeValue->reserve(6);
618 decodeValue->append(zeroVal.get()); 618 decodeValue->append(zeroVal.get());
619 decodeValue->append(scale5Val.get()); 619 decodeValue->append(scale5Val.get());
620 decodeValue->append(zeroVal.get()); 620 decodeValue->append(zeroVal.get());
621 decodeValue->append(scale6Val.get()); 621 decodeValue->append(scale6Val.get());
622 decodeValue->append(zeroVal.get()); 622 decodeValue->append(zeroVal.get());
623 decodeValue->append(scale5Val.get()); 623 decodeValue->append(scale5Val.get());
624 insert("Decode", decodeValue.get()); 624 insert("Decode", decodeValue.get());
625 } 625 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // but the new catalog wants it compressed. 680 // but the new catalog wants it compressed.
681 if (!getSubstitute()) { 681 if (!getSubstitute()) {
682 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this)); 682 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this));
683 setSubstitute(substitute); 683 setSubstitute(substitute);
684 catalog->setSubstitute(this, substitute); 684 catalog->setSubstitute(this, substitute);
685 } 685 }
686 return false; 686 return false;
687 } 687 }
688 return true; 688 return true;
689 } 689 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698