GraphicsContext.h revision e52b702893ce72ec42d7bf62c4975b4ef61067d2
18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/* 2643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 30bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch * Copyright (C) 2008-2009 Torch Mobile, Inc. 48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without 68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions 78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met: 88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1. Redistributions of source code must retain the above copyright 98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * notice, this list of conditions and the following disclaimer. 108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright 118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * notice, this list of conditions and the following disclaimer in the 128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * documentation and/or other materials provided with the distribution. 138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 245abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306Iain Merrick * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */ 268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef GraphicsContext_h 288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define GraphicsContext_h 298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 30643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#include "ColorSpace.h" 318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "DashArray.h" 328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "FloatRect.h" 33f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#include "Gradient.h" 348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "Image.h" 358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "Path.h" 36f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#include "Pattern.h" 378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <wtf/Noncopyable.h> 38dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block#include <wtf/PassOwnPtr.h> 398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 402daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CG) 418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef struct CGContext PlatformGraphicsContext; 422daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#elif USE(CAIRO) 43a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochnamespace WebCore { 44a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochclass ContextShadow; 452bde8e466a4451c7319e3a072d118917957d6554Steve Blockclass PlatformContextCairo; 46a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch} 472bde8e466a4451c7319e3a072d118917957d6554Steve Blocktypedef WebCore::PlatformContextCairo PlatformGraphicsContext; 48d0825bca7fe65beaee391d30da42e937db621564Steve Block#elif PLATFORM(OPENVG) 49d0825bca7fe65beaee391d30da42e937db621564Steve Blocknamespace WebCore { 50d0825bca7fe65beaee391d30da42e937db621564Steve Blockclass SurfaceOpenVG; 51d0825bca7fe65beaee391d30da42e937db621564Steve Block} 52d0825bca7fe65beaee391d30da42e937db621564Steve Blocktypedef class WebCore::SurfaceOpenVG PlatformGraphicsContext; 538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#elif PLATFORM(QT) 5406ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen#include <QPainter> 55e8b154fd68f9b33be40a3590e58347f353835f5cSteve Blocknamespace WebCore { 56e8b154fd68f9b33be40a3590e58347f353835f5cSteve Blockclass ContextShadow; 57e8b154fd68f9b33be40a3590e58347f353835f5cSteve Block} 588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef QPainter PlatformGraphicsContext; 598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#elif PLATFORM(WX) 608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectclass wxGCDC; 618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectclass wxWindowDC; 628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 63231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block// wxGraphicsContext allows us to support Path, etc. 64231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block// but on some platforms, e.g. Linux, it requires fairly 658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project// new software. 668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if USE(WXGC) 678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project// On OS X, wxGCDC is just a typedef for wxDC, so use wxDC explicitly to make 688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project// the linker happy. 698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifdef __APPLE__ 708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class wxDC; 718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project typedef wxDC PlatformGraphicsContext; 728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#else 738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project typedef wxGCDC PlatformGraphicsContext; 748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#else 768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project typedef wxWindowDC PlatformGraphicsContext; 778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 787fb1198349cf58688611c0b98189560871faa49fBen Murdoch#elif USE(SKIA) 79f912b6f62505f60109e7300787c93111dbd70560Steve Block#if PLATFORM(ANDROID) 80f912b6f62505f60109e7300787c93111dbd70560Steve Blocknamespace WebCore { 81f912b6f62505f60109e7300787c93111dbd70560Steve Blockclass PlatformGraphicsContext; 82f912b6f62505f60109e7300787c93111dbd70560Steve Block} 83f912b6f62505f60109e7300787c93111dbd70560Steve Blockclass SkPaint; 84f912b6f62505f60109e7300787c93111dbd70560Steve Blockstruct SkPoint; 85f912b6f62505f60109e7300787c93111dbd70560Steve Block#else 86dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdochnamespace WebCore { 87dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdochclass PlatformContextSkia; 88dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch} 89dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdochtypedef WebCore::PlatformContextSkia PlatformGraphicsContext; 9082eeb7b660065e6e990280e6563ca7eafe4be1cdBen Murdoch#endif 91231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#elif PLATFORM(HAIKU) 92231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockclass BView; 93231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blocktypedef BView PlatformGraphicsContext; 94231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockstruct pattern; 95d0825bca7fe65beaee391d30da42e937db621564Steve Block#elif OS(WINCE) 960bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochtypedef struct HDC__ PlatformGraphicsContext; 978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#else 988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef void PlatformGraphicsContext; 998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 1008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 1018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if PLATFORM(WIN) 1022daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#include "DIBPixelData.h" 1038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef struct HDC__* HDC; 1042daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if !USE(CG) 1058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project// UInt8 is defined in CoreFoundation/CFBase.h 1068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef unsigned char UInt8; 1078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 1088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 1098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 1108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if PLATFORM(QT) && defined(Q_WS_WIN) 1118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <windows.h> 1128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 1138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 1148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace WebCore { 1158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 116d0825bca7fe65beaee391d30da42e937db621564Steve Block#if OS(WINCE) && !PLATFORM(QT) 1170bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch class SharedBitmap; 1180bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch class SimpleFontData; 1190bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch class GlyphBuffer; 1200bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch#endif 1210bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 1228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project const int cMisspellingLineThickness = 3; 1238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project const int cMisspellingLinePatternWidth = 4; 1248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project const int cMisspellingLinePatternGapWidth = 1; 1258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 1265e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block class AffineTransform; 1275abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306Iain Merrick class DrawingBuffer; 1288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class Font; 1298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class Generator; 1308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class GraphicsContextPlatformPrivate; 1318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class ImageBuffer; 13265f03d4f644ce73618e5f4f50dd694b26f55ae12Ben Murdoch class IntRect; 133ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch class RoundedIntRect; 1348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class KURL; 1355abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306Iain Merrick class SharedGraphicsContext3D; 1368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project class TextRun; 1378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 138f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch enum TextDrawingMode { 139f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextModeInvisible = 0, 140f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextModeFill = 1 << 0, 141f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextModeStroke = 1 << 1, 142f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextModeClip = 1 << 2 143f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch }; 144f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch typedef unsigned TextDrawingModeFlags; 145231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 1468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project enum StrokeStyle { 1478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project NoStroke, 1488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project SolidStroke, 1498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project DottedStroke, 1508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project DashedStroke 1518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project }; 1528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 1538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project enum InterpolationQuality { 1548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationDefault, 1558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationNone, 1568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationLow, 1578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationMedium, 1588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationHigh 1598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project }; 1608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 161f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch struct GraphicsContextState { 162f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch GraphicsContextState() 163f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch : strokeThickness(0) 164f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , shadowBlur(0) 1652daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CAIRO) 166f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , globalAlpha(1) 167f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#endif 168f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , textDrawingMode(TextModeFill) 169f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , strokeColor(Color::black) 170f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , fillColor(Color::black) 171f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , strokeStyle(SolidStroke) 172f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , fillRule(RULE_NONZERO) 173f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , strokeColorSpace(ColorSpaceDeviceRGB) 174f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , fillColorSpace(ColorSpaceDeviceRGB) 175f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , shadowColorSpace(ColorSpaceDeviceRGB) 176f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , compositeOperator(CompositeSourceOver) 177f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , shouldAntialias(true) 178f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , shouldSmoothFonts(true) 179f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , paintingDisabled(false) 180f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch , shadowsIgnoreTransforms(false) 1812daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CG) 1822fc2651226baac27029e38c9d6ef883fa32084dbSteve Block // Core Graphics incorrectly renders shadows with radius > 8px (<rdar://problem/8103442>), 1832fc2651226baac27029e38c9d6ef883fa32084dbSteve Block // but we need to preserve this buggy behavior for canvas and -webkit-box-shadow. 1842fc2651226baac27029e38c9d6ef883fa32084dbSteve Block , shadowsUseLegacyRadius(false) 1852fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#endif 186f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch { 187f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch } 188f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 189f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch RefPtr<Gradient> strokeGradient; 190f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch RefPtr<Pattern> strokePattern; 191f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 192f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch RefPtr<Gradient> fillGradient; 193f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch RefPtr<Pattern> fillPattern; 194f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 195f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch FloatSize shadowOffset; 196f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 197f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch float strokeThickness; 198f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch float shadowBlur; 199f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 2002daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CAIRO) 201f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch float globalAlpha; 202f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#endif 203f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextDrawingModeFlags textDrawingMode; 204f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 205f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch Color strokeColor; 206f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch Color fillColor; 207f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch Color shadowColor; 208f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 209f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch StrokeStyle strokeStyle; 210f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch WindRule fillRule; 211f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 212f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch ColorSpace strokeColorSpace; 213f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch ColorSpace fillColorSpace; 214f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch ColorSpace shadowColorSpace; 215f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 216f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch CompositeOperator compositeOperator; 217f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 218f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool shouldAntialias : 1; 219f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool shouldSmoothFonts : 1; 220f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool paintingDisabled : 1; 221f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool shadowsIgnoreTransforms : 1; 2222daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CG) 2232fc2651226baac27029e38c9d6ef883fa32084dbSteve Block bool shadowsUseLegacyRadius : 1; 2242fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#endif 225f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch }; 226f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 227ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch class GraphicsContext { 228ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED; 2298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project public: 2308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project GraphicsContext(PlatformGraphicsContext*); 2318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project ~GraphicsContext(); 232231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 233d0825bca7fe65beaee391d30da42e937db621564Steve Block#if !OS(WINCE) || PLATFORM(QT) 2348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project PlatformGraphicsContext* platformContext() const; 2350bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch#endif 236231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 2378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project float strokeThickness() const; 2388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setStrokeThickness(float); 2398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project StrokeStyle strokeStyle() const; 240cad810f21b803229eb11403f9209855525a25d57Steve Block void setStrokeStyle(StrokeStyle); 2418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project Color strokeColor() const; 2428f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian ColorSpace strokeColorSpace() const; 243643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void setStrokeColor(const Color&, ColorSpace); 2448f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 2458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setStrokePattern(PassRefPtr<Pattern>); 2468f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian Pattern* strokePattern() const; 2478f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 2488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setStrokeGradient(PassRefPtr<Gradient>); 2498f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian Gradient* strokeGradient() const; 2508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 2518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project WindRule fillRule() const; 2528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setFillRule(WindRule); 2538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project Color fillColor() const; 254643ca7872b450ea4efacab6188849e5aac2ba161Steve Block ColorSpace fillColorSpace() const; 255643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void setFillColor(const Color&, ColorSpace); 2568f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 2578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setFillPattern(PassRefPtr<Pattern>); 2588f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian Pattern* fillPattern() const; 2598f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 2608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setFillGradient(PassRefPtr<Gradient>); 2618f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian Gradient* fillGradient() const; 2628f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 263635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void setShadowsIgnoreTransforms(bool); 264909b5bb7002f48ae08c3c0157f5df3ee828e5d18Derek Sollenberger bool shadowsIgnoreTransforms() const; 265635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project 266635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void setShouldAntialias(bool); 267635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project bool shouldAntialias() const; 268635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project 269f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setShouldSmoothFonts(bool); 270f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool shouldSmoothFonts() const; 271f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 272f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch const GraphicsContextState& state() const; 273f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 2742daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CG) 275635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void applyStrokePattern(); 276635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void applyFillPattern(); 277f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void drawPath(const Path&); 278f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 279f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch // Allow font smoothing (LCD antialiasing). Not part of the graphics state. 280f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setAllowsFontSmoothing(bool); 28181bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch 28281bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void setIsCALayerContext(bool); 28381bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch bool isCALayerContext() const; 2842bde8e466a4451c7319e3a072d118917957d6554Steve Block 2852bde8e466a4451c7319e3a072d118917957d6554Steve Block void setIsAcceleratedContext(bool); 2862bde8e466a4451c7319e3a072d118917957d6554Steve Block bool isAcceleratedContext() const; 287635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project#endif 2888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 289f912b6f62505f60109e7300787c93111dbd70560Steve Block#if PLATFORM(ANDROID) 29069b9ab686ccfadd429ac9d67474ae44da9df1113Mike Reed // initialize a paint for bitmaps 29169b9ab686ccfadd429ac9d67474ae44da9df1113Mike Reed void setupBitmapPaint(SkPaint*); 2928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // initialize a paint for filling 2938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setupFillPaint(SkPaint*); 2948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // initialize a paint for stroking 2958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setupStrokePaint(SkPaint*); 2968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // initialize a paint for a shadow, or if false is returned, the 2978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // parameters are left untouched 2988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool setupShadowPaint(SkPaint* paint, SkPoint* offset); 2998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // returns true if there is a valid (non-transparent) fill color 3008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool willFill() const; 3018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // returns true if there is a valid (non-transparent) stroke color 3028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool willStroke() const; 303f912b6f62505f60109e7300787c93111dbd70560Steve Block 304635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // may return NULL, since we lazily allocate the path. This is the path 305635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // that is drawn by drawPath() 306635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project const SkPath* getCurrPath() const; 3078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project /** platform-specific factory method to return a bitmap graphicscontext, 3098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project called by <canvas> when we need to draw offscreen. Caller is responsible for 3108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project deleting the context. Use drawOffscreenContext() to draw the context's image 3118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project onto another graphics context. 3128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */ 3138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project static GraphicsContext* createOffscreenContext(int width, int height); 3148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 3158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void save(); 3178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void restore(); 3188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // These draw methods will do both stroking and filling. 3208f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian // FIXME: ...except drawRect(), which fills properly but always strokes 3218f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian // using a 1-pixel stroke inset from the rect borders (of the correct 3228f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian // stroke color). 3238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void drawRect(const IntRect&); 3248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void drawLine(const IntPoint&, const IntPoint&); 3258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void drawEllipse(const IntRect&); 3268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false); 3278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 328f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void fillPath(const Path&); 329f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void strokePath(const Path&); 3308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // Arc drawing (used by border-radius in CSS) just supports stroking at the moment. 3328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void strokeArc(const IntRect&, int startAngle, int angleSpan); 3338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void fillRect(const FloatRect&); 335643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void fillRect(const FloatRect&, const Color&, ColorSpace); 3368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void fillRect(const FloatRect&, Generator&); 337643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&, ColorSpace); 338ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch void fillRoundedRect(const RoundedIntRect&, const Color&, ColorSpace); 3392fc2651226baac27029e38c9d6ef883fa32084dbSteve Block void fillRectWithRoundedHole(const IntRect&, const RoundedIntRect& roundedHoleRect, const Color&, ColorSpace); 3408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clearRect(const FloatRect&); 3428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void strokeRect(const FloatRect&, float lineWidth); 3448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 345643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver); 346643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 347643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver); 348643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 349643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), 3508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 351643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, 352d0825bca7fe65beaee391d30da42e937db621564Steve Block CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 353643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, 3548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile, 355d0825bca7fe65beaee391d30da42e937db621564Steve Block CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 3568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 357f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver); 358f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 359f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver); 360f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 361f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), 362f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 363f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick 3648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setImageInterpolationQuality(InterpolationQuality); 3658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project InterpolationQuality imageInterpolationQuality() const; 3668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 36781bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void clip(const IntRect&); 3688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clip(const FloatRect&); 369ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch void addRoundedRectClip(const RoundedIntRect&); 3708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void addInnerRoundedRectClip(const IntRect&, int thickness); 3718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clipOut(const IntRect&); 372ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch void clipOutRoundedRect(const RoundedIntRect&); 373f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void clipPath(const Path&, WindRule); 3740617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true); 375f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void clipToImageBuffer(ImageBuffer*, const FloatRect&); 3762fc2651226baac27029e38c9d6ef883fa32084dbSteve Block 3772fc2651226baac27029e38c9d6ef883fa32084dbSteve Block IntRect clipBounds() const; 3788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 379f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch TextDrawingModeFlags textDrawingMode() const; 380f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setTextDrawingMode(TextDrawingModeFlags); 3818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 38281bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void drawText(const Font&, const TextRun&, const FloatPoint&, int from = 0, int to = -1); 38381bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void drawEmphasisMarks(const Font&, const TextRun& , const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1); 384635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void drawBidiText(const Font&, const TextRun&, const FloatPoint&); 385e52b702893ce72ec42d7bf62c4975b4ef61067d2Victoria Lease#if PLATFORM(ANDROID) 386e52b702893ce72ec42d7bf62c4975b4ef61067d2Victoria Lease void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, int h, const Color& backgroundColor, ColorSpace, int from = 0, int to = -1, bool isActive = true); 387e52b702893ce72ec42d7bf62c4975b4ef61067d2Victoria Lease#else 38881bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, int h, const Color& backgroundColor, ColorSpace, int from = 0, int to = -1); 389e52b702893ce72ec42d7bf62c4975b4ef61067d2Victoria Lease#endif 3908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 3912daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch enum RoundingMode { 3922daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch RoundAllSides, 3932daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch RoundOriginAndDimensions 3942daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch }; 3952daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch FloatRect roundToDevicePixels(const FloatRect&, RoundingMode = RoundAllSides); 396231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 39781bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void drawLineForText(const FloatPoint&, float width, bool printing); 3985ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen enum TextCheckingLineStyle { 3995ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen TextCheckingSpellingLineStyle, 4005ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen TextCheckingGrammarLineStyle, 4015ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen TextCheckingReplacementLineStyle 4025ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen }; 40381bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void drawLineForTextChecking(const FloatPoint&, float width, TextCheckingLineStyle); 404231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 4058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool paintingDisabled() const; 4068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setPaintingDisabled(bool); 407231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 4088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool updatingControlTints() const; 4098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setUpdatingControlTints(bool); 4108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void beginTransparencyLayer(float opacity); 4128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void endTransparencyLayer(); 4138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 414cad810f21b803229eb11403f9209855525a25d57Steve Block bool hasShadow() const; 41506ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen void setShadow(const FloatSize&, float blur, const Color&, ColorSpace); 4162fc2651226baac27029e38c9d6ef883fa32084dbSteve Block // Legacy shadow blur radius is used for canvas, and -webkit-box-shadow. 4172fc2651226baac27029e38c9d6ef883fa32084dbSteve Block // It has different treatment of radii > 8px. 4182fc2651226baac27029e38c9d6ef883fa32084dbSteve Block void setLegacyShadow(const FloatSize&, float blur, const Color&, ColorSpace); 4192fc2651226baac27029e38c9d6ef883fa32084dbSteve Block 420f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool getShadow(FloatSize&, float&, Color&, ColorSpace&) const; 4218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clearShadow(); 4228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 423d0825bca7fe65beaee391d30da42e937db621564Steve Block void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&); 4244576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang void drawFocusRing(const Path&, int width, int offset, const Color&); 4258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setLineCap(LineCap); 4278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setLineDash(const DashArray&, float dashOffset); 4288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setLineJoin(LineJoin); 4298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setMiterLimit(float); 4308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setAlpha(float); 4322daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CAIRO) 4338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project float getAlpha(); 4348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 4358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setCompositeOperation(CompositeOperator); 437f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch CompositeOperator compositeOperation() const; 4388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clip(const Path&); 440cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 441cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block // This clip function is used only by <canvas> code. It allows 442cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block // implementations to handle clipping on the canvas differently since 4432fc2651226baac27029e38c9d6ef883fa32084dbSteve Block // the discipline is different. 444cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void canvasClip(const Path&); 4458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clipOut(const Path&); 4468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void scale(const FloatSize&); 4488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void rotate(float angleInRadians); 449d0825bca7fe65beaee391d30da42e937db621564Steve Block void translate(const FloatSize& size) { translate(size.width(), size.height()); } 4508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void translate(float x, float y); 451231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 4528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setURLForRect(const KURL&, const IntRect&); 4538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4545e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block void concatCTM(const AffineTransform&); 45581bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void setCTM(const AffineTransform&); 4568a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve Block AffineTransform getCTM() const; 4578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 458d0825bca7fe65beaee391d30da42e937db621564Steve Block#if OS(WINCE) && !PLATFORM(QT) 4590bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void setBitmap(PassRefPtr<SharedBitmap>); 4600617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen const AffineTransform& affineTransform() const; 4610617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen AffineTransform& affineTransform(); 4620bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void resetAffineTransform(); 4630bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void fillRect(const FloatRect&, const Gradient*); 4640bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point); 4650bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void drawFrameControl(const IntRect& rect, unsigned type, unsigned state); 4660bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void drawFocusRect(const IntRect& rect); 4670bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void paintTextField(const IntRect& rect, unsigned state); 4680617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp); 4690617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize); 4700bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void drawIcon(HICON icon, const IntRect& dstRect, UINT flags); 4710bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers. 4720bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in HDC should be the one handed back by getWindowsContext. 4730bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void drawRoundCorner(bool newClip, RECT clipRect, RECT rectWin, HDC dc, int width, int height); 4740bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch#elif PLATFORM(WIN) 4758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project GraphicsContext(HDC, bool hasAlpha = false); // FIXME: To be removed. 4768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool inTransparencyLayer() const; 4778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers. 4788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); // The passed in HDC should be the one handed back by getWindowsContext. 4798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 480635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // When set to true, child windows should be rendered into this context 481635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // rather than allowing them just to render to the screen. Defaults to 482635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // false. 483635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // FIXME: This is a layering violation. GraphicsContext shouldn't know 484635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // what a "window" is. It would be much more appropriate for this flag 485635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // to be passed as a parameter alongside the GraphicsContext, but doing 486635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // that would require lots of changes in cross-platform code that we 487635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project // aren't sure we want to make. 488635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project void setShouldIncludeChildWindows(bool); 489635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project bool shouldIncludeChildWindows() const; 490635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project 491ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch class WindowsBitmap { 492ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch WTF_MAKE_NONCOPYABLE(WindowsBitmap); 4938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project public: 4948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project WindowsBitmap(HDC, IntSize); 4958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project ~WindowsBitmap(); 4968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 4978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project HDC hdc() const { return m_hdc; } 4982daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch UInt8* buffer() const { return m_pixelData.buffer(); } 4992daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch unsigned bufferLength() const { return m_pixelData.bufferLength(); } 5002daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch const IntSize& size() const { return m_pixelData.size(); } 5012daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch unsigned bytesPerRow() const { return m_pixelData.bytesPerRow(); } 5022daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch unsigned short bitsPerPixel() const { return m_pixelData.bitsPerPixel(); } 5032daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch const DIBPixelData& windowsDIB() const { return m_pixelData; } 5048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 5058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project private: 5068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project HDC m_hdc; 5078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project HBITMAP m_bitmap; 5082daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch DIBPixelData m_pixelData; 5098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project }; 5108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 5118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project WindowsBitmap* createWindowsBitmap(IntSize); 5128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project // The bitmap should be non-premultiplied. 5138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void drawWindowsBitmap(WindowsBitmap*, const IntPoint&); 5148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 5158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 516d0825bca7fe65beaee391d30da42e937db621564Steve Block#if (PLATFORM(QT) && defined(Q_WS_WIN)) || (PLATFORM(WX) && OS(WINDOWS)) 5178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); 5188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); 5195f1ab04193ad0130ca8204aadaceae083aca9881Feng Qian bool shouldIncludeChildWindows() const { return false; } 5208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 5218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 522643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#if PLATFORM(WX) 523643ca7872b450ea4efacab6188849e5aac2ba161Steve Block bool inTransparencyLayer() const { return false; } 524643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#endif 525643ca7872b450ea4efacab6188849e5aac2ba161Steve Block 5268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if PLATFORM(QT) 5278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project bool inTransparencyLayer() const; 528f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void pushTransparencyLayerInternal(const QRect &rect, qreal opacity, QPixmap& alphaMask); 5296b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner void takeOwnershipOfPlatformContext(); 530a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch#endif 531a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch 5322daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if PLATFORM(QT) || USE(CAIRO) 533e8b154fd68f9b33be40a3590e58347f353835f5cSteve Block ContextShadow* contextShadow(); 5348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 5358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 5362daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#if USE(CAIRO) 5372bde8e466a4451c7319e3a072d118917957d6554Steve Block GraphicsContext(cairo_t*); 53881bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch#endif 53981bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch 5408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#if PLATFORM(GTK) 5418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setGdkExposeEvent(GdkEventExpose*); 542f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch GdkWindow* gdkWindow() const; 5438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project GdkEventExpose* gdkExposeEvent() const; 5448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif 5458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 546231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#if PLATFORM(HAIKU) 547231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block pattern getHaikuStrokeStyle(); 548231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#endif 549231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 5505abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306Iain Merrick void setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&); 551dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch void syncSoftwareCanvas(); 5525abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306Iain Merrick void markDirtyRect(const IntRect&); // Hints that a portion of the backing store is dirty. 553dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch 5548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project private: 555f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void platformInit(PlatformGraphicsContext*); 556f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void platformDestroy(); 557f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 558f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#if PLATFORM(WIN) && !OS(WINCE) 559f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void platformInit(HDC, bool hasAlpha = false); 560f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch#endif 561f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 5628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void savePlatformState(); 5638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void restorePlatformState(); 5648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 565f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setPlatformTextDrawingMode(TextDrawingModeFlags); 5668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setPlatformFont(const Font& font); 5678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 568643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void setPlatformStrokeColor(const Color&, ColorSpace); 569cad810f21b803229eb11403f9209855525a25d57Steve Block void setPlatformStrokeStyle(StrokeStyle); 5708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void setPlatformStrokeThickness(float); 5710bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void setPlatformStrokeGradient(Gradient*); 5720bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void setPlatformStrokePattern(Pattern*); 5738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 574643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void setPlatformFillColor(const Color&, ColorSpace); 5750bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void setPlatformFillGradient(Gradient*); 5760bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch void setPlatformFillPattern(Pattern*); 5778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 578f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setPlatformShouldAntialias(bool); 579f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setPlatformShouldSmoothFonts(bool); 580635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project 58106ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen void setPlatformShadow(const FloatSize&, float blur, const Color&, ColorSpace); 5828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project void clearPlatformShadow(); 5838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 584f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setPlatformCompositeOperation(CompositeOperator); 585f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch 586cad810f21b803229eb11403f9209855525a25d57Steve Block static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle); 587231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 588f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch GraphicsContextPlatformPrivate* m_data; 5898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 590f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch GraphicsContextState m_state; 591f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch Vector<GraphicsContextState> m_stack; 592f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool m_updatingControlTints; 5938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project }; 5948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 5958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} // namespace WebCore 5968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project 5978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif // GraphicsContext_h 598