Changeset 73496 in webkit
- Timestamp:
- Dec 8, 2010 1:35:04 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73494 r73496 1 2010-12-08 Yuta Kitamura <yutak@chromium.org> 2 3 Unreviewed, rolling out r73492. 4 http://trac.webkit.org/changeset/73492 5 https://bugs.webkit.org/show_bug.cgi?id=49914 6 7 Caused a lot of pixel test failures and broke Windows build. 8 9 * WebCore.xcodeproj/project.pbxproj: 10 * platform/graphics/GraphicsContext.cpp: 11 (WebCore::GraphicsContext::createGraphicsContextPrivate): 12 (WebCore::GraphicsContext::destroyGraphicsContextPrivate): 13 (WebCore::GraphicsContext::save): 14 (WebCore::GraphicsContext::restore): 15 (WebCore::GraphicsContext::setStrokeThickness): 16 (WebCore::GraphicsContext::setStrokeStyle): 17 (WebCore::GraphicsContext::setStrokeColor): 18 (WebCore::GraphicsContext::setShadow): 19 (WebCore::GraphicsContext::clearShadow): 20 (WebCore::GraphicsContext::getShadow): 21 (WebCore::GraphicsContext::strokeThickness): 22 (WebCore::GraphicsContext::strokeStyle): 23 (WebCore::GraphicsContext::strokeColor): 24 (WebCore::GraphicsContext::strokeColorSpace): 25 (WebCore::GraphicsContext::fillRule): 26 (WebCore::GraphicsContext::setFillRule): 27 (WebCore::GraphicsContext::setFillColor): 28 (WebCore::GraphicsContext::fillColor): 29 (WebCore::GraphicsContext::fillColorSpace): 30 (WebCore::GraphicsContext::setShouldAntialias): 31 (WebCore::GraphicsContext::shouldAntialias): 32 (WebCore::GraphicsContext::setStrokePattern): 33 (WebCore::GraphicsContext::setFillPattern): 34 (WebCore::GraphicsContext::setStrokeGradient): 35 (WebCore::GraphicsContext::setFillGradient): 36 (WebCore::GraphicsContext::fillGradient): 37 (WebCore::GraphicsContext::strokeGradient): 38 (WebCore::GraphicsContext::fillPattern): 39 (WebCore::GraphicsContext::strokePattern): 40 (WebCore::GraphicsContext::setShadowsIgnoreTransforms): 41 (WebCore::GraphicsContext::updatingControlTints): 42 (WebCore::GraphicsContext::setUpdatingControlTints): 43 (WebCore::GraphicsContext::setPaintingDisabled): 44 (WebCore::GraphicsContext::paintingDisabled): 45 (WebCore::GraphicsContext::textDrawingMode): 46 (WebCore::GraphicsContext::setTextDrawingMode): 47 * platform/graphics/GraphicsContext.h: 48 * platform/graphics/GraphicsContextPrivate.h: Added. 49 (WebCore::GraphicsContextState::GraphicsContextState): 50 (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): 51 * platform/graphics/cairo/GraphicsContextCairo.cpp: 52 (WebCore::setPlatformFill): 53 (WebCore::setPlatformStroke): 54 (WebCore::drawPathShadow): 55 (WebCore::fillCurrentCairoPath): 56 (WebCore::strokeCurrentCairoPath): 57 (WebCore::GraphicsContext::GraphicsContext): 58 (WebCore::GraphicsContext::~GraphicsContext): 59 (WebCore::GraphicsContext::fillPath): 60 (WebCore::GraphicsContext::strokePath): 61 (WebCore::GraphicsContext::fillRect): 62 (WebCore::GraphicsContext::setPlatformShadow): 63 (WebCore::GraphicsContext::strokeRect): 64 (WebCore::GraphicsContext::setAlpha): 65 (WebCore::GraphicsContext::getAlpha): 66 * platform/graphics/cg/GraphicsContextCG.cpp: 67 (WebCore::GraphicsContext::GraphicsContext): 68 (WebCore::GraphicsContext::~GraphicsContext): 69 (WebCore::GraphicsContext::applyStrokePattern): 70 (WebCore::GraphicsContext::applyFillPattern): 71 (WebCore::GraphicsContext::drawPath): 72 (WebCore::GraphicsContext::fillPath): 73 (WebCore::GraphicsContext::strokePath): 74 (WebCore::GraphicsContext::fillRect): 75 (WebCore::GraphicsContext::setPlatformShadow): 76 (WebCore::GraphicsContext::strokeRect): 77 * platform/graphics/haiku/GraphicsContextHaiku.cpp: 78 (WebCore::GraphicsContext::GraphicsContext): 79 (WebCore::GraphicsContext::~GraphicsContext): 80 * platform/graphics/openvg/GraphicsContextOpenVG.cpp: 81 (WebCore::GraphicsContext::GraphicsContext): 82 (WebCore::GraphicsContext::~GraphicsContext): 83 (WebCore::GraphicsContext::fillPath): 84 (WebCore::GraphicsContext::strokePath): 85 (WebCore::GraphicsContext::clip): 86 (WebCore::GraphicsContext::clipOut): 87 (WebCore::GraphicsContext::addInnerRoundedRectClip): 88 * platform/graphics/qt/GraphicsContextQt.cpp: 89 (WebCore::GraphicsContext::GraphicsContext): 90 (WebCore::GraphicsContext::~GraphicsContext): 91 (WebCore::GraphicsContext::fillPath): 92 (WebCore::GraphicsContext::strokePath): 93 (WebCore::GraphicsContext::fillRect): 94 (WebCore::GraphicsContext::setPlatformShadow): 95 * platform/graphics/skia/GraphicsContextSkia.cpp: 96 (WebCore::GraphicsContext::GraphicsContext): 97 (WebCore::GraphicsContext::~GraphicsContext): 98 (WebCore::GraphicsContext::fillPath): 99 (WebCore::GraphicsContext::setPlatformShadow): 100 * platform/graphics/win/GraphicsContextCGWin.cpp: 101 (WebCore::GraphicsContext::GraphicsContext): 102 * platform/graphics/win/GraphicsContextCairoWin.cpp: 103 (WebCore::GraphicsContext::GraphicsContext): 104 * platform/graphics/wince/GraphicsContextWinCE.cpp: 105 (WebCore::GraphicsContext::GraphicsContext): 106 (WebCore::GraphicsContext::~GraphicsContext): 107 (WebCore::GraphicsContext::fillPath): 108 (WebCore::GraphicsContext::fillRect): 109 * platform/graphics/wx/GraphicsContextWx.cpp: 110 (WebCore::GraphicsContext::GraphicsContext): 111 (WebCore::GraphicsContext::~GraphicsContext): 112 1 113 2010-12-08 Dai Mikurube <dmikurube@google.com> 2 114 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r73492 r73496 3927 3927 A8F5C0B80F9285AC0098E06B /* RenderSVGModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8F5C0B60F9285AC0098E06B /* RenderSVGModelObject.h */; }; 3928 3928 A8F5C0B90F9285AC0098E06B /* RenderSVGModelObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8F5C0B70F9285AC0098E06B /* RenderSVGModelObject.cpp */; }; 3929 A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */; settings = {ATTRIBUTES = (Private, ); };};3929 A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */; }; 3930 3930 A8FA6E5E0E4CFDED00D5CF49 /* Pattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */; }; 3931 3931 A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */; }; -
trunk/WebCore/platform/graphics/GraphicsContext.cpp
r73492 r73496 30 30 #include "Font.h" 31 31 #include "Generator.h" 32 #include "GraphicsContextPrivate.h" 32 33 #include "ImageBuffer.h" 33 34 … … 74 75 }; 75 76 76 GraphicsContext ::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext)77 { 78 platformInit(platformGraphicsContext);79 } 80 81 GraphicsContext::~GraphicsContext()82 { 83 platformDestroy();77 GraphicsContextPrivate* GraphicsContext::createGraphicsContextPrivate() 78 { 79 return new GraphicsContextPrivate; 80 } 81 82 void GraphicsContext::destroyGraphicsContextPrivate(GraphicsContextPrivate* deleteMe) 83 { 84 delete deleteMe; 84 85 } 85 86 … … 89 90 return; 90 91 91 m_ stack.append(m_state);92 m_common->stack.append(m_common->state); 92 93 93 94 savePlatformState(); … … 99 100 return; 100 101 101 if (m_ stack.isEmpty()) {102 if (m_common->stack.isEmpty()) { 102 103 LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty"); 103 104 return; 104 105 } 105 m_ state = m_stack.last();106 m_ stack.removeLast();106 m_common->state = m_common->stack.last(); 107 m_common->stack.removeLast(); 107 108 108 109 restorePlatformState(); … … 111 112 void GraphicsContext::setStrokeThickness(float thickness) 112 113 { 113 m_ state.strokeThickness = thickness;114 m_common->state.strokeThickness = thickness; 114 115 setPlatformStrokeThickness(thickness); 115 116 } … … 117 118 void GraphicsContext::setStrokeStyle(const StrokeStyle& style) 118 119 { 119 m_ state.strokeStyle = style;120 m_common->state.strokeStyle = style; 120 121 setPlatformStrokeStyle(style); 121 122 } … … 123 124 void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace) 124 125 { 125 m_ state.strokeColor = color;126 m_ state.strokeColorSpace = colorSpace;127 m_ state.strokeGradient.clear();128 m_ state.strokePattern.clear();126 m_common->state.strokeColor = color; 127 m_common->state.strokeColorSpace = colorSpace; 128 m_common->state.strokeGradient.clear(); 129 m_common->state.strokePattern.clear(); 129 130 setPlatformStrokeColor(color, colorSpace); 130 131 } … … 132 133 void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace) 133 134 { 134 m_ state.shadowOffset = offset;135 m_ state.shadowBlur = blur;136 m_ state.shadowColor = color;135 m_common->state.shadowOffset = offset; 136 m_common->state.shadowBlur = blur; 137 m_common->state.shadowColor = color; 137 138 setPlatformShadow(offset, blur, color, colorSpace); 138 139 } … … 140 141 void GraphicsContext::clearShadow() 141 142 { 142 m_ state.shadowOffset = FloatSize();143 m_ state.shadowBlur = 0;144 m_ state.shadowColor = Color();143 m_common->state.shadowOffset = FloatSize(); 144 m_common->state.shadowBlur = 0; 145 m_common->state.shadowColor = Color(); 145 146 clearPlatformShadow(); 146 147 } … … 148 149 bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color) const 149 150 { 150 offset = m_ state.shadowOffset;151 blur = m_ state.shadowBlur;152 color = m_ state.shadowColor;151 offset = m_common->state.shadowOffset; 152 blur = m_common->state.shadowBlur; 153 color = m_common->state.shadowColor; 153 154 154 155 return color.isValid() && color.alpha() && (blur || offset.width() || offset.height()); … … 157 158 float GraphicsContext::strokeThickness() const 158 159 { 159 return m_ state.strokeThickness;160 return m_common->state.strokeThickness; 160 161 } 161 162 162 163 StrokeStyle GraphicsContext::strokeStyle() const 163 164 { 164 return m_ state.strokeStyle;165 return m_common->state.strokeStyle; 165 166 } 166 167 167 168 Color GraphicsContext::strokeColor() const 168 169 { 169 return m_ state.strokeColor;170 return m_common->state.strokeColor; 170 171 } 171 172 172 173 ColorSpace GraphicsContext::strokeColorSpace() const 173 174 { 174 return m_ state.strokeColorSpace;175 return m_common->state.strokeColorSpace; 175 176 } 176 177 177 178 WindRule GraphicsContext::fillRule() const 178 179 { 179 return m_ state.fillRule;180 return m_common->state.fillRule; 180 181 } 181 182 182 183 void GraphicsContext::setFillRule(WindRule fillRule) 183 184 { 184 m_ state.fillRule = fillRule;185 m_common->state.fillRule = fillRule; 185 186 } 186 187 187 188 void GraphicsContext::setFillColor(const Color& color, ColorSpace colorSpace) 188 189 { 189 m_ state.fillColor = color;190 m_ state.fillColorSpace = colorSpace;191 m_ state.fillGradient.clear();192 m_ state.fillPattern.clear();190 m_common->state.fillColor = color; 191 m_common->state.fillColorSpace = colorSpace; 192 m_common->state.fillGradient.clear(); 193 m_common->state.fillPattern.clear(); 193 194 setPlatformFillColor(color, colorSpace); 194 195 } … … 196 197 Color GraphicsContext::fillColor() const 197 198 { 198 return m_ state.fillColor;199 return m_common->state.fillColor; 199 200 } 200 201 201 202 ColorSpace GraphicsContext::fillColorSpace() const 202 203 { 203 return m_ state.fillColorSpace;204 return m_common->state.fillColorSpace; 204 205 } 205 206 206 207 void GraphicsContext::setShouldAntialias(bool b) 207 208 { 208 m_ state.shouldAntialias = b;209 m_common->state.shouldAntialias = b; 209 210 setPlatformShouldAntialias(b); 210 211 } … … 212 213 bool GraphicsContext::shouldAntialias() const 213 214 { 214 return m_state.shouldAntialias; 215 } 216 217 const GraphicsContextState& GraphicsContext::state() const 218 { 219 return m_state; 215 return m_common->state.shouldAntialias; 220 216 } 221 217 … … 227 223 return; 228 224 } 229 m_ state.strokeGradient.clear();230 m_ state.strokePattern = pattern;231 setPlatformStrokePattern(m_ state.strokePattern.get());225 m_common->state.strokeGradient.clear(); 226 m_common->state.strokePattern = pattern; 227 setPlatformStrokePattern(m_common->state.strokePattern.get()); 232 228 } 233 229 … … 239 235 return; 240 236 } 241 m_ state.fillGradient.clear();242 m_ state.fillPattern = pattern;243 setPlatformFillPattern(m_ state.fillPattern.get());237 m_common->state.fillGradient.clear(); 238 m_common->state.fillPattern = pattern; 239 setPlatformFillPattern(m_common->state.fillPattern.get()); 244 240 } 245 241 … … 251 247 return; 252 248 } 253 m_ state.strokeGradient = gradient;254 m_ state.strokePattern.clear();255 setPlatformStrokeGradient(m_ state.strokeGradient.get());249 m_common->state.strokeGradient = gradient; 250 m_common->state.strokePattern.clear(); 251 setPlatformStrokeGradient(m_common->state.strokeGradient.get()); 256 252 } 257 253 … … 263 259 return; 264 260 } 265 m_ state.fillGradient = gradient;266 m_ state.fillPattern.clear();267 setPlatformFillGradient(m_ state.fillGradient.get());261 m_common->state.fillGradient = gradient; 262 m_common->state.fillPattern.clear(); 263 setPlatformFillGradient(m_common->state.fillGradient.get()); 268 264 } 269 265 270 266 Gradient* GraphicsContext::fillGradient() const 271 267 { 272 return m_ state.fillGradient.get();268 return m_common->state.fillGradient.get(); 273 269 } 274 270 275 271 Gradient* GraphicsContext::strokeGradient() const 276 272 { 277 return m_ state.strokeGradient.get();273 return m_common->state.strokeGradient.get(); 278 274 } 279 275 280 276 Pattern* GraphicsContext::fillPattern() const 281 277 { 282 return m_ state.fillPattern.get();278 return m_common->state.fillPattern.get(); 283 279 } 284 280 285 281 Pattern* GraphicsContext::strokePattern() const 286 282 { 287 return m_ state.strokePattern.get();283 return m_common->state.strokePattern.get(); 288 284 } 289 285 290 286 void GraphicsContext::setShadowsIgnoreTransforms(bool ignoreTransforms) 291 287 { 292 m_ state.shadowsIgnoreTransforms = ignoreTransforms;288 m_common->state.shadowsIgnoreTransforms = ignoreTransforms; 293 289 } 294 290 295 291 bool GraphicsContext::updatingControlTints() const 296 292 { 297 return m_ updatingControlTints;293 return m_common->m_updatingControlTints; 298 294 } 299 295 … … 301 297 { 302 298 setPaintingDisabled(b); 303 m_ updatingControlTints = b;299 m_common->m_updatingControlTints = b; 304 300 } 305 301 306 302 void GraphicsContext::setPaintingDisabled(bool f) 307 303 { 308 m_ state.paintingDisabled = f;304 m_common->state.paintingDisabled = f; 309 305 } 310 306 311 307 bool GraphicsContext::paintingDisabled() const 312 308 { 313 return m_ state.paintingDisabled;309 return m_common->state.paintingDisabled; 314 310 } 315 311 … … 533 529 TextDrawingModeFlags GraphicsContext::textDrawingMode() const 534 530 { 535 return m_ state.textDrawingMode;531 return m_common->state.textDrawingMode; 536 532 } 537 533 538 534 void GraphicsContext::setTextDrawingMode(TextDrawingModeFlags mode) 539 535 { 540 m_ state.textDrawingMode = mode;536 m_common->state.textDrawingMode = mode; 541 537 if (paintingDisabled()) 542 538 return; -
trunk/WebCore/platform/graphics/GraphicsContext.h
r73492 r73496 31 31 #include "DashArray.h" 32 32 #include "FloatRect.h" 33 #include "Gradient.h"34 33 #include "Image.h" 35 34 #include "IntRect.h" 36 35 #include "Path.h" 37 #include "Pattern.h"38 36 #include "TextDirection.h" 39 37 #include <wtf/Noncopyable.h> … … 120 118 class Font; 121 119 class Generator; 120 class Gradient; 122 121 class GraphicsContextPlatformPrivate; 122 class GraphicsContextPrivate; 123 123 class ImageBuffer; 124 124 class KURL; 125 class Pattern; 125 126 class SharedGraphicsContext3D; 126 127 class TextRun; … … 149 150 }; 150 151 151 struct GraphicsContextState {152 GraphicsContextState()153 : strokeThickness(0)154 , shadowBlur(0)155 #if PLATFORM(CAIRO)156 , globalAlpha(1)157 #endif158 , textDrawingMode(TextModeFill)159 , strokeColor(Color::black)160 , fillColor(Color::black)161 , strokeStyle(SolidStroke)162 , fillRule(RULE_NONZERO)163 , strokeColorSpace(ColorSpaceDeviceRGB)164 , fillColorSpace(ColorSpaceDeviceRGB)165 , shouldAntialias(true)166 , paintingDisabled(false)167 , shadowsIgnoreTransforms(false)168 {169 }170 171 RefPtr<Gradient> strokeGradient;172 RefPtr<Pattern> strokePattern;173 174 RefPtr<Gradient> fillGradient;175 RefPtr<Pattern> fillPattern;176 177 FloatSize shadowOffset;178 179 float strokeThickness;180 float shadowBlur;181 182 #if PLATFORM(CAIRO)183 float globalAlpha;184 #endif185 TextDrawingModeFlags textDrawingMode;186 187 Color strokeColor;188 Color fillColor;189 Color shadowColor;190 191 StrokeStyle strokeStyle;192 WindRule fillRule;193 194 ColorSpace strokeColorSpace;195 ColorSpace fillColorSpace;196 197 bool shouldAntialias;198 bool paintingDisabled;199 bool shadowsIgnoreTransforms;200 };201 202 152 class GraphicsContext : public Noncopyable { 203 153 public: … … 239 189 void setShouldAntialias(bool); 240 190 bool shouldAntialias() const; 241 242 const GraphicsContextState& state() const;243 191 244 192 #if PLATFORM(CG) … … 394 342 void drawRoundCorner(bool newClip, RECT clipRect, RECT rectWin, HDC dc, int width, int height); 395 343 #elif PLATFORM(WIN) 396 void platformInit(HDC, bool hasAlpha = false);344 GraphicsContext(HDC, bool hasAlpha = false); // FIXME: To be removed. 397 345 bool inTransparencyLayer() const; 398 346 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. … … 471 419 472 420 private: 473 void platformInit(PlatformGraphicsContext*);474 void platformDestroy();475 476 421 void savePlatformState(); 477 422 void restorePlatformState(); … … 497 442 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, const StrokeStyle&); 498 443 499 GraphicsContextPlatformPrivate* m_data;500 501 GraphicsContextState m_state; 502 Vector<GraphicsContextState> m_stack;503 bool m_updatingControlTints;444 static GraphicsContextPrivate* createGraphicsContextPrivate(); 445 static void destroyGraphicsContextPrivate(GraphicsContextPrivate*); 446 447 GraphicsContextPrivate* m_common; 448 GraphicsContextPlatformPrivate* m_data; // Deprecated; m_commmon can just be downcasted. To be removed. 504 449 }; 505 450 -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r73492 r73496 42 42 #include "Font.h" 43 43 #include "GraphicsContextPlatformPrivateCairo.h" 44 #include "GraphicsContextPrivate.h" 44 45 #include "OwnPtrCairo.h" 45 46 #include "IntRect.h" … … 69 70 namespace WebCore { 70 71 71 static inline void setPlatformFill(GraphicsContext* context, cairo_t* cr )72 static inline void setPlatformFill(GraphicsContext* context, cairo_t* cr, GraphicsContextPrivate* gcp) 72 73 { 73 74 cairo_pattern_t* pattern = 0; 74 75 cairo_save(cr); 75 76 const GraphicsContextState& state = context->state(); 77 if (state.fillPattern) { 76 if (gcp->state.fillPattern) { 78 77 AffineTransform affine; 79 pattern = state.fillPattern->createPlatformPattern(affine);78 pattern = gcp->state.fillPattern->createPlatformPattern(affine); 80 79 cairo_set_source(cr, pattern); 81 } else if ( state.fillGradient)82 cairo_set_source(cr, state.fillGradient->platformGradient());80 } else if (gcp->state.fillGradient) 81 cairo_set_source(cr, gcp->state.fillGradient->platformGradient()); 83 82 else 84 83 setSourceRGBAFromColor(cr, context->fillColor()); 85 84 cairo_clip_preserve(cr); 86 cairo_paint_with_alpha(cr, state.globalAlpha);85 cairo_paint_with_alpha(cr, gcp->state.globalAlpha); 87 86 cairo_restore(cr); 88 87 if (pattern) … … 90 89 } 91 90 92 static inline void setPlatformStroke(GraphicsContext* context, cairo_t* cr )91 static inline void setPlatformStroke(GraphicsContext* context, cairo_t* cr, GraphicsContextPrivate* gcp) 93 92 { 94 93 cairo_pattern_t* pattern = 0; 95 94 cairo_save(cr); 96 97 const GraphicsContextState& state = context->state(); 98 if (state.strokePattern) { 95 if (gcp->state.strokePattern) { 99 96 AffineTransform affine; 100 pattern = state.strokePattern->createPlatformPattern(affine);97 pattern = gcp->state.strokePattern->createPlatformPattern(affine); 101 98 cairo_set_source(cr, pattern); 102 } else if ( state.strokeGradient)103 cairo_set_source(cr, state.strokeGradient->platformGradient());99 } else if (gcp->state.strokeGradient) 100 cairo_set_source(cr, gcp->state.strokeGradient->platformGradient()); 104 101 else { 105 Color strokeColor = colorWithOverrideAlpha(context->strokeColor().rgb(), context->strokeColor().alpha() / 255.f * state.globalAlpha);102 Color strokeColor = colorWithOverrideAlpha(context->strokeColor().rgb(), context->strokeColor().alpha() / 255.f * gcp->state.globalAlpha); 106 103 setSourceRGBAFromColor(cr, strokeColor); 107 104 } 108 if ( state.globalAlpha < 1.0f && (state.strokePattern ||state.strokeGradient)) {105 if (gcp->state.globalAlpha < 1.0f && (gcp->state.strokePattern || gcp->state.strokeGradient)) { 109 106 cairo_push_group(cr); 110 cairo_paint_with_alpha(cr, state.globalAlpha);107 cairo_paint_with_alpha(cr, gcp->state.globalAlpha); 111 108 cairo_pop_group_to_source(cr); 112 109 } … … 140 137 }; 141 138 142 static inline void drawPathShadow(GraphicsContext* context, PathDrawingStyle drawingStyle)139 static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPrivate* contextPrivate, PathDrawingStyle drawingStyle) 143 140 { 144 141 ContextShadow* shadow = context->contextShadow(); … … 176 173 177 174 if (drawingStyle & Fill) 178 setPlatformFill(context, shadowContext );175 setPlatformFill(context, shadowContext, contextPrivate); 179 176 if (drawingStyle & Stroke) 180 setPlatformStroke(context, shadowContext );177 setPlatformStroke(context, shadowContext, contextPrivate); 181 178 182 179 shadow->endShadowLayer(cairoContext); 183 180 } 184 181 185 static void fillCurrentCairoPath(GraphicsContext* context, cairo_t* cairoContext)182 static void fillCurrentCairoPath(GraphicsContext* context, GraphicsContextPrivate* gcp, cairo_t* cairoContext) 186 183 { 187 184 cairo_set_fill_rule(cairoContext, context->fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); 188 drawPathShadow(context, Fill);189 190 setPlatformFill(context, cairoContext );185 drawPathShadow(context, gcp, Fill); 186 187 setPlatformFill(context, cairoContext, gcp); 191 188 cairo_new_path(cairoContext); 192 189 } 193 190 194 static void strokeCurrentCairoPath(GraphicsContext* context, cairo_t* cairoContext)195 { 196 drawPathShadow(context, Stroke);197 setPlatformStroke(context, cairoContext );191 static void strokeCurrentCairoPath(GraphicsContext* context, GraphicsContextPrivate* gcp, cairo_t* cairoContext) 192 { 193 drawPathShadow(context, gcp, Stroke); 194 setPlatformStroke(context, cairoContext, gcp); 198 195 cairo_new_path(cairoContext); 199 196 } 200 197 201 void GraphicsContext::platformInit(PlatformGraphicsContext* cr) 202 { 203 m_data = new GraphicsContextPlatformPrivate; 198 GraphicsContext::GraphicsContext(PlatformGraphicsContext* cr) 199 : m_common(createGraphicsContextPrivate()) 200 , m_data(new GraphicsContextPlatformPrivate) 201 { 204 202 m_data->cr = cairo_reference(cr); 205 203 m_data->syncContext(cr); … … 207 205 } 208 206 209 void GraphicsContext::platformDestroy() 210 { 207 GraphicsContext::~GraphicsContext() 208 { 209 destroyGraphicsContextPrivate(m_common); 211 210 delete m_data; 212 211 } … … 534 533 cairo_t* cr = m_data->cr; 535 534 setPathOnCairoContext(cr, path.platformPath()->context()); 536 fillCurrentCairoPath(this, cr);535 fillCurrentCairoPath(this, m_common, cr); 537 536 } 538 537 … … 544 543 cairo_t* cr = m_data->cr; 545 544 setPathOnCairoContext(cr, path.platformPath()->context()); 546 strokeCurrentCairoPath(this, cr);545 strokeCurrentCairoPath(this, m_common, cr); 547 546 } 548 547 … … 555 554 cairo_save(cr); 556 555 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); 557 fillCurrentCairoPath(this, cr);556 fillCurrentCairoPath(this, m_common, cr); 558 557 cairo_restore(cr); 559 558 } … … 865 864 { 866 865 // Cairo doesn't support shadows natively, they are drawn manually in the draw* functions 867 if (m_ state.shadowsIgnoreTransforms) {866 if (m_common->state.shadowsIgnoreTransforms) { 868 867 // Meaning that this graphics context is associated with a CanvasRenderingContext 869 868 // We flip the height since CG and HTML5 Canvas have opposite Y axis 870 m_ state.shadowOffset = FloatSize(size.width(), -size.height());869 m_common->state.shadowOffset = FloatSize(size.width(), -size.height()); 871 870 m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), -size.height())); 872 871 } else … … 931 930 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); 932 931 cairo_set_line_width(cr, width); 933 strokeCurrentCairoPath(this, cr);932 strokeCurrentCairoPath(this, m_common, cr); 934 933 cairo_restore(cr); 935 934 } … … 990 989 void GraphicsContext::setAlpha(float alpha) 991 990 { 992 m_ state.globalAlpha = alpha;991 m_common->state.globalAlpha = alpha; 993 992 } 994 993 995 994 float GraphicsContext::getAlpha() 996 995 { 997 return m_ state.globalAlpha;996 return m_common->state.globalAlpha; 998 997 } 999 998 -
trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r73492 r73496 32 32 #include "FloatConversion.h" 33 33 #include "GraphicsContextPlatformPrivateCG.h" 34 #include "GraphicsContextPrivate.h" 34 35 #include "ImageBuffer.h" 35 36 #include "KURL.h" … … 108 109 } 109 110 110 void GraphicsContext::platformInit(CGContextRef cgContext) 111 { 112 m_data = new GraphicsContextPlatformPrivate(cgContext); 111 GraphicsContext::GraphicsContext(CGContextRef cgContext) 112 : m_common(createGraphicsContextPrivate()) 113 , m_data(new GraphicsContextPlatformPrivate(cgContext)) 114 { 113 115 setPaintingDisabled(!cgContext); 114 116 if (cgContext) { … … 119 121 } 120 122 121 void GraphicsContext::platformDestroy() 122 { 123 GraphicsContext::~GraphicsContext() 124 { 125 destroyGraphicsContextPrivate(m_common); 123 126 delete m_data; 124 127 } … … 451 454 CGContextRef cgContext = platformContext(); 452 455 453 RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_ state.strokePattern->createPlatformPattern(getCTM()));456 RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_common->state.strokePattern->createPlatformPattern(getCTM())); 454 457 if (!platformPattern) 455 458 return; … … 466 469 CGContextRef cgContext = platformContext(); 467 470 468 RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_ state.fillPattern->createPlatformPattern(getCTM()));471 RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_common->state.fillPattern->createPlatformPattern(getCTM())); 469 472 if (!platformPattern) 470 473 return; … … 510 513 511 514 CGContextRef context = platformContext(); 512 const GraphicsContextState& state = m_ state;515 const GraphicsContextState& state = m_common->state; 513 516 514 517 if (state.fillGradient || state.strokeGradient) { … … 551 554 CGContextAddPath(context, path.platformPath()); 552 555 553 if (m_ state.fillGradient) {556 if (m_common->state.fillGradient) { 554 557 CGContextSaveGState(context); 555 558 if (fillRule() == RULE_EVENODD) … … 557 560 else 558 561 CGContextClip(context); 559 CGContextConcatCTM(context, m_ state.fillGradient->gradientSpaceTransform());560 m_ state.fillGradient->paint(this);562 CGContextConcatCTM(context, m_common->state.fillGradient->gradientSpaceTransform()); 563 m_common->state.fillGradient->paint(this); 561 564 CGContextRestoreGState(context); 562 565 return; 563 566 } 564 567 565 if (m_ state.fillPattern)568 if (m_common->state.fillPattern) 566 569 applyFillPattern(); 567 570 fillPathWithFillRule(context, fillRule()); … … 578 581 CGContextAddPath(context, path.platformPath()); 579 582 580 if (m_ state.strokeGradient) {583 if (m_common->state.strokeGradient) { 581 584 CGContextSaveGState(context); 582 585 CGContextReplacePathWithStrokedPath(context); 583 586 CGContextClip(context); 584 CGContextConcatCTM(context, m_ state.strokeGradient->gradientSpaceTransform());585 m_ state.strokeGradient->paint(this);587 CGContextConcatCTM(context, m_common->state.strokeGradient->gradientSpaceTransform()); 588 m_common->state.strokeGradient->paint(this); 586 589 CGContextRestoreGState(context); 587 590 return; 588 591 } 589 592 590 if (m_ state.strokePattern)593 if (m_common->state.strokePattern) 591 594 applyStrokePattern(); 592 595 CGContextStrokePath(context); … … 600 603 CGContextRef context = platformContext(); 601 604 602 if (m_ state.fillGradient) {605 if (m_common->state.fillGradient) { 603 606 CGContextSaveGState(context); 604 607 CGContextClipToRect(context, rect); 605 CGContextConcatCTM(context, m_ state.fillGradient->gradientSpaceTransform());606 m_ state.fillGradient->paint(this);608 CGContextConcatCTM(context, m_common->state.fillGradient->gradientSpaceTransform()); 609 m_common->state.fillGradient->paint(this); 607 610 CGContextRestoreGState(context); 608 611 return; 609 612 } 610 613 611 if (m_ state.fillPattern)614 if (m_common->state.fillPattern) 612 615 applyFillPattern(); 613 616 CGContextFillRect(context, rect); … … 739 742 CGContextRef context = platformContext(); 740 743 741 if (!m_ state.shadowsIgnoreTransforms) {744 if (!m_common->state.shadowsIgnoreTransforms) { 742 745 CGAffineTransform userToBaseCTM = wkGetUserToBaseCTM(context); 743 746 … … 814 817 CGContextRef context = platformContext(); 815 818 816 if (m_ state.strokeGradient) {819 if (m_common->state.strokeGradient) { 817 820 CGContextSaveGState(context); 818 821 setStrokeThickness(lineWidth); … … 820 823 CGContextReplacePathWithStrokedPath(context); 821 824 CGContextClip(context); 822 m_ state.strokeGradient->paint(this);825 m_common->state.strokeGradient->paint(this); 823 826 CGContextRestoreGState(context); 824 827 return; 825 828 } 826 829 827 if (m_ state.strokePattern)830 if (m_common->state.strokePattern) 828 831 applyStrokePattern(); 829 832 CGContextStrokeRectWithWidth(context, r, lineWidth); -
trunk/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
r73492 r73496 63 63 } 64 64 65 void GraphicsContext::platformInit(PlatformGraphicsContext* context) 66 { 67 m_data = new GraphicsContextPlatformPrivate(context); 65 GraphicsContext::GraphicsContext(PlatformGraphicsContext* context) 66 : m_common(createGraphicsContextPrivate()) 67 , m_data(new GraphicsContextPlatformPrivate(context)) 68 { 68 69 setPaintingDisabled(!context); 69 70 } 70 71 71 void GraphicsContext::platformDestroy() 72 { 72 GraphicsContext::~GraphicsContext() 73 { 74 destroyGraphicsContextPrivate(m_common); 73 75 delete m_data; 74 76 } -
trunk/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
r73492 r73496 22 22 23 23 #include "AffineTransform.h" 24 #include "GraphicsContextPrivate.h" 24 25 #include "KURL.h" 25 26 #include "NotImplemented.h" … … 49 50 }; 50 51 51 void GraphicsContext::platformInit(SurfaceOpenVG* surface) 52 { 53 m_data = surface ? new GraphicsContextPlatformPrivate(surface) : 0; 52 GraphicsContext::GraphicsContext(SurfaceOpenVG* surface) 53 : m_common(createGraphicsContextPrivate()) 54 , m_data(surface ? new GraphicsContextPlatformPrivate(surface) : 0) 55 { 54 56 setPaintingDisabled(!surface); 55 57 } 56 58 57 void GraphicsContext::platformDestroy() 58 { 59 GraphicsContext::~GraphicsContext() 60 { 61 destroyGraphicsContextPrivate(m_common); 59 62 delete m_data; 60 63 } … … 142 145 return; 143 146 144 m_data->drawPath(path, VG_FILL_PATH, m_ state.fillRule);147 m_data->drawPath(path, VG_FILL_PATH, m_common->state.fillRule); 145 148 } 146 149 … … 150 153 return; 151 154 152 m_data->drawPath(path, VG_STROKE_PATH, m_ state.fillRule);155 m_data->drawPath(path, VG_STROKE_PATH, m_common->state.fillRule); 153 156 } 154 157 … … 378 381 return; 379 382 380 m_data->clipPath(path, PainterOpenVG::IntersectClip, m_ state.fillRule);383 m_data->clipPath(path, PainterOpenVG::IntersectClip, m_common->state.fillRule); 381 384 } 382 385 … … 391 394 return; 392 395 393 m_data->clipPath(path, PainterOpenVG::SubtractClip, m_ state.fillRule);396 m_data->clipPath(path, PainterOpenVG::SubtractClip, m_common->state.fillRule); 394 397 } 395 398 … … 425 428 Path path; 426 429 path.addRect(rect); 427 m_data->clipPath(path, PainterOpenVG::SubtractClip, m_ state.fillRule);430 m_data->clipPath(path, PainterOpenVG::SubtractClip, m_common->state.fillRule); 428 431 } 429 432 … … 448 451 rect.width() - (thickness * 2), rect.height() - (thickness * 2))); 449 452 450 m_data->clipPath(path, PainterOpenVG::IntersectClip, m_ state.fillRule);453 m_data->clipPath(path, PainterOpenVG::IntersectClip, m_common->state.fillRule); 451 454 } 452 455 -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r73492 r73496 47 47 #include "FloatConversion.h" 48 48 #include "Font.h" 49 #include "GraphicsContextPrivate.h" 49 50 #include "ImageBuffer.h" 50 51 #include "NotImplemented.h" … … 224 225 }; 225 226 227 226 228 GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p, const QColor& initialSolidColor) 227 229 : antiAliasingForRectsAndLines(false) … … 252 254 } 253 255 254 void GraphicsContext::platformInit(PlatformGraphicsContext* painter)255 { 256 m_data = new GraphicsContextPlatformPrivate(painter, fillColor());257 256 GraphicsContext::GraphicsContext(PlatformGraphicsContext* painter) 257 : m_common(createGraphicsContextPrivate()) 258 , m_data(new GraphicsContextPlatformPrivate(painter, fillColor())) 259 { 258 260 setPaintingDisabled(!painter); 259 261 … … 270 272 } 271 273 272 void GraphicsContext::platformDestroy()274 GraphicsContext::~GraphicsContext() 273 275 { 274 276 while (!m_data->layers.isEmpty()) 275 277 endTransparencyLayer(); 276 278 279 destroyGraphicsContextPrivate(m_common); 277 280 delete m_data; 278 281 } … … 508 511 ContextShadow* shadow = contextShadow(); 509 512 if (shadow->m_type != ContextShadow::BlurShadow 510 && !m_ state.fillPattern && !m_state.fillGradient)513 && !m_common->state.fillPattern && !m_common->state.fillGradient) 511 514 { 512 515 QPointF offset = shadow->offset(); … … 535 538 536 539 } 537 if (m_ state.fillPattern) {540 if (m_common->state.fillPattern) { 538 541 AffineTransform affine; 539 p->fillPath(platformPath, QBrush(m_ state.fillPattern->createPlatformPattern(affine)));540 } else if (m_ state.fillGradient) {541 QBrush brush(*m_ state.fillGradient->platformGradient());542 brush.setTransform(m_ state.fillGradient->gradientSpaceTransform());542 p->fillPath(platformPath, QBrush(m_common->state.fillPattern->createPlatformPattern(affine))); 543 } else if (m_common->state.fillGradient) { 544 QBrush brush(*m_common->state.fillGradient->platformGradient()); 545 brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform()); 543 546 p->fillPath(platformPath, brush); 544 547 } else … … 560 563 561 564 if (shadow->m_type != ContextShadow::BlurShadow 562 && !m_ state.strokePattern && !m_state.strokeGradient)565 && !m_common->state.strokePattern && !m_common->state.strokeGradient) 563 566 { 564 567 QPen shadowPen(pen); … … 591 594 } 592 595 593 if (m_ state.strokePattern) {596 if (m_common->state.strokePattern) { 594 597 AffineTransform affine; 595 pen.setBrush(QBrush(m_ state.strokePattern->createPlatformPattern(affine)));598 pen.setBrush(QBrush(m_common->state.strokePattern->createPlatformPattern(affine))); 596 599 p->setPen(pen); 597 600 p->strokePath(platformPath, pen); 598 } else if (m_ state.strokeGradient) {599 QBrush brush(*m_ state.strokeGradient->platformGradient());600 brush.setTransform(m_ state.strokeGradient->gradientSpaceTransform());601 } else if (m_common->state.strokeGradient) { 602 QBrush brush(*m_common->state.strokeGradient->platformGradient()); 603 brush.setTransform(m_common->state.strokeGradient->gradientSpaceTransform()); 601 604 pen.setBrush(brush); 602 605 p->setPen(pen); … … 682 685 ContextShadow* shadow = contextShadow(); 683 686 684 if (m_ state.fillPattern) {687 if (m_common->state.fillPattern) { 685 688 AffineTransform affine; 686 QBrush brush(m_ state.fillPattern->createPlatformPattern(affine));687 QPixmap* image = m_ state.fillPattern->tileImage()->nativeImageForCurrentFrame();689 QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine)); 690 QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame(); 688 691 QPainter* shadowPainter = m_data->hasShadow() ? shadow->beginShadowLayer(p, normalizedRect) : 0; 689 692 if (shadowPainter) { 690 drawRepeatPattern(shadowPainter, image, normalizedRect, m_ state.fillPattern->repeatX(), m_state.fillPattern->repeatY());693 drawRepeatPattern(shadowPainter, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY()); 691 694 shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn); 692 695 shadowPainter->fillRect(normalizedRect, shadow->m_color); 693 696 shadow->endShadowLayer(p); 694 697 } 695 drawRepeatPattern(p, image, normalizedRect, m_ state.fillPattern->repeatX(), m_state.fillPattern->repeatY());696 } else if (m_ state.fillGradient) {697 QBrush brush(*m_ state.fillGradient->platformGradient());698 brush.setTransform(m_ state.fillGradient->gradientSpaceTransform());698 drawRepeatPattern(p, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY()); 699 } else if (m_common->state.fillGradient) { 700 QBrush brush(*m_common->state.fillGradient->platformGradient()); 701 brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform()); 699 702 QPainter* shadowPainter = m_data->hasShadow() ? shadow->beginShadowLayer(p, normalizedRect) : 0; 700 703 if (shadowPainter) { … … 967 970 // functions 968 971 969 if (m_ state.shadowsIgnoreTransforms) {972 if (m_common->state.shadowsIgnoreTransforms) { 970 973 // Meaning that this graphics context is associated with a CanvasRenderingContext 971 974 // We flip the height since CG and HTML5 Canvas have opposite Y axis 972 m_ state.shadowOffset = FloatSize(size.width(), -size.height());975 m_common->state.shadowOffset = FloatSize(size.width(), -size.height()); 973 976 m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), -size.height())); 974 977 } else { -
trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
r73492 r73496 38 38 #include "Gradient.h" 39 39 #include "GraphicsContextPlatformPrivate.h" 40 #include "GraphicsContextPrivate.h" 40 41 #include "ImageBuffer.h" 41 42 #include "IntRect.h" … … 219 220 // This may be called with a NULL pointer to create a graphics context that has 220 221 // no painting. 221 void GraphicsContext::platformInit(PlatformGraphicsContext* gc) 222 { 223 m_data = new GraphicsContextPlatformPrivate(gc); 222 GraphicsContext::GraphicsContext(PlatformGraphicsContext* gc) 223 : m_common(createGraphicsContextPrivate()) 224 , m_data(new GraphicsContextPlatformPrivate(gc)) 225 { 224 226 setPaintingDisabled(!gc || !platformContext()->canvas()); 225 227 } 226 228 227 void GraphicsContext::platformDestroy()229 GraphicsContext::~GraphicsContext() 228 230 { 229 231 delete m_data; 232 this->destroyGraphicsContextPrivate(m_common); 230 233 } 231 234 … … 740 743 platformContext()->prepareForSoftwareDraw(); 741 744 742 const GraphicsContextState& state = m_ state;745 const GraphicsContextState& state = m_common->state; 743 746 path.setFillType(state.fillRule == RULE_EVENODD ? 744 747 SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType); … … 1069 1072 // TODO(tc): This still does not address the issue that shadows 1070 1073 // within canvas elements should ignore transforms. 1071 if (m_ state.shadowsIgnoreTransforms) {1074 if (m_common->state.shadowsIgnoreTransforms) { 1072 1075 // Currently only the GraphicsContext associated with the 1073 1076 // CanvasRenderingContext for HTMLCanvasElement have shadows ignore -
trunk/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
r73492 r73496 62 62 } 63 63 64 void GraphicsContext::platformInit(HDC hdc, bool hasAlpha) 65 { 66 m_data = new GraphicsContextPlatformPrivate(CGContextWithHDC(hdc, hasAlpha)); 64 GraphicsContext::GraphicsContext(HDC hdc, bool hasAlpha) 65 : m_common(createGraphicsContextPrivate()) 66 , m_data(new GraphicsContextPlatformPrivate(CGContextWithHDC(hdc, hasAlpha))) 67 { 67 68 CGContextRelease(m_data->m_cgContext.get()); 68 69 m_data->m_hdc = hdc; -
trunk/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
r73492 r73496 65 65 } 66 66 67 void GraphicsContext::platformInit(HDC dc, bool hasAlpha) 67 GraphicsContext::GraphicsContext(HDC dc, bool hasAlpha) 68 : m_common(createGraphicsContextPrivate()) 69 , m_data(new GraphicsContextPlatformPrivate) 68 70 { 69 m_data = new GraphicsContextPlatformPrivate;70 71 71 if (dc) { 72 72 m_data->cr = createCairoContextWithHDC(dc, hasAlpha); -
trunk/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
r73492 r73496 29 29 #include "GlyphBuffer.h" 30 30 #include "Gradient.h" 31 #include "GraphicsContextPrivate.h" 31 32 #include "NotImplemented.h" 32 33 #include "Path.h" … … 580 581 581 582 582 void GraphicsContext::platformInit(PlatformGraphicsContext* dc) 583 { 584 m_data = new GraphicsContextPlatformPrivate(dc); 585 } 586 587 void GraphicsContext::platformDestroy() 588 { 583 GraphicsContext::GraphicsContext(PlatformGraphicsContext* dc) 584 : m_common(createGraphicsContextPrivate()) 585 , m_data(new GraphicsContextPlatformPrivate(dc)) 586 { 587 } 588 589 GraphicsContext::~GraphicsContext() 590 { 591 destroyGraphicsContextPrivate(m_common); 589 592 delete m_data; 590 593 } … … 1314 1317 void GraphicsContext::fillPath(const Path& path) 1315 1318 { 1316 Color c = m_ state.fillGradient1317 ? gradientAverageColor(m_ state.fillGradient.get())1319 Color c = m_common->state.fillGradient 1320 ? gradientAverageColor(m_common->state.fillGradient.get()) 1318 1321 : fillColor(); 1319 1322 … … 1485 1488 savePlatformState(); 1486 1489 1487 if (m_ state.fillGradient)1488 fillRect(rect, m_ state.fillGradient.get());1490 if (m_common->state.fillGradient) 1491 fillRect(rect, m_common->state.fillGradient.get()); 1489 1492 else 1490 1493 fillRect(rect, fillColor(), ColorSpaceDeviceRGB); -
trunk/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
r73492 r73496 113 113 114 114 115 void GraphicsContext::platformInit(PlatformGraphicsContext* context) 116 { 117 m_data = new GraphicsContextPlatformPrivate; 115 GraphicsContext::GraphicsContext(PlatformGraphicsContext* context) 116 : m_common(createGraphicsContextPrivate()) 117 , m_data(new GraphicsContextPlatformPrivate) 118 { 118 119 setPaintingDisabled(!context); 119 120 120 if (context) { 121 121 // Make sure the context starts in sync with our state. … … 130 130 } 131 131 132 void GraphicsContext::platformDestroy() 133 { 132 GraphicsContext::~GraphicsContext() 133 { 134 destroyGraphicsContextPrivate(m_common); 134 135 delete m_data; 135 136 }
Note: See TracChangeset
for help on using the changeset viewer.