зеркало из https://github.com/mozilla/gecko-dev.git
Bug 477708 - backout previous numRects, getRect attempt r=vlad
This commit is contained in:
Родитель
692340119f
Коммит
adb0472423
|
@ -46,7 +46,7 @@ class nsIRegion;
|
|||
[ptr] native nsIRegion(nsIRegion);
|
||||
|
||||
|
||||
[scriptable, uuid(dbd0e356-09f5-40b1-99a7-5629c1a45f06)]
|
||||
[scriptable, uuid(82d8f400-5bde-11d3-b033-b27a62766bbc)]
|
||||
interface nsIScriptableRegion : nsISupports
|
||||
{
|
||||
void init ( ) ;
|
||||
|
@ -196,24 +196,6 @@ interface nsIScriptableRegion : nsISupports
|
|||
**/
|
||||
|
||||
boolean containsRect ( in long aX, in long aY, in long aWidth, in long aHeight ) ;
|
||||
|
||||
/**
|
||||
* returns a rectangle within the region
|
||||
*
|
||||
* @param aIndex index of the rect to retrieve
|
||||
* @param aX out parameter for xoffset of bounding rect for region
|
||||
* @param aY out parameter for yoffset of bounding rect for region
|
||||
* @param aWidth out parameter for width of bounding rect for region
|
||||
* @param aHeight out parameter for height of bounding rect for region
|
||||
* @return void
|
||||
*
|
||||
**/
|
||||
void getRect ( in unsigned long aIndex, out long aX, out long aY, out long aWidth, out long aHeight ) ;
|
||||
|
||||
/**
|
||||
* The number of rectangles that can be retrieved via getRect
|
||||
*/
|
||||
readonly attribute unsigned long numRects;
|
||||
|
||||
[noscript] readonly attribute nsIRegion region;
|
||||
|
||||
|
|
|
@ -38,9 +38,10 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsScriptableRegion.h"
|
||||
#include "nsIRegion.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsScriptableRegion::nsScriptableRegion(nsIRegion* region) : mRegion(nsnull), mRectSet(nsnull)
|
||||
nsScriptableRegion::nsScriptableRegion(nsIRegion* region) : mRegion(nsnull)
|
||||
{
|
||||
mRegion = region;
|
||||
NS_IF_ADDREF(mRegion);
|
||||
|
@ -48,10 +49,7 @@ nsScriptableRegion::nsScriptableRegion(nsIRegion* region) : mRegion(nsnull), mRe
|
|||
|
||||
nsScriptableRegion::~nsScriptableRegion()
|
||||
{
|
||||
if (mRegion) {
|
||||
mRegion->FreeRects(mRectSet);
|
||||
NS_RELEASE(mRegion);
|
||||
}
|
||||
NS_IF_RELEASE(mRegion);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsScriptableRegion, nsIScriptableRegion)
|
||||
|
@ -151,20 +149,3 @@ NS_IMETHODIMP nsScriptableRegion::GetRegion(nsIRegion** outRgn)
|
|||
NS_IF_ADDREF(*outRgn);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScriptableRegion::GetRect(PRUint32 aIndex, PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight) {
|
||||
// nsIRegion reuses the GetRects parameter between calls
|
||||
nsresult rv = mRegion->GetRects(&mRectSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(aIndex < mRectSet->mNumRects, NS_ERROR_INVALID_ARG);
|
||||
nsRegionRect &rect = mRectSet->mRects[aIndex];
|
||||
*aX = rect.x;
|
||||
*aY = rect.y;
|
||||
*aWidth = rect.width;
|
||||
*aHeight = rect.height;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScriptableRegion::GetNumRects(PRUint32 *aLength) {
|
||||
return mRegion->GetNumRects(aLength);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
#include "nsIScriptableRegion.h"
|
||||
#include "gfxCore.h"
|
||||
#include "nsIRegion.h"
|
||||
|
||||
class nsIRegion;
|
||||
|
||||
|
@ -56,6 +55,5 @@ public:
|
|||
NS_DECL_NSISCRIPTABLEREGION
|
||||
|
||||
private:
|
||||
nsIRegion* mRegion;
|
||||
nsRegionRectSet *mRectSet;
|
||||
nsIRegion* mRegion;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче