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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "third_party/skia/include/core/SkSurface.h" | 49 #include "third_party/skia/include/core/SkSurface.h" |
50 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | 50 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
51 #include "third_party/skia/include/effects/SkCornerPathEffect.h" | 51 #include "third_party/skia/include/effects/SkCornerPathEffect.h" |
52 #include "third_party/skia/include/effects/SkLumaColorFilter.h" | 52 #include "third_party/skia/include/effects/SkLumaColorFilter.h" |
53 #include "third_party/skia/include/gpu/GrRenderTarget.h" | 53 #include "third_party/skia/include/gpu/GrRenderTarget.h" |
54 #include "third_party/skia/include/gpu/GrTexture.h" | 54 #include "third_party/skia/include/gpu/GrTexture.h" |
55 #include "wtf/Assertions.h" | 55 #include "wtf/Assertions.h" |
56 #include "wtf/MathExtras.h" | 56 #include "wtf/MathExtras.h" |
57 | 57 |
58 using namespace std; | 58 using namespace std; |
59 using blink::WebBlendMode; | |
60 | 59 |
61 namespace blink { | 60 namespace blink { |
62 | 61 |
63 namespace { | 62 namespace { |
64 | 63 |
65 class CompatibleImageBufferSurface : public ImageBufferSurface { | 64 class CompatibleImageBufferSurface : public ImageBufferSurface { |
66 WTF_MAKE_NONCOPYABLE(CompatibleImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; | 65 WTF_MAKE_NONCOPYABLE(CompatibleImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
67 public: | 66 public: |
68 CompatibleImageBufferSurface(PassRefPtr<SkSurface> surface, const IntSize& s
ize, OpacityMode opacityMode) | 67 CompatibleImageBufferSurface(PassRefPtr<SkSurface> surface, const IntSize& s
ize, OpacityMode opacityMode) |
69 : ImageBufferSurface(size, opacityMode) | 68 : ImageBufferSurface(size, opacityMode) |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1048 |
1050 void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperato
r op, RespectImageOrientationEnum shouldRespectImageOrientation) | 1049 void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperato
r op, RespectImageOrientationEnum shouldRespectImageOrientation) |
1051 { | 1050 { |
1052 if (!image) | 1051 if (!image) |
1053 return; | 1052 return; |
1054 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size
())), op, shouldRespectImageOrientation); | 1053 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size
())), op, shouldRespectImageOrientation); |
1055 } | 1054 } |
1056 | 1055 |
1057 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float
Rect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageO
rientation) | 1056 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float
Rect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageO
rientation) |
1058 { | 1057 { |
1059 drawImage(image, dest, src, op, blink::WebBlendModeNormal, shouldRespectImag
eOrientation); | 1058 drawImage(image, dest, src, op, WebBlendModeNormal, shouldRespectImageOrient
ation); |
1060 } | 1059 } |
1061 | 1060 |
1062 void GraphicsContext::drawImage(Image* image, const FloatRect& dest) | 1061 void GraphicsContext::drawImage(Image* image, const FloatRect& dest) |
1063 { | 1062 { |
1064 if (!image) | 1063 if (!image) |
1065 return; | 1064 return; |
1066 drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size()))); | 1065 drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size()))); |
1067 } | 1066 } |
1068 | 1067 |
1069 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float
Rect& src, CompositeOperator op, WebBlendMode blendMode, RespectImageOrientation
Enum shouldRespectImageOrientation) | 1068 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float
Rect& src, CompositeOperator op, WebBlendMode blendMode, RespectImageOrientation
Enum shouldRespectImageOrientation) |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 TRACE_EVENT0("skia", "GraphicsContext::didDrawTextInRect"); | 1893 TRACE_EVENT0("skia", "GraphicsContext::didDrawTextInRect"); |
1895 m_textRegion.join(textRect); | 1894 m_textRegion.join(textRect); |
1896 } | 1895 } |
1897 } | 1896 } |
1898 | 1897 |
1899 void GraphicsContext::preparePaintForDrawRectToRect( | 1898 void GraphicsContext::preparePaintForDrawRectToRect( |
1900 SkPaint* paint, | 1899 SkPaint* paint, |
1901 const SkRect& srcRect, | 1900 const SkRect& srcRect, |
1902 const SkRect& destRect, | 1901 const SkRect& destRect, |
1903 CompositeOperator compositeOp, | 1902 CompositeOperator compositeOp, |
1904 blink::WebBlendMode blendMode, | 1903 WebBlendMode blendMode, |
1905 bool isLazyDecoded, | 1904 bool isLazyDecoded, |
1906 bool isDataComplete) const | 1905 bool isDataComplete) const |
1907 { | 1906 { |
1908 paint->setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).g
et()); | 1907 paint->setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).g
et()); |
1909 paint->setColorFilter(this->colorFilter()); | 1908 paint->setColorFilter(this->colorFilter()); |
1910 paint->setAlpha(this->getNormalizedAlpha()); | 1909 paint->setAlpha(this->getNormalizedAlpha()); |
1911 paint->setLooper(this->drawLooper()); | 1910 paint->setLooper(this->drawLooper()); |
1912 paint->setAntiAlias(shouldDrawAntiAliased(this, destRect)); | 1911 paint->setAntiAlias(shouldDrawAntiAliased(this, destRect)); |
1913 | 1912 |
1914 InterpolationQuality resampling; | 1913 InterpolationQuality resampling; |
(...skipping 19 matching lines...) Expand all Loading... |
1934 if (resampling == InterpolationNone) { | 1933 if (resampling == InterpolationNone) { |
1935 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 1934 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
1936 // being set to true). We need to decide if we respect InterpolationNone | 1935 // being set to true). We need to decide if we respect InterpolationNone |
1937 // being returned from computeInterpolationQuality. | 1936 // being returned from computeInterpolationQuality. |
1938 resampling = InterpolationLow; | 1937 resampling = InterpolationLow; |
1939 } | 1938 } |
1940 resampling = limitInterpolationQuality(this, resampling); | 1939 resampling = limitInterpolationQuality(this, resampling); |
1941 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 1940 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
1942 } | 1941 } |
1943 | 1942 |
1944 } | 1943 } // namespace blink |
OLD | NEW |