Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 98828 | Differences between
and this patch

Collapse All | Expand All

(-)./nsSVGCairoCanvas.cpp (-8 / +13 lines)
Lines 115-124 Link Here
115
  surface->GetSize(&mWidth, &mHeight);
115
  surface->GetSize(&mWidth, &mHeight);
116
  GdkDrawable *drawable = surface->GetDrawable();
116
  GdkDrawable *drawable = surface->GetDrawable();
117
117
118
  mCR = cairo_create();
118
  cairo_surface_t *target =
119
  cairo_set_target_drawable(mCR,
119
	cairo_xlib_surface_create(GDK_WINDOW_XDISPLAY(drawable),
120
                            GDK_WINDOW_XDISPLAY(drawable),
120
				  drawable,
121
                            GDK_WINDOW_XWINDOW(drawable));
121
				  GDK_WINDOW_XWINDOW(drawable),
122
				  mWidth,
123
				  mHeight);
124
125
  mCR = cairo_create(target);
122
126
123
  // get the translation set on the rendering context. It will be in
127
  // get the translation set on the rendering context. It will be in
124
  // displayunits (i.e. pixels*scale), *not* pixels:
128
  // displayunits (i.e. pixels*scale), *not* pixels:
Lines 201-210 Link Here
201
NS_IMETHODIMP
205
NS_IMETHODIMP
202
nsSVGCairoCanvas::Clear(nscolor color)
206
nsSVGCairoCanvas::Clear(nscolor color)
203
{
207
{
204
  cairo_set_rgb_color(mCR,
208
  cairo_set_source_rgb(mCR,
205
                      NS_GET_R(color)/255.0,
209
                       NS_GET_R(color)/255.0,
206
                      NS_GET_G(color)/255.0,
210
                       NS_GET_G(color)/255.0,
207
                      NS_GET_B(color)/255.0);
211
                       NS_GET_B(color)/255.0);
212
208
  cairo_rectangle(mCR, 0, 0, mWidth, mHeight);
213
  cairo_rectangle(mCR, 0, 0, mWidth, mHeight);
209
  cairo_fill(mCR);
214
  cairo_fill(mCR);
210
215
(-)./nsSVGCairoGlyphGeometry.cpp (-10 / +10 lines)
Lines 204-214 Link Here
204
      float opacity;
204
      float opacity;
205
      mSource->GetFillOpacity(&opacity);
205
      mSource->GetFillOpacity(&opacity);
206
      
206
      
207
      cairo_set_rgb_color(ctx,
207
      cairo_set_source_rgba(ctx,
208
			  NS_GET_R(rgb)/255.0,
208
			    NS_GET_R(rgb)/255.0,
209
			  NS_GET_G(rgb)/255.0,
209
			    NS_GET_G(rgb)/255.0,
210
			  NS_GET_B(rgb)/255.0);
210
			    NS_GET_B(rgb)/255.0,
211
      cairo_set_alpha(ctx, double(opacity));
211
			    double(opacity));
212
      
212
      
213
      nsAutoString text;
213
      nsAutoString text;
214
      mSource->GetCharacterData(text);
214
      mSource->GetCharacterData(text);
Lines 220-230 Link Here
220
    mSource->GetStrokePaint(&rgb);
220
    mSource->GetStrokePaint(&rgb);
221
    float opacity;
221
    float opacity;
222
    mSource->GetStrokeOpacity(&opacity);
222
    mSource->GetStrokeOpacity(&opacity);
223
    cairo_set_rgb_color(ctx,
223
    cairo_set_source_rgba(ctx,
224
                        NS_GET_R(rgb)/255.0,
224
                          NS_GET_R(rgb)/255.0,
225
                        NS_GET_G(rgb)/255.0,
225
                          NS_GET_G(rgb)/255.0,
226
                        NS_GET_B(rgb)/255.0);
226
                          NS_GET_B(rgb)/255.0,
227
    cairo_set_alpha(ctx, double(opacity));
227
			  double(opacity));
228
228
229
    float width;
229
    float width;
230
    mSource->GetStrokeWidth(&width);
230
    mSource->GetStrokeWidth(&width);
(-)./nsSVGCairoGlyphMetrics.cpp (-1 / +1 lines)
Lines 322-328 Link Here
322
    char *f = ToNewCString(family);
322
    char *f = ToNewCString(family);
323
    cairo_select_font(mCT, f, slant, weight);
323
    cairo_select_font(mCT, f, slant, weight);
324
    free(f);
324
    free(f);
325
    mFont = cairo_current_font(mCT);
325
    mFont = cairo_get_font(mCT);
326
326
327
    nsCOMPtr<nsIPresContext> presContext;
327
    nsCOMPtr<nsIPresContext> presContext;
328
    mSource->GetPresContext(getter_AddRefs(presContext));
328
    mSource->GetPresContext(getter_AddRefs(presContext));
(-)./nsSVGCairoPathBuilder.cpp (-1 / +1 lines)
Lines 154-160 Link Here
154
  const double radPerDeg = pi/180.0;
154
  const double radPerDeg = pi/180.0;
155
155
156
  double x1=0.0, y1=0.0;
156
  double x1=0.0, y1=0.0;
157
  cairo_current_point(mCR, &x1, &y1);
157
  cairo_get_point(mCR, &x1, &y1);
158
158
159
  // 1. Treat out-of-range parameters as described in
159
  // 1. Treat out-of-range parameters as described in
160
  // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
160
  // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
(-)./nsSVGCairoPathGeometry.cpp (-10 / +11 lines)
Lines 212-222 Link Here
212
    float opacity;
212
    float opacity;
213
    mSource->GetFillOpacity(&opacity);
213
    mSource->GetFillOpacity(&opacity);
214
214
215
    cairo_set_rgb_color(ctx,
215
    cairo_set_source_rgba(ctx,
216
                        NS_GET_R(rgb)/255.0,
216
			  NS_GET_R(rgb)/255.0,
217
                        NS_GET_G(rgb)/255.0,
217
			  NS_GET_G(rgb)/255.0,
218
                        NS_GET_B(rgb)/255.0);
218
			  NS_GET_B(rgb)/255.0,
219
    cairo_set_alpha(ctx, double(opacity));
219
			  double(opacity));
220
220
221
    PRUint16 rule;
221
    PRUint16 rule;
222
    mSource->GetFillRule(&rule);
222
    mSource->GetFillRule(&rule);
Lines 236-246 Link Here
236
    mSource->GetStrokePaint(&rgb);
236
    mSource->GetStrokePaint(&rgb);
237
    float opacity;
237
    float opacity;
238
    mSource->GetStrokeOpacity(&opacity);
238
    mSource->GetStrokeOpacity(&opacity);
239
    cairo_set_rgb_color(ctx,
239
240
                        NS_GET_R(rgb)/255.0,
240
    cairo_set_source_rgba(ctx,
241
                        NS_GET_G(rgb)/255.0,
241
			  NS_GET_R(rgb)/255.0,
242
                        NS_GET_B(rgb)/255.0);
242
			  NS_GET_G(rgb)/255.0,
243
    cairo_set_alpha(ctx, double(opacity));
243
			  NS_GET_B(rgb)/255.0,
244
			  double(opacity));
244
245
245
    float width;
246
    float width;
246
    mSource->GetStrokeWidth(&width);
247
    mSource->GetStrokeWidth(&width);

Return to bug 98828