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 12 matching lines...) Expand all Loading... |
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
24 * THE POSSIBILITY OF SUCH DAMAGE. | 24 * THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "platform/graphics/GraphicsContext.h" | 28 #include "platform/graphics/GraphicsContext.h" |
29 | 29 |
30 #include "platform/RuntimeEnabledFeatures.h" | 30 #include "platform/RuntimeEnabledFeatures.h" |
31 #include "platform/TraceEvent.h" | 31 #include "platform/TraceEvent.h" |
32 #include "platform/geometry/IntRect.h" | 32 #include "platform/geometry/IntRect.h" |
| 33 #include "platform/graphics/ColorSpace.h" |
33 #include "platform/graphics/Gradient.h" | 34 #include "platform/graphics/Gradient.h" |
34 #include "platform/graphics/ImageBuffer.h" | 35 #include "platform/graphics/ImageBuffer.h" |
35 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
36 #include "third_party/skia/include/core/SkAnnotation.h" | 37 #include "third_party/skia/include/core/SkAnnotation.h" |
37 #include "third_party/skia/include/core/SkColorFilter.h" | 38 #include "third_party/skia/include/core/SkColorFilter.h" |
38 #include "third_party/skia/include/core/SkData.h" | 39 #include "third_party/skia/include/core/SkData.h" |
39 #include "third_party/skia/include/core/SkPicture.h" | 40 #include "third_party/skia/include/core/SkPicture.h" |
40 #include "third_party/skia/include/core/SkPictureRecorder.h" | 41 #include "third_party/skia/include/core/SkPictureRecorder.h" |
41 #include "third_party/skia/include/core/SkRRect.h" | 42 #include "third_party/skia/include/core/SkRRect.h" |
42 #include "third_party/skia/include/core/SkRefCnt.h" | 43 #include "third_party/skia/include/core/SkRefCnt.h" |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 WebCoreFloatToSkScalar(points[i].y())); | 1518 WebCoreFloatToSkScalar(points[i].y())); |
1518 } | 1519 } |
1519 } | 1520 } |
1520 | 1521 |
1521 PassRefPtr<SkColorFilter> GraphicsContext::WebCoreColorFilterToSkiaColorFilter(C
olorFilter colorFilter) | 1522 PassRefPtr<SkColorFilter> GraphicsContext::WebCoreColorFilterToSkiaColorFilter(C
olorFilter colorFilter) |
1522 { | 1523 { |
1523 switch (colorFilter) { | 1524 switch (colorFilter) { |
1524 case ColorFilterLuminanceToAlpha: | 1525 case ColorFilterLuminanceToAlpha: |
1525 return adoptRef(SkLumaColorFilter::Create()); | 1526 return adoptRef(SkLumaColorFilter::Create()); |
1526 case ColorFilterLinearRGBToSRGB: | 1527 case ColorFilterLinearRGBToSRGB: |
1527 return ImageBuffer::createColorSpaceFilter(ColorSpaceLinearRGB, ColorSpa
ceDeviceRGB); | 1528 return ColorSpaceUtilities::createColorSpaceFilter(ColorSpaceLinearRGB,
ColorSpaceDeviceRGB); |
1528 case ColorFilterSRGBToLinearRGB: | 1529 case ColorFilterSRGBToLinearRGB: |
1529 return ImageBuffer::createColorSpaceFilter(ColorSpaceDeviceRGB, ColorSpa
ceLinearRGB); | 1530 return ColorSpaceUtilities::createColorSpaceFilter(ColorSpaceDeviceRGB,
ColorSpaceLinearRGB); |
1530 case ColorFilterNone: | 1531 case ColorFilterNone: |
1531 break; | 1532 break; |
1532 default: | 1533 default: |
1533 ASSERT_NOT_REACHED(); | 1534 ASSERT_NOT_REACHED(); |
1534 break; | 1535 break; |
1535 } | 1536 } |
1536 | 1537 |
1537 return nullptr; | 1538 return nullptr; |
1538 } | 1539 } |
1539 | 1540 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 // being returned from computeInterpolationQuality. | 1701 // being returned from computeInterpolationQuality. |
1701 resampling = InterpolationLow; | 1702 resampling = InterpolationLow; |
1702 } | 1703 } |
1703 resampling = limitInterpolationQuality(this, resampling); | 1704 resampling = limitInterpolationQuality(this, resampling); |
1704 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); | 1705 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); |
1705 | 1706 |
1706 return initialSaveCount; | 1707 return initialSaveCount; |
1707 } | 1708 } |
1708 | 1709 |
1709 } // namespace blink | 1710 } // namespace blink |
OLD | NEW |