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

Side by Side Diff: Source/platform/graphics/skia/SkiaUtils.h

Issue 1093673002: Removing the dependency on GraphicsContext for drawing images in 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. 2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 // All of the functions in this file should move to new homes and this file shou ld be deleted. 31 // All of the functions in this file should move to new homes and this file shou ld be deleted.
32 32
33 #ifndef SkiaUtils_h 33 #ifndef SkiaUtils_h
34 #define SkiaUtils_h 34 #define SkiaUtils_h
35 35
36 #include "SkMatrix.h"
37 #include "SkPaint.h"
38 #include "SkPath.h"
39 #include "SkXfermode.h"
40 #include "platform/PlatformExport.h" 36 #include "platform/PlatformExport.h"
41 #include "platform/geometry/FloatRect.h" 37 #include "platform/geometry/FloatRect.h"
42 #include "platform/graphics/Color.h" 38 #include "platform/graphics/Color.h"
43 #include "platform/graphics/GraphicsTypes.h" 39 #include "platform/graphics/GraphicsTypes.h"
44 #include "platform/transforms/AffineTransform.h" 40 #include "platform/transforms/AffineTransform.h"
41 #include "third_party/skia/include/core/SkCanvas.h"
42 #include "third_party/skia/include/effects/SkCornerPathEffect.h"
45 #include "wtf/MathExtras.h" 43 #include "wtf/MathExtras.h"
46 44
47 namespace blink { 45 namespace blink {
48 46
49 class GraphicsContext; 47 class GraphicsContext;
50 48
51 SkXfermode::Mode PLATFORM_EXPORT WebCoreCompositeToSkiaComposite(CompositeOperat or, WebBlendMode = WebBlendModeNormal); 49 SkXfermode::Mode PLATFORM_EXPORT WebCoreCompositeToSkiaComposite(CompositeOperat or, WebBlendMode = WebBlendModeNormal);
52 CompositeOperator PLATFORM_EXPORT compositeOperatorFromSkia(SkXfermode::Mode); 50 CompositeOperator PLATFORM_EXPORT compositeOperatorFromSkia(SkXfermode::Mode);
53 WebBlendMode PLATFORM_EXPORT blendModeFromSkia(SkXfermode::Mode); 51 WebBlendMode PLATFORM_EXPORT blendModeFromSkia(SkXfermode::Mode);
54 52
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 InterpolationQuality limitInterpolationQuality(const GraphicsContext*, Interpola tionQuality resampling); 118 InterpolationQuality limitInterpolationQuality(const GraphicsContext*, Interpola tionQuality resampling);
121 119
122 InterpolationQuality computeInterpolationQuality( 120 InterpolationQuality computeInterpolationQuality(
123 const SkMatrix&, 121 const SkMatrix&,
124 float srcWidth, 122 float srcWidth,
125 float srcHeight, 123 float srcHeight,
126 float destWidth, 124 float destWidth,
127 float destHeight, 125 float destHeight,
128 bool isDataComplete = true); 126 bool isDataComplete = true);
129 127
130 bool shouldDrawAntiAliased(const GraphicsContext*, const SkRect& destRect);
131
132 // This replicates the old skia behavior when it used to take radius for blur. N ow it takes sigma. 128 // This replicates the old skia behavior when it used to take radius for blur. N ow it takes sigma.
133 inline SkScalar skBlurRadiusToSigma(SkScalar radius) 129 inline SkScalar skBlurRadiusToSigma(SkScalar radius)
134 { 130 {
135 SkASSERT(radius >= 0); 131 SkASSERT(radius >= 0);
136 return 0.288675f * radius + 0.5f; 132 return 0.288675f * radius + 0.5f;
137 } 133 }
138 134
135 template<typename PrimitiveType>
136 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width);
137
139 } // namespace blink 138 } // namespace blink
140 139
141 #endif // SkiaUtils_h 140 #endif // SkiaUtils_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698