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 |
|