| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 SkScalarToFloat(dest.width()), SkScalarToFloat(dest.height()), | 822 SkScalarToFloat(dest.width()), SkScalarToFloat(dest.height()), |
| 823 image->currentFrameIsComplete()); | 823 image->currentFrameIsComplete()); |
| 824 | 824 |
| 825 if (resampling == InterpolationNone) { | 825 if (resampling == InterpolationNone) { |
| 826 // FIXME: This is to not break tests (it results in the filter bitma
p flag | 826 // FIXME: This is to not break tests (it results in the filter bitma
p flag |
| 827 // being set to true). We need to decide if we respect Interpolation
None | 827 // being set to true). We need to decide if we respect Interpolation
None |
| 828 // being returned from computeInterpolationQuality. | 828 // being returned from computeInterpolationQuality. |
| 829 resampling = InterpolationLow; | 829 resampling = InterpolationLow; |
| 830 } | 830 } |
| 831 } | 831 } |
| 832 return static_cast<SkFilterQuality>(limitInterpolationQuality(this, resampli
ng)); | 832 return static_cast<SkFilterQuality>(limitInterpolationQuality(*this, resampl
ing)); |
| 833 } | 833 } |
| 834 | 834 |
| 835 void GraphicsContext::drawTiledImage(Image* image, const FloatRect& destRect, co
nst FloatPoint& srcPoint, const FloatSize& tileSize, SkXfermode::Mode op, const
FloatSize& repeatSpacing) | 835 void GraphicsContext::drawTiledImage(Image* image, const FloatRect& destRect, co
nst FloatPoint& srcPoint, const FloatSize& tileSize, SkXfermode::Mode op, const
FloatSize& repeatSpacing) |
| 836 { | 836 { |
| 837 if (contextDisabled() || !image) | 837 if (contextDisabled() || !image) |
| 838 return; | 838 return; |
| 839 image->drawTiled(this, destRect, srcPoint, tileSize, op, repeatSpacing); | 839 image->drawTiled(*this, destRect, srcPoint, tileSize, op, repeatSpacing); |
| 840 } | 840 } |
| 841 | 841 |
| 842 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons
t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz
e& repeatSpacing) | 842 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons
t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz
e& repeatSpacing) |
| 843 { | 843 { |
| 844 if (contextDisabled() || !image) | 844 if (contextDisabled() || !image) |
| 845 return; | 845 return; |
| 846 image->drawTiled(this, destRect, srcPoint, FloatSize(tileSize), op, FloatSiz
e(repeatSpacing)); | 846 image->drawTiled(*this, destRect, srcPoint, FloatSize(tileSize), op, FloatSi
ze(repeatSpacing)); |
| 847 } | 847 } |
| 848 | 848 |
| 849 void GraphicsContext::drawTiledImage(Image* image, const FloatRect& dest, const
FloatRect& srcRect, | 849 void GraphicsContext::drawTiledImage(Image* image, const FloatRect& dest, const
FloatRect& srcRect, |
| 850 const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRu
le, SkXfermode::Mode op) | 850 const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRu
le, SkXfermode::Mode op) |
| 851 { | 851 { |
| 852 if (contextDisabled() || !image) | 852 if (contextDisabled() || !image) |
| 853 return; | 853 return; |
| 854 | 854 |
| 855 if (hRule == Image::StretchTile && vRule == Image::StretchTile) { | 855 if (hRule == Image::StretchTile && vRule == Image::StretchTile) { |
| 856 // Just do a scale. | 856 // Just do a scale. |
| 857 drawImage(image, dest, srcRect, op); | 857 drawImage(image, dest, srcRect, op); |
| 858 return; | 858 return; |
| 859 } | 859 } |
| 860 | 860 |
| 861 image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op); | 861 image->drawTiled(*this, dest, srcRect, tileScaleFactor, hRule, vRule, op); |
| 862 } | 862 } |
| 863 | 863 |
| 864 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) | 864 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) |
| 865 { | 865 { |
| 866 if (contextDisabled()) | 866 if (contextDisabled()) |
| 867 return; | 867 return; |
| 868 ASSERT(m_canvas); | 868 ASSERT(m_canvas); |
| 869 | 869 |
| 870 m_canvas->drawOval(oval, paint); | 870 m_canvas->drawOval(oval, paint); |
| 871 } | 871 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 static const SkPMColor colors[] = { | 1361 static const SkPMColor colors[] = { |
| 1362 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1362 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
| 1363 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1363 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
| 1364 }; | 1364 }; |
| 1365 | 1365 |
| 1366 return colors[index]; | 1366 return colors[index]; |
| 1367 } | 1367 } |
| 1368 #endif | 1368 #endif |
| 1369 | 1369 |
| 1370 } // namespace blink | 1370 } // namespace blink |
| OLD | NEW |