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