Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 66102 Details for
Bug 98828
mozilla 1.7.8 does not compile with glitz 0.4 and cairo 0.5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
2nd part of ugly patch
moz-svg-renderer_newer_cairo-2.diff (text/plain), 7.67 KB, created by
Hanno Zysik (geki)
on 2005-08-16 14:35:43 UTC
(
hide
)
Description:
2nd part of ugly patch
Filename:
MIME Type:
Creator:
Hanno Zysik (geki)
Created:
2005-08-16 14:35:43 UTC
Size:
7.67 KB
patch
obsolete
>--- mozilla/layout/svg/renderer/src/cairo/nsSVGCairoCanvas.cpp.orig 2005-08-16 22:21:45.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsSVGCairoCanvas.cpp 2005-08-16 22:31:24.000000000 +0200 >@@ -116,10 +116,11 @@ > surface->GetSize(&mWidth, &mHeight); > GdkDrawable *drawable = surface->GetDrawable(); > >+ GdkVisual *visual = gdk_window_get_visual(drawable); > cairo_surface_t *target = > cairo_xlib_surface_create(GDK_WINDOW_XDISPLAY(drawable), >- drawable, > GDK_WINDOW_XWINDOW(drawable), >+ GDK_VISUAL_XVISUAL(visual), > mWidth, > mHeight); > >--- mozilla/layout/svg/renderer/src/cairo/nsSVGCairoPathGeometry.cpp.orig 2005-08-16 22:15:18.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsSVGCairoPathGeometry.cpp 2005-08-16 22:21:06.000000000 +0200 >@@ -166,9 +166,8 @@ > ctm->GetF(&val); > m[5] = val; > >- cairo_matrix_t *matrix = cairo_matrix_create(); >- cairo_matrix_set_affine(matrix, m[0], m[1], m[2], m[3], m[4], m[5]); >- cairo_concat_matrix(ctx, matrix); >+ cairo_matrix_t matrix = { m[0], m[1], m[2], m[3], m[4], m[5] }; >+ cairo_set_matrix(ctx, &matrix); > > nsCOMPtr<nsISVGRendererPathBuilder> builder; > NS_NewSVGCairoPathBuilder(getter_AddRefs(builder), ctx); >@@ -322,10 +321,11 @@ > { > *_retval = PR_FALSE; > >- cairo_t *ctx = cairo_create(); >+ cairo_t *ctx = cairo_create(0); > > GeneratePath(ctx); >- cairo_default_matrix(ctx); >+ double xx = x, yy = y; >+ cairo_device_to_user(ctx, &xx, &yy); > > PRUint16 mask = 0; > mSource->GetHittestMask(&mask); >--- mozilla/layout/svg/renderer/src/cairo/nsISVGCairoGlyphMetrics.h.orig 2005-08-16 22:40:33.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsISVGCairoGlyphMetrics.h 2005-08-16 22:46:48.000000000 +0200 >@@ -65,7 +65,7 @@ > > NS_IMETHOD_(void) GetSubBoundingBox(PRUint32 charoffset, PRUint32 count, nsIDOMSVGRect * *aBoundingBox)=0; > >- NS_IMETHOD_(cairo_font_t*) GetFont() = 0; >+ NS_IMETHOD_(void) SelectFont(cairo_t *ctx) = 0; > }; > > /** @} */ >--- mozilla/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp.orig 2005-08-16 22:47:31.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp 2005-08-16 23:11:29.000000000 +0200 >@@ -83,11 +83,10 @@ > NS_IMETHOD_(void) GetSubBoundingBox(PRUint32 charoffset, PRUint32 count, > nsIDOMSVGRect * *aBoundingBox); > >- NS_IMETHOD_(cairo_font_t*)GetFont() { return mFont; } >+ NS_IMETHOD_(void) SelectFont(cairo_t *ctx); > > private: > cairo_t *mCT; >- cairo_font_t *mFont; > cairo_text_extents_t mExtents; > nsCOMPtr<nsISVGGlyphMetricsSource> mSource; > }; >@@ -98,9 +97,9 @@ > // implementation: > > nsSVGCairoGlyphMetrics::nsSVGCairoGlyphMetrics(nsISVGGlyphMetricsSource *src) >- : mFont(NULL), mSource(src) >+ : mSource(src) > { >- mCT = cairo_create(); >+ mCT = cairo_create(0); > } > > nsSVGCairoGlyphMetrics::~nsSVGCairoGlyphMetrics() >@@ -203,9 +202,9 @@ > nsAutoString text; > mSource->GetCharacterData(text); > cairo_text_extents(mCT, >- (unsigned char *)NS_ConvertUCS2toUTF8(Substring(text, >- charoffset, >- count)).get(), >+ NS_ConvertUCS2toUTF8(Substring(text, >+ charoffset, >+ count)).get(), > &extents); > > >@@ -255,7 +254,7 @@ > mSource->GetCharacterData(text); > glyph.index = text[charnum]; > >- cairo_set_font(mCT, mFont); >+ SelectFont(mCT); > cairo_glyph_extents(mCT, &glyph, 1, &extent); > > nsCOMPtr<nsIDOMSVGRect> rect = do_CreateInstance(NS_SVGRECT_CONTRACTID); >@@ -285,14 +284,23 @@ > } > > if (updatemask & nsISVGGlyphMetricsSource::UPDATEMASK_FONT) { >- if (mFont) { >- // don't delete mFont because we're just pointing at the ctx copy >- mFont = NULL; >- } > *_retval = PR_TRUE; > } > >- if (!mFont) { >+ SelectFont(mCT); >+ >+ nsAutoString text; >+ mSource->GetCharacterData(text); >+ cairo_text_extents(mCT, >+ NS_ConvertUCS2toUTF8(text).get(), >+ &mExtents); >+ >+ return NS_OK; >+} >+ >+NS_IMETHODIMP_(void) >+nsSVGCairoGlyphMetrics::SelectFont(cairo_t *ctx) >+{ > nsFont font; > mSource->GetFont(&font); > >@@ -313,7 +321,7 @@ > > if (font.weight % 100 == 0) { > if (font.weight >= 600) >- weight = CAIRO_FONT_WEIGHT_BOLD; >+ weight = CAIRO_FONT_WEIGHT_BOLD; > } else if (font.weight % 100 < 50) { > weight = CAIRO_FONT_WEIGHT_BOLD; > } >@@ -321,22 +329,12 @@ > nsString family; > font.GetFirstFamily(family); > char *f = ToNewCString(family); >- cairo_select_font(mCT, f, slant, weight); >- free(f); >- mFont = cairo_get_font(mCT); >+ cairo_select_font_face(ctx, f, slant, weight); >+ nsMemory::Free(f); > > nsCOMPtr<nsIPresContext> presContext; > mSource->GetPresContext(getter_AddRefs(presContext)); > float pxPerTwips; > pxPerTwips = presContext->TwipsToPixels(); >- cairo_scale_font(mCT, font.size*pxPerTwips); >- >- nsAutoString text; >- mSource->GetCharacterData(text); >- cairo_text_extents(mCT, >- (unsigned char*)NS_ConvertUCS2toUTF8(text).get(), >- &mExtents); >- } >- >- return NS_OK; >+ cairo_set_font_size(ctx, font.size*pxPerTwips); > } >--- mozilla/layout/svg/renderer/src/cairo/nsSVGCairoGlyphGeometry.cpp.orig 2005-08-16 23:14:26.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsSVGCairoGlyphGeometry.cpp 2005-08-16 23:32:14.000000000 +0200 >@@ -164,13 +164,11 @@ > return NS_ERROR_FAILURE; > } > >- cairo_font_t *font = metrics->GetFont(); >+ metrics->SelectFont(ctx); > > /* save/pop the state so we don't screw up the xform */ > cairo_save(ctx); > >- cairo_set_font(ctx, font); >- > GetGlobalTransform(ctx); > > float x,y; >@@ -212,7 +210,7 @@ > > nsAutoString text; > mSource->GetCharacterData(text); >- cairo_show_text(ctx, (unsigned char*)NS_ConvertUCS2toUTF8(text).get()); >+ cairo_show_text(ctx, (const char*)NS_ConvertUCS2toUTF8(text).get()); > } > > if (hasStroke) { >@@ -277,7 +275,7 @@ > > nsAutoString text; > mSource->GetCharacterData(text); >- cairo_text_path(ctx, (unsigned char*)NS_ConvertUCS2toUTF8(text).get()); >+ cairo_text_path(ctx, NS_ConvertUCS2toUTF8(text).get()); > cairo_stroke(ctx); > } > >@@ -319,16 +317,15 @@ > return NS_ERROR_FAILURE; > } > >- cairo_font_t *font = metrics->GetFont(); >+ cairo_t *ctx = cairo_create(0); > >- cairo_t *ctx = cairo_create(); >- cairo_set_font(ctx, font); >+ metrics->SelectFont(ctx); > > GetGlobalTransform(ctx); > nsAutoString text; > mSource->GetCharacterData(text); >- cairo_text_path(ctx, (unsigned char*)NS_ConvertUCS2toUTF8(text).get()); >- cairo_default_matrix(ctx); >+ cairo_text_path(ctx, NS_ConvertUCS2toUTF8(text).get()); >+ cairo_identity_matrix(ctx); > *_retval = cairo_in_fill(ctx, x, y); > cairo_destroy(ctx); > >@@ -363,7 +360,6 @@ > ctm->GetF(&val); > m[5] = val; > >- cairo_matrix_t *matrix = cairo_matrix_create(); >- cairo_matrix_set_affine(matrix, m[0], m[1], m[2], m[3], m[4], m[5]); >- cairo_concat_matrix(ctx, matrix); >+ cairo_matrix_t matrix = {m[0], m[1], m[2], m[3], m[4], m[5]}; >+ cairo_set_matrix(ctx, &matrix); > } >--- mozilla/layout/svg/renderer/src/cairo/nsSVGCairoPathBuilder.cpp.orig 2005-08-16 22:38:26.000000000 +0200 >+++ mozilla/layout/svg/renderer/src/cairo/nsSVGCairoPathBuilder.cpp 2005-08-16 23:37:16.000000000 +0200 >@@ -154,7 +154,7 @@ > const double radPerDeg = pi/180.0; > > double x1=0.0, y1=0.0; >- cairo_get_point(mCR, &x1, &y1); >+ cairo_get_current_point(mCR, &x1, &y1); > > // 1. Treat out-of-range parameters as described in > // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 98828
:
65040
|
66102
|
66137
|
68919
|
68930