diff --git a/accessible/src/atk/Makefile.in b/accessible/src/atk/Makefile.in index 6c72a769486..771172b7cd3 100644 --- a/accessible/src/atk/Makefile.in +++ b/accessible/src/atk/Makefile.in @@ -50,6 +50,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ intl \ layout \ locale \ diff --git a/accessible/src/base/Makefile.in b/accessible/src/base/Makefile.in index 1bfa38bd270..179486fd13b 100644 --- a/accessible/src/base/Makefile.in +++ b/accessible/src/base/Makefile.in @@ -54,6 +54,7 @@ REQUIRES = appshell \ dom \ editor \ gfx \ + thebes \ intl \ layout \ locale \ diff --git a/accessible/src/mac/Makefile.in b/accessible/src/mac/Makefile.in index e99ae3d3f2c..29a2d0e6d69 100644 --- a/accessible/src/mac/Makefile.in +++ b/accessible/src/mac/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ intl \ locale \ string \ diff --git a/accessible/src/msaa/Makefile.in b/accessible/src/msaa/Makefile.in index 678655d09c4..608f68ae231 100644 --- a/accessible/src/msaa/Makefile.in +++ b/accessible/src/msaa/Makefile.in @@ -50,6 +50,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ htmlparser \ intl \ layout \ diff --git a/accessible/src/other/Makefile.in b/accessible/src/other/Makefile.in index d03ab64a19f..523c710c866 100755 --- a/accessible/src/other/Makefile.in +++ b/accessible/src/other/Makefile.in @@ -50,6 +50,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ htmlparser \ intl \ layout \ diff --git a/accessible/src/xforms/Makefile.in b/accessible/src/xforms/Makefile.in index 1b5f7711795..508c09f6d9a 100755 --- a/accessible/src/xforms/Makefile.in +++ b/accessible/src/xforms/Makefile.in @@ -52,6 +52,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ intl \ layout \ locale \ diff --git a/accessible/src/xul/Makefile.in b/accessible/src/xul/Makefile.in index d666523e134..7fde713f37f 100644 --- a/accessible/src/xul/Makefile.in +++ b/accessible/src/xul/Makefile.in @@ -52,6 +52,7 @@ REQUIRES = content \ dom \ editor \ gfx \ + thebes \ intl \ layout \ locale \ diff --git a/content/events/src/Makefile.in b/content/events/src/Makefile.in index d32ec6a4667..5f8318f0680 100644 --- a/content/events/src/Makefile.in +++ b/content/events/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ js \ locale \ gfx \ + thebes \ layout \ widget \ caps \ diff --git a/content/html/content/src/Makefile.in b/content/html/content/src/Makefile.in index a6edfef3d10..8bae404ce80 100644 --- a/content/html/content/src/Makefile.in +++ b/content/html/content/src/Makefile.in @@ -49,6 +49,7 @@ LIBXUL_LIBRARY = 1 REQUIRES = xpcom \ string \ gfx \ + thebes \ layout \ widget \ dom \ diff --git a/content/html/document/src/Makefile.in b/content/html/document/src/Makefile.in index 23ac37343a3..51dfe3013a0 100644 --- a/content/html/document/src/Makefile.in +++ b/content/html/document/src/Makefile.in @@ -49,6 +49,7 @@ LIBXUL_LIBRARY = 1 REQUIRES = xpcom \ string \ gfx \ + thebes \ layout \ widget \ dom \ diff --git a/content/svg/document/src/Makefile.in b/content/svg/document/src/Makefile.in index f8126868421..845afae278b 100644 --- a/content/svg/document/src/Makefile.in +++ b/content/svg/document/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = content \ xpcom \ string \ gfx \ + thebes \ dom \ webshell \ htmlparser \ diff --git a/content/xbl/src/Makefile.in b/content/xbl/src/Makefile.in index 6de22a5832d..3c4986dc7ef 100644 --- a/content/xbl/src/Makefile.in +++ b/content/xbl/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ js \ dom \ gfx \ + thebes \ layout \ xultmpl \ widget \ diff --git a/content/xml/content/src/Makefile.in b/content/xml/content/src/Makefile.in index e7dd530b368..8c0e7109d6e 100644 --- a/content/xml/content/src/Makefile.in +++ b/content/xml/content/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ js \ dom \ gfx \ + thebes \ layout \ widget \ necko \ diff --git a/content/xml/document/src/Makefile.in b/content/xml/document/src/Makefile.in index e8c56bcbc92..d77e0175f67 100644 --- a/content/xml/document/src/Makefile.in +++ b/content/xml/document/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ js \ dom \ gfx \ + thebes \ layout \ widget \ caps \ diff --git a/content/xtf/src/Makefile.in b/content/xtf/src/Makefile.in index 2d53a809fcf..7df38596317 100644 --- a/content/xtf/src/Makefile.in +++ b/content/xtf/src/Makefile.in @@ -50,6 +50,7 @@ REQUIRES = xpcom \ layout \ widget \ gfx \ + thebes \ dom \ js \ locale \ diff --git a/content/xul/content/src/Makefile.in b/content/xul/content/src/Makefile.in index 8b21de9ef0a..2bb29d4903f 100644 --- a/content/xul/content/src/Makefile.in +++ b/content/xul/content/src/Makefile.in @@ -52,6 +52,7 @@ endif REQUIRES = xpcom \ string \ gfx \ + thebes \ layout \ content \ widget \ diff --git a/content/xul/document/src/Makefile.in b/content/xul/document/src/Makefile.in index 8151b22f7ed..c1c5d6ee22a 100644 --- a/content/xul/document/src/Makefile.in +++ b/content/xul/document/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ exthandler \ mimetype \ gfx \ + thebes \ layout \ content \ widget \ diff --git a/content/xul/templates/src/Makefile.in b/content/xul/templates/src/Makefile.in index e88e5d1bece..34b85e3911b 100644 --- a/content/xul/templates/src/Makefile.in +++ b/content/xul/templates/src/Makefile.in @@ -52,6 +52,7 @@ REQUIRES = xpcom \ xpconnect \ caps \ gfx \ + thebes \ layout \ content \ pref \ diff --git a/docshell/base/Makefile.in b/docshell/base/Makefile.in index 73802184bae..fd1074642ab 100644 --- a/docshell/base/Makefile.in +++ b/docshell/base/Makefile.in @@ -56,6 +56,7 @@ REQUIRES = xpcom \ caps \ necko \ gfx \ + thebes \ layout \ content \ dom \ diff --git a/docshell/build/Makefile.in b/docshell/build/Makefile.in index bff9e639cbf..a018bc2fd6e 100644 --- a/docshell/build/Makefile.in +++ b/docshell/build/Makefile.in @@ -62,6 +62,7 @@ REQUIRES = xpcom \ necko \ nkcache \ gfx \ + thebes \ content \ layout \ webshell \ diff --git a/dom/src/base/Makefile.in b/dom/src/base/Makefile.in index 17ffabe81ca..596954a5500 100644 --- a/dom/src/base/Makefile.in +++ b/dom/src/base/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = xpcom \ js \ widget \ gfx \ + thebes \ layout \ content \ caps \ diff --git a/dom/src/offline/Makefile.in b/dom/src/offline/Makefile.in index 80732a3b38a..127e93d9f3a 100644 --- a/dom/src/offline/Makefile.in +++ b/dom/src/offline/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ content \ caps \ gfx \ + thebes \ js \ layout \ locale \ diff --git a/dom/src/storage/Makefile.in b/dom/src/storage/Makefile.in index de6100f0801..5f35765eaa1 100644 --- a/dom/src/storage/Makefile.in +++ b/dom/src/storage/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = xpcom \ content \ caps \ gfx \ + thebes \ js \ layout \ locale \ diff --git a/editor/composer/src/Makefile.in b/editor/composer/src/Makefile.in index d6beb0705e9..6202777b0fe 100644 --- a/editor/composer/src/Makefile.in +++ b/editor/composer/src/Makefile.in @@ -65,6 +65,7 @@ REQUIRES = xpcom \ webshell \ docshell \ gfx \ + thebes \ widget \ xuldoc \ txtsvc \ diff --git a/editor/libeditor/base/Makefile.in b/editor/libeditor/base/Makefile.in index 3ca776f655b..4059045e07f 100644 --- a/editor/libeditor/base/Makefile.in +++ b/editor/libeditor/base/Makefile.in @@ -59,6 +59,7 @@ REQUIRES = xpcom \ pref \ view \ gfx \ + thebes \ widget \ unicharutil \ commandhandler \ diff --git a/editor/libeditor/text/Makefile.in b/editor/libeditor/text/Makefile.in index ba6f9022d93..a15e89ecbc1 100644 --- a/editor/libeditor/text/Makefile.in +++ b/editor/libeditor/text/Makefile.in @@ -59,6 +59,7 @@ REQUIRES = xpcom \ pref \ lwbrk \ gfx \ + thebes \ widget \ unicharutil \ $(NULL) diff --git a/editor/txtsvc/src/Makefile.in b/editor/txtsvc/src/Makefile.in index 8bfbfa4f24d..a38d2d6b010 100644 --- a/editor/txtsvc/src/Makefile.in +++ b/editor/txtsvc/src/Makefile.in @@ -52,6 +52,7 @@ REQUIRES = xpcom \ string \ editor \ gfx \ + thebes \ layout \ content \ dom \ diff --git a/embedding/browser/webBrowser/Makefile.in b/embedding/browser/webBrowser/Makefile.in index e352baf9a3b..4fcdd6c8075 100644 --- a/embedding/browser/webBrowser/Makefile.in +++ b/embedding/browser/webBrowser/Makefile.in @@ -54,6 +54,7 @@ REQUIRES = xpcom \ docshell \ widget \ gfx \ + thebes \ layout \ content \ dom \ diff --git a/embedding/components/find/src/Makefile.in b/embedding/components/find/src/Makefile.in index f963b265b54..7ff8d49ac92 100644 --- a/embedding/components/find/src/Makefile.in +++ b/embedding/components/find/src/Makefile.in @@ -51,6 +51,7 @@ REQUIRES = string \ dom \ docshell \ gfx \ + thebes \ layout \ editor \ locale \ diff --git a/extensions/layout-debug/src/Makefile.in b/extensions/layout-debug/src/Makefile.in index 617b9406c34..dffb1024c8a 100644 --- a/extensions/layout-debug/src/Makefile.in +++ b/extensions/layout-debug/src/Makefile.in @@ -55,6 +55,7 @@ REQUIRES = xpcom \ docshell \ dom \ gfx \ + thebes \ content \ necko \ layout \ diff --git a/gfx/public/nsIDeviceContext.h b/gfx/public/nsIDeviceContext.h index aa0bd7ddeba..c06646bcc52 100644 --- a/gfx/public/nsIDeviceContext.h +++ b/gfx/public/nsIDeviceContext.h @@ -44,6 +44,8 @@ #include "nsRect.h" #include "nsIWidget.h" #include "nsIRenderingContext.h" +// XXX we need only gfxTypes.h, but we cannot include it directly. +#include "gfxPoint.h" class nsIView; class nsIFontMetrics; @@ -166,10 +168,10 @@ const PRUint8 kUseAltDCFor_CREATERC_PAINT = 0x04; // Use when creating Renderin const PRUint8 kUseAltDCFor_SURFACE_DIM = 0x08; // Use it for getting the Surface Dimensions #endif -// 7353cfdf-964f-4c20-8729-b11729cc0000 +// 4dd372b6-ef19-4995-a7ac-ba3efd3f656f #define NS_IDEVICE_CONTEXT_IID \ -{ 0x7353cfdf, 0x964f, 0x4c20, \ - { 0x87, 0x29, 0xb1, 0x17, 0x29, 0xcc, 0x00, 0x00 } } +{ 0x4dd372b6, 0xef19, 0x4995, \ + { 0xa7, 0xac, 0xba, 0x3e, 0xfd, 0x3f, 0x65, 0x6f } } //a cross platform way of specifying a native palette handle typedef void * nsPalette; @@ -280,12 +282,24 @@ public: */ static PRInt32 AppUnitsPerCSSPixel() { return 60; } + /** + * Convert app units to CSS pixels which is used in gfx/thebes. + */ + static gfxFloat AppUnitsToGfxCSSPixels(nscoord aAppUnits) + { return gfxFloat(aAppUnits) / AppUnitsPerCSSPixel(); } + /** * Gets the number of app units in one device pixel; this number is usually * a factor of AppUnitsPerCSSPixel(), although that is not guaranteed. */ PRInt32 AppUnitsPerDevPixel() const { return mAppUnitsPerDevPixel; } + /** + * Convert app units to device pixels which is used in gfx/thebes. + */ + gfxFloat AppUnitsToGfxUnits(nscoord aAppUnits) const + { return gfxFloat(aAppUnits) / AppUnitsPerDevPixel(); } + /** * Gets the number of app units in one inch; this is the device's DPI * times AppUnitsPerDevPixel(). diff --git a/gfx/src/Makefile.in b/gfx/src/Makefile.in index 7db0c979291..b7c904870f5 100644 --- a/gfx/src/Makefile.in +++ b/gfx/src/Makefile.in @@ -59,6 +59,7 @@ REQUIRES = xpcom \ view \ pref \ unicharutil \ + thebes \ $(NULL) DIRS = shared diff --git a/gfx/src/thebes/nsThebesFontMetrics.cpp b/gfx/src/thebes/nsThebesFontMetrics.cpp index c6ac42be5a3..880c052c70b 100644 --- a/gfx/src/thebes/nsThebesFontMetrics.cpp +++ b/gfx/src/thebes/nsThebesFontMetrics.cpp @@ -73,7 +73,7 @@ nsThebesFontMetrics::Init(const nsFont& aFont, nsIAtom* aLangGroup, mTextRunRTL = PR_FALSE; // work around layout giving us 0 sized fonts... - double size = NSAppUnitsToFloatPixels(aFont.size, mP2A); + gfxFloat size = gfxFloat(aFont.size) / mP2A; if (size == 0.0) size = 1.0; diff --git a/layout/base/nsCSSRendering.h b/layout/base/nsCSSRendering.h index 59f61d67a4f..b0631927dd3 100644 --- a/layout/base/nsCSSRendering.h +++ b/layout/base/nsCSSRendering.h @@ -201,7 +201,7 @@ public: /** * Function for painting the decoration lines for the text. - * NOTE: aPt, aLineSize, aAscent, aOffset and aReferredHeight are non-rounded + * NOTE: aPt, aLineSize, aAscent, aOffset and aPreferredHeight are non-rounded * device pixels, not app units. * input: * @param aGfxContext diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index cc1608e01af..9f6ac350100 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2141,11 +2141,10 @@ nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext, // of the image) gfxRect pxSrc; if (aSourceRect) { - PRInt32 p2a = nsIDeviceContext::AppUnitsPerCSSPixel(); - pxSrc.pos.x = NSAppUnitsToFloatPixels(aSourceRect->x, p2a); - pxSrc.pos.y = NSAppUnitsToFloatPixels(aSourceRect->y, p2a); - pxSrc.size.width = NSAppUnitsToFloatPixels(aSourceRect->width, p2a); - pxSrc.size.height = NSAppUnitsToFloatPixels(aSourceRect->height, p2a); + pxSrc.pos.x = nsIDeviceContext::AppUnitsToGfxCSSPixels(aSourceRect->x); + pxSrc.pos.y = nsIDeviceContext::AppUnitsToGfxCSSPixels(aSourceRect->y); + pxSrc.size.width = nsIDeviceContext::AppUnitsToGfxCSSPixels(aSourceRect->width); + pxSrc.size.height = nsIDeviceContext::AppUnitsToGfxCSSPixels(aSourceRect->height); } else { pxSrc.pos.x = pxSrc.pos.y = 0.0; PRInt32 w = 0, h = 0; @@ -2157,7 +2156,6 @@ nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext, nsCOMPtr dc; aRenderingContext->GetDeviceContext(*getter_AddRefs(dc)); - PRInt32 d2a = dc->AppUnitsPerDevPixel(); nsRefPtr ctx = static_cast (aRenderingContext->GetNativeGraphicData( @@ -2170,10 +2168,10 @@ nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext, // pixel, but then convert back to gfxFloats for the rest of the math. gfxRect pxDest; { - pxDest.pos.x = NSAppUnitsToFloatPixels(aDestRect.x, d2a); - pxDest.pos.y = NSAppUnitsToFloatPixels(aDestRect.y, d2a); - pxDest.size.width = NSAppUnitsToFloatPixels(aDestRect.width, d2a); - pxDest.size.height = NSAppUnitsToFloatPixels(aDestRect.height, d2a); + pxDest.pos.x = dc->AppUnitsToGfxUnits(aDestRect.x); + pxDest.pos.y = dc->AppUnitsToGfxUnits(aDestRect.y); + pxDest.size.width = dc->AppUnitsToGfxUnits(aDestRect.width); + pxDest.size.height = dc->AppUnitsToGfxUnits(aDestRect.height); if (ctx->UserToDevicePixelSnapped(pxDest)) pxDest = ctx->DeviceToUser(pxDest); } @@ -2184,10 +2182,10 @@ nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext, // been intersected with, and we should be rounding those consistently.) gfxRect pxDirty; { - pxDirty.pos.x = NSAppUnitsToFloatPixels(dirtyRect.x, d2a); - pxDirty.pos.y = NSAppUnitsToFloatPixels(dirtyRect.y, d2a); - pxDirty.size.width = NSAppUnitsToFloatPixels(dirtyRect.width, d2a); - pxDirty.size.height = NSAppUnitsToFloatPixels(dirtyRect.height, d2a); + pxDirty.pos.x = dc->AppUnitsToGfxUnits(dirtyRect.x); + pxDirty.pos.y = dc->AppUnitsToGfxUnits(dirtyRect.y); + pxDirty.size.width = dc->AppUnitsToGfxUnits(dirtyRect.width); + pxDirty.size.height = dc->AppUnitsToGfxUnits(dirtyRect.height); if (ctx->UserToDevicePixelSnapped(pxDirty)) pxDirty = ctx->DeviceToUser(pxDirty); } diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 4a011867445..66916b10ab1 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -660,10 +660,10 @@ public: /** * Draw a single image. - * @param aImage The image. * @param aRenderingContext Where to draw the image, set up with an * appropriate scale and transform for drawing in * app units (aDestRect). + * @param aImage The image. * @param aDestRect Where to draw the image (app units). * @param aDirtyRect Draw only within this region (rounded to the * nearest pixel); the intersection of diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 88639cd874b..93ec0f28969 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -61,6 +61,8 @@ #include "nsIDocument.h" #include "nsInterfaceHashtable.h" #include "nsCycleCollectionParticipant.h" +// XXX we need only gfxTypes.h, but we cannot include it directly. +#include "gfxPoint.h" class nsImageLoader; #ifdef IBMBIDI class nsBidiPresUtils; @@ -496,6 +498,9 @@ public: { return NSAppUnitsToFloatPixels(aAppUnits, nsIDeviceContext::AppUnitsPerCSSPixel()); } + static gfxFloat AppUnitsToGfxCSSPixels(nscoord aAppUnits) + { return nsIDeviceContext::AppUnitsToGfxCSSPixels(aAppUnits); } + nscoord DevPixelsToAppUnits(PRInt32 aPixels) const { return NSIntPixelsToAppUnits(aPixels, mDeviceContext->AppUnitsPerDevPixel()); } @@ -504,6 +509,9 @@ public: { return NSAppUnitsToIntPixels(aAppUnits, mDeviceContext->AppUnitsPerDevPixel()); } + gfxFloat AppUnitsToGfxUnits(nscoord aAppUnits) const + { return mDeviceContext->AppUnitsToGfxUnits(aAppUnits); } + nscoord TwipsToAppUnits(PRInt32 aTwips) const { return NSToCoordRound(NS_TWIPS_TO_INCHES(aTwips) * mDeviceContext->AppUnitsPerInch()); } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 4637f0f5728..0bda370c11a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -22,7 +22,7 @@ * * Contributor(s): * Steve Clark - * Håkan Waara + * HÃ¥kan Waara * Dan Rosen * Daniel Glazman * Mats Palmgren @@ -4771,11 +4771,10 @@ PresShell::RenderDocument(const nsRect& aRect, PRBool aUntrusted, builder.LeavePresShell(rootFrame, rect); if (NS_SUCCEEDED(rv)) { - nscoord appUnitsPerDevPixel = mPresContext->AppUnitsPerDevPixel(); // Ensure that r.x,r.y gets drawn at (0,0) aThebesContext->Save(); - aThebesContext->Translate(gfxPoint(-NSAppUnitsToFloatPixels(rect.x,appUnitsPerDevPixel), - -NSAppUnitsToFloatPixels(rect.y,appUnitsPerDevPixel))); + aThebesContext->Translate(gfxPoint(-mPresContext->AppUnitsToGfxUnits(rect.x), + -mPresContext->AppUnitsToGfxUnits(rect.y))); nsIDeviceContext* devCtx = mPresContext->DeviceContext(); nsCOMPtr rc; diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index cb2dfdcc934..b18811da676 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -5779,14 +5779,17 @@ nsBlockFrame::PaintTextDecorationLine(nsIRenderingContext& aRenderingContext, PRBool isRTL = visibility->mDirection == NS_STYLE_DIRECTION_RTL; nsRefPtr ctx = (gfxContext*) aRenderingContext.GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT); - gfxFloat a2p = 1.0 / PresContext()->AppUnitsPerDevPixel(); - gfxPoint pt((start + aPt.x) * a2p, (aLine->mBounds.y + aPt.y) * a2p); - gfxSize size(width * a2p, aSize * a2p); - nsCSSRendering::PaintDecorationLine(ctx, aColor, pt, size, - aLine->GetAscent() * a2p, aOffset * a2p, - aSize * a2p, aDecoration, - NS_STYLE_BORDER_STYLE_SOLID, - isRTL); + PRInt32 app = PresContext()->AppUnitsPerDevPixel(); + gfxPoint pt(PresContext()->AppUnitsToGfxUnits(start + aPt.x), + PresContext()->AppUnitsToGfxUnits(aLine->mBounds.y + aPt.y)); + gfxSize size(PresContext()->AppUnitsToGfxUnits(width), + PresContext()->AppUnitsToGfxUnits(aSize)); + nsCSSRendering::PaintDecorationLine( + ctx, aColor, pt, size, + PresContext()->AppUnitsToGfxUnits(aLine->GetAscent()), + PresContext()->AppUnitsToGfxUnits(aOffset), + PresContext()->AppUnitsToGfxUnits(aSize), + aDecoration, NS_STYLE_BORDER_STYLE_SOLID, isRTL); } } diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index b8897ec6c3d..fcdd49733a2 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -214,12 +214,15 @@ nsHTMLContainerFrame::PaintTextDecorationLine( nscoord innerWidth = mRect.width - bp.left - bp.right; nsRefPtr ctx = (gfxContext*) aRenderingContext.GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT); - gfxFloat a2p = 1.0 / PresContext()->AppUnitsPerDevPixel(); - gfxPoint pt((bp.left + aPt.x) * a2p, (bp.top + aPt.y) * a2p); - gfxSize size(innerWidth * a2p, aSize * a2p); - nsCSSRendering::PaintDecorationLine(ctx, aColor, pt, size, aAscent * a2p, - aOffset * a2p, aSize * a2p, aDecoration, - NS_STYLE_BORDER_STYLE_SOLID, isRTL); + gfxPoint pt(PresContext()->AppUnitsToGfxUnits(bp.left + aPt.x), + PresContext()->AppUnitsToGfxUnits(bp.top + aPt.y)); + gfxSize size(PresContext()->AppUnitsToGfxUnits(innerWidth), + PresContext()->AppUnitsToGfxUnits(aSize)); + nsCSSRendering::PaintDecorationLine( + ctx, aColor, pt, size, PresContext()->AppUnitsToGfxUnits(aAscent), + PresContext()->AppUnitsToGfxUnits(aOffset), + PresContext()->AppUnitsToGfxUnits(aSize), + aDecoration, NS_STYLE_BORDER_STYLE_SOLID, isRTL); } void diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 4a34f8e1ec9..16076084661 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -560,7 +560,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, fm->GetMaxAscent(aMetrics.ascent); fm->GetHeight(aMetrics.height); // Include the text-decoration lines to the height. - // Currently, only undeline is overflowable. + // Currently, only underline is overflowable. nscoord offset, size; fm->GetUnderline(offset, size); nscoord ascentAndUnderline = diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 729153a3578..3381ced583d 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -3716,10 +3716,11 @@ FillClippedRect(gfxContext* aCtx, nsPresContext* aPresContext, { gfxRect r = aRect.Intersect(aDirtyRect); // For now, we need to put this in pixel coordinates - float t2p = 1.0f / aPresContext->AppUnitsPerDevPixel(); + PRInt32 app = aPresContext->AppUnitsPerDevPixel(); aCtx->NewPath(); // pixel-snap - aCtx->Rectangle(gfxRect(r.X()*t2p, r.Y()*t2p, r.Width()*t2p, r.Height()*t2p), PR_TRUE); + aCtx->Rectangle(gfxRect(r.X() / app, r.Y() / app, + r.Width() / app, r.Height() / app), PR_TRUE); aCtx->SetColor(gfxRGBA(aColor)); aCtx->Fill(); } @@ -3790,12 +3791,12 @@ nsTextFrame::PaintTextDecorations(gfxContext* aCtx, const gfxRect& aDirtyRect, return; gfxFont::Metrics fontMetrics = GetFontMetrics(aProvider.GetFontGroup()); - gfxFloat a2p = 1.0 / aTextPaintStyle.PresContext()->AppUnitsPerDevPixel(); + PRInt32 app = aTextPaintStyle.PresContext()->AppUnitsPerDevPixel(); // XXX aFramePt is in AppUnits, shouldn't it be nsFloatPoint? - gfxPoint pt(aFramePt.x * a2p, aFramePt.y * a2p); - gfxSize size(GetRect().width * a2p, 0); - gfxFloat ascent = mAscent * a2p; + gfxPoint pt(aFramePt.x / app, aFramePt.y / app); + gfxSize size(GetRect().width / app, 0); + gfxFloat ascent = mAscent / app; if (decorations & NS_FONT_DECORATION_OVERLINE) { size.height = fontMetrics.underlineSize; @@ -4174,13 +4175,13 @@ nsTextFrame::PaintTextSelectionDecorations(gfxContext* aCtx, gfxFloat advance = hyphenWidth + mTextRun->GetAdvanceWidth(offset, length, &aProvider); if (type == aSelectionType) { - gfxFloat a2p = 1.0 / aTextPaintStyle.PresContext()->AppUnitsPerDevPixel(); + PRInt32 app = aTextPaintStyle.PresContext()->AppUnitsPerDevPixel(); // XXX aTextBaselinePt is in AppUnits, shouldn't it be nsFloatPoint? - gfxPoint pt((aTextBaselinePt.x + xOffset) * a2p, - (aTextBaselinePt.y - mAscent) * a2p); - gfxFloat width = PR_ABS(advance) * a2p; + gfxPoint pt((aTextBaselinePt.x + xOffset) / app, + (aTextBaselinePt.y - mAscent) / app); + gfxFloat width = PR_ABS(advance) / app; DrawSelectionDecorations(aCtx, aSelectionType, aTextPaintStyle, - pt, width, mAscent * a2p, decorationMetrics, + pt, width, mAscent / app, decorationMetrics, mTextRun->IsRightToLeft()); } iterator.UpdateWithAdvance(advance); diff --git a/layout/inspector/src/Makefile.in b/layout/inspector/src/Makefile.in index 335b011883b..0d0bf613883 100644 --- a/layout/inspector/src/Makefile.in +++ b/layout/inspector/src/Makefile.in @@ -50,6 +50,7 @@ REQUIRES = xpcom \ string \ dom \ gfx \ + thebes \ layout \ content \ widget \ diff --git a/layout/printing/Makefile.in b/layout/printing/Makefile.in index 8d53c445954..da2b6f5964b 100644 --- a/layout/printing/Makefile.in +++ b/layout/printing/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = xpcom \ dom \ widget \ gfx \ + thebes \ view \ necko \ webshell \ diff --git a/layout/style/Makefile.in b/layout/style/Makefile.in index 1ef5f0d9886..264678fb557 100644 --- a/layout/style/Makefile.in +++ b/layout/style/Makefile.in @@ -56,6 +56,7 @@ REQUIRES = xpcom \ dom \ content \ gfx \ + thebes \ widget \ caps \ locale \ diff --git a/layout/xul/base/src/nsTextBoxFrame.cpp b/layout/xul/base/src/nsTextBoxFrame.cpp index ef037080b7f..eb35e04e094 100644 --- a/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/layout/xul/base/src/nsTextBoxFrame.cpp @@ -452,14 +452,14 @@ nsTextBoxFrame::PaintTitle(nsIRenderingContext& aRenderingContext, nsRefPtr ctx = (gfxContext*) aRenderingContext.GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT); - gfxFloat a2p = 1.0 / presContext->AppUnitsPerDevPixel(); - gfxPoint pt(textRect.x * a2p, textRect.y * a2p); - gfxFloat width = textRect.width * a2p; - gfxFloat baselinePixel = baseline * a2p; + gfxPoint pt(presContext->AppUnitsToGfxUnits(textRect.x), + presContext->AppUnitsToGfxUnits(textRect.y)); + gfxFloat width = presContext->AppUnitsToGfxUnits(textRect.width); + gfxFloat baselinePixel = presContext->AppUnitsToGfxUnits(baseline); if (decorations & (NS_FONT_DECORATION_OVERLINE | NS_FONT_DECORATION_UNDERLINE)) { fontMet->GetUnderline(offset, size); - gfxFloat offsetPixel = offset * a2p; - gfxFloat sizePixel = size * a2p; + gfxFloat offsetPixel = presContext->AppUnitsToGfxUnits(offset); + gfxFloat sizePixel = presContext->AppUnitsToGfxUnits(size); if (decorations & NS_FONT_DECORATION_OVERLINE) { nsCSSRendering::PaintDecorationLine(ctx, overColor, pt, gfxSize(width, sizePixel), @@ -481,8 +481,8 @@ nsTextBoxFrame::PaintTitle(nsIRenderingContext& aRenderingContext, } if (decorations & NS_FONT_DECORATION_LINE_THROUGH) { fontMet->GetStrikeout(offset, size); - gfxFloat offsetPixel = offset * a2p; - gfxFloat sizePixel = size * a2p; + gfxFloat offsetPixel = presContext->AppUnitsToGfxUnits(offset); + gfxFloat sizePixel = presContext->AppUnitsToGfxUnits(size); nsCSSRendering::PaintDecorationLine(ctx, underColor, pt, gfxSize(width, sizePixel), baselinePixel, offsetPixel, diff --git a/modules/oji/src/Makefile.in b/modules/oji/src/Makefile.in index 73e099404e5..777719429c6 100644 --- a/modules/oji/src/Makefile.in +++ b/modules/oji/src/Makefile.in @@ -64,6 +64,7 @@ REQUIRES = xpcom \ xpconnect \ windowwatcher \ gfx \ + thebes \ content \ layout \ docshell \ diff --git a/modules/plugin/base/src/Makefile.in b/modules/plugin/base/src/Makefile.in index 87bcef02f92..e49cbd58422 100644 --- a/modules/plugin/base/src/Makefile.in +++ b/modules/plugin/base/src/Makefile.in @@ -66,6 +66,7 @@ REQUIRES = xpcom \ unicharutil \ dom \ gfx \ + thebes \ content \ widget \ mimetype \ diff --git a/toolkit/components/autocomplete/src/Makefile.in b/toolkit/components/autocomplete/src/Makefile.in index 10a6d5f20ed..d293b592e38 100644 --- a/toolkit/components/autocomplete/src/Makefile.in +++ b/toolkit/components/autocomplete/src/Makefile.in @@ -61,6 +61,7 @@ REQUIRES = xpcom \ content \ view \ gfx \ + thebes \ locale \ necko \ $(NULL) diff --git a/toolkit/components/build/Makefile.in b/toolkit/components/build/Makefile.in index dc8e297a444..470c81e05b8 100644 --- a/toolkit/components/build/Makefile.in +++ b/toolkit/components/build/Makefile.in @@ -81,6 +81,7 @@ REQUIRES = \ content \ find \ gfx \ + thebes \ locale \ unicharutil \ xuldoc \ diff --git a/toolkit/components/satchel/src/Makefile.in b/toolkit/components/satchel/src/Makefile.in index 061f5351895..e8126d24c77 100644 --- a/toolkit/components/satchel/src/Makefile.in +++ b/toolkit/components/satchel/src/Makefile.in @@ -59,6 +59,7 @@ REQUIRES = \ layout \ docshell \ gfx \ + thebes \ necko \ widget \ content \ diff --git a/toolkit/components/typeaheadfind/src/Makefile.in b/toolkit/components/typeaheadfind/src/Makefile.in index 9bead7eb5c0..ab58e542d3a 100755 --- a/toolkit/components/typeaheadfind/src/Makefile.in +++ b/toolkit/components/typeaheadfind/src/Makefile.in @@ -55,6 +55,7 @@ REQUIRES = content \ editor \ find \ gfx \ + thebes \ layout \ locale \ necko \ diff --git a/uriloader/base/Makefile.in b/uriloader/base/Makefile.in index 960d49f3d0b..6e1af89a290 100644 --- a/uriloader/base/Makefile.in +++ b/uriloader/base/Makefile.in @@ -55,6 +55,7 @@ REQUIRES = xpcom \ js \ docshell \ gfx \ + thebes \ layout \ content \ widget \ diff --git a/xpfe/appshell/src/Makefile.in b/xpfe/appshell/src/Makefile.in index 107ee1d4aec..65b6f346e72 100644 --- a/xpfe/appshell/src/Makefile.in +++ b/xpfe/appshell/src/Makefile.in @@ -59,6 +59,7 @@ REQUIRES = xpcom \ docshell \ webshell \ gfx \ + thebes \ layout \ content \ dom \ diff --git a/xpfe/components/winhooks/Makefile.in b/xpfe/components/winhooks/Makefile.in index e465d244b7c..fce2de10893 100644 --- a/xpfe/components/winhooks/Makefile.in +++ b/xpfe/components/winhooks/Makefile.in @@ -64,6 +64,7 @@ REQUIRES = \ widget \ imglib2 \ gfx \ + thebes \ locale \ xulapp \ embed_base \