OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 if (printing()) { | 902 if (printing()) { |
903 resampling = InterpolationNone; | 903 resampling = InterpolationNone; |
904 } else if (image->isLazyDecodedBitmap()) { | 904 } else if (image->isLazyDecodedBitmap()) { |
905 resampling = InterpolationHigh; | 905 resampling = InterpolationHigh; |
906 } else { | 906 } else { |
907 SkRect destRectTarget = dest; | 907 SkRect destRectTarget = dest; |
908 resampling = computeInterpolationQuality( | 908 resampling = computeInterpolationQuality( |
909 SkScalarToFloat(src.width()), SkScalarToFloat(src.height()), | 909 SkScalarToFloat(src.width()), SkScalarToFloat(src.height()), |
910 SkScalarToFloat(destRectTarget.width()), SkScalarToFloat(destRectTar
get.height()), | 910 SkScalarToFloat(destRectTarget.width()), SkScalarToFloat(destRectTar
get.height()), |
911 image->isImmutableBitmap()); | 911 image->isImmutableBitmap()); |
912 } | |
913 | 912 |
914 if (resampling == InterpolationNone) { | 913 if (resampling == InterpolationNone) { |
915 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 914 // FIXME: This is to not break tests (it results in the filter bitma
p flag |
916 // being set to true). We need to decide if we respect InterpolationNone | 915 // being set to true). We need to decide if we respect Interpolation
None |
917 // being returned from computeInterpolationQuality. | 916 // being returned from computeInterpolationQuality. |
918 resampling = InterpolationLow; | 917 resampling = InterpolationLow; |
| 918 } |
919 } | 919 } |
920 return static_cast<SkFilterQuality>(limitInterpolationQuality(this, resampli
ng)); | 920 return static_cast<SkFilterQuality>(limitInterpolationQuality(this, resampli
ng)); |
921 } | 921 } |
922 | 922 |
923 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons
t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz
e& repeatSpacing) | 923 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons
t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz
e& repeatSpacing) |
924 { | 924 { |
925 if (contextDisabled() || !image) | 925 if (contextDisabled() || !image) |
926 return; | 926 return; |
927 image->drawTiled(this, destRect, srcPoint, tileSize, op, repeatSpacing); | 927 image->drawTiled(this, destRect, srcPoint, tileSize, op, repeatSpacing); |
928 } | 928 } |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 static const SkPMColor colors[] = { | 1479 static const SkPMColor colors[] = { |
1480 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1480 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
1481 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1481 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
1482 }; | 1482 }; |
1483 | 1483 |
1484 return colors[index]; | 1484 return colors[index]; |
1485 } | 1485 } |
1486 #endif | 1486 #endif |
1487 | 1487 |
1488 } // namespace blink | 1488 } // namespace blink |
OLD | NEW |