diff --git a/mozilla/gfx/src/gtk/nsGCCache.cpp b/mozilla/gfx/src/gtk/nsGCCache.cpp index 4889a703422..4462eba093e 100644 --- a/mozilla/gfx/src/gtk/nsGCCache.cpp +++ b/mozilla/gfx/src/gtk/nsGCCache.cpp @@ -135,13 +135,4 @@ GdkGC *nsGCCache::GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMa } } -GdkGC *nsGCCache::GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion) -{ - return GetGCFromDW(window, gcv, flags, clipRegion); -} - -GdkGC *nsGCCache::GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags) -{ - return GetGCFromDW(window, gcv, flags, NULL); -} diff --git a/mozilla/gfx/src/gtk/nsGCCache.h b/mozilla/gfx/src/gtk/nsGCCache.h index 96ea5b52187..08aea8e76b8 100644 --- a/mozilla/gfx/src/gtk/nsGCCache.h +++ b/mozilla/gfx/src/gtk/nsGCCache.h @@ -24,6 +24,9 @@ #include #include +#ifndef nsGCCache_h___ +#define nsGCCache_h___ + #define countof(x) (sizeof(x) / sizeof (*x)) struct GCData @@ -40,13 +43,18 @@ class nsGCCache nsGCCache(); virtual ~nsGCCache(); - void Flush(unsigned long flags); GdkGC *GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion); - GdkGC *GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion); + GdkGC *GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion) { + return GetGCFromDW(window, gcv, flags, clipRegion); + } - GdkGC *GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags); + GdkGC *GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags) { + return GetGCFromDW(window, gcv, flags, NULL); + } }; + +#endif diff --git a/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp b/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp index 2e63a7b68d2..8eb3b35f1b4 100644 --- a/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp +++ b/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp @@ -488,12 +488,6 @@ NS_IMETHODIMP nsRenderingContextGTK::SetClipRect(const nsRect& aRect, return NS_OK; } - -GdkGC *nsRenderingContextGTK::GetGC() -{ - return mGC; -} - void nsRenderingContextGTK::UpdateGC() { GdkGCValues values; @@ -1892,24 +1886,3 @@ nsRenderingContextGTK::GetBoundingMetrics(const PRUnichar* aString, } #endif /* FONT_SWITCHING */ #endif /* MOZ_MATHML */ - -NS_IMETHODIMP nsRenderingContextGTK::ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h ) -{ - if ( y < -32766 ) { - y = -32766; - } - - if ( y + h > 32766 ) { - h = 32766 - y; - } - - if ( x < -32766 ) { - x = -32766; - } - - if ( x + w > 32766 ) { - w = 32766 - x; - } - - return NS_OK; -} diff --git a/mozilla/gfx/src/gtk/nsRenderingContextGTK.h b/mozilla/gfx/src/gtk/nsRenderingContextGTK.h index bfe1796152e..b498b69a50d 100644 --- a/mozilla/gfx/src/gtk/nsRenderingContextGTK.h +++ b/mozilla/gfx/src/gtk/nsRenderingContextGTK.h @@ -163,7 +163,7 @@ public: const nsRect &aDestBounds, PRUint32 aCopyFlags); NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd); - GdkGC *GetGC(); + GdkGC *GetGC() { return mGC; } #ifdef MOZ_MATHML /** @@ -215,7 +215,23 @@ private: void UpdateGC(); // ConditionRect is used to fix coordinate overflow problems for // rectangles after they are transformed to screen coordinates - NS_IMETHOD ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h ); + void ConditionRect(nscoord &x, nscoord &y, nscoord &w, nscoord &h) { + if ( y < -32766 ) { + y = -32766; + } + + if ( y + h > 32766 ) { + h = 32766 - y; + } + + if ( x < -32766 ) { + x = -32766; + } + + if ( x + w > 32766 ) { + w = 32766 - x; + } + } }; #endif /* nsRenderingContextGTK_h___ */