Back out d77773a8abf9 and eca6b3ea3e8d (bug 853169) for Linux xpcshell crashes

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2013-03-20 21:33:03 -07:00
parent b511c8003f
commit 02042aac36
5 changed files with 4 additions and 44 deletions

View File

@ -40,12 +40,6 @@ sale, use or other dealings in this Software without written
authorization from SunSoft Inc.
******************************************************************/
/*
* QCMS, in general, is not threadsafe. However, it should be safe to create
* profile and transformation objects on different threads, so long as you
* don't use the same objects on different threads at the same time.
*/
/*
* Color Space Signatures
* Note that only icSigXYZData and icSigLabData are valid

View File

@ -284,24 +284,6 @@ void qcms_transform_data_rgba_out_lut_altivec(qcms_transform *transform,
extern qcms_bool qcms_supports_iccv4;
#ifdef _MSC_VER
long __cdecl _InterlockedIncrement(long volatile *);
long __cdecl _InterlockedDecrement(long volatile *);
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)
#define qcms_atomic_increment(x) _InterlockedIncrement((long volatile *)&x)
#define qcms_atomic_decrement(x) _InterlockedDecrement((long volatile*)&x)
#else
#define qcms_atomic_increment(x) __sync_add_and_fetch(&x, 1)
#define qcms_atomic_decrement(x) __sync_sub_and_fetch(&x, 1)
#endif
#ifdef NATIVE_OUTPUT
# define RGB_OUTPUT_COMPONENTS 4
# define RGBA_OUTPUT_COMPONENTS 4

View File

@ -886,17 +886,9 @@ static void qcms_transform_data_rgb_out_linear(qcms_transform *transform, unsign
}
#endif
/*
* If users create and destroy objects on different threads, even if the same
* objects aren't used on different threads at the same time, we can still run
* in to trouble with refcounts if they aren't atomic.
*
* This can lead to us prematurely deleting the precache if threads get unlucky
* and write the wrong value to the ref count.
*/
static struct precache_output *precache_reference(struct precache_output *p)
{
qcms_atomic_increment(p->ref_count);
p->ref_count++;
return p;
}
@ -910,7 +902,7 @@ static struct precache_output *precache_create()
void precache_release(struct precache_output *p)
{
if (qcms_atomic_decrement(p->ref_count) == 0) {
if (--p->ref_count == 0) {
free(p);
}
}

View File

@ -384,8 +384,6 @@ gfxPlatform::Init()
}
gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
CreateCMSOutputProfile();
}
void
@ -1430,8 +1428,8 @@ gfxPlatform::GetPlatformCMSOutputProfile()
return nullptr;
}
void
gfxPlatform::CreateCMSOutputProfile()
qcms_profile *
gfxPlatform::GetCMSOutputProfile()
{
if (!gCMSOutputProfile) {
/* Determine if we're using the internal override to force sRGB as
@ -1473,11 +1471,7 @@ gfxPlatform::CreateCMSOutputProfile()
bug 444661 for details. */
qcms_profile_precache_output_transform(gCMSOutputProfile);
}
}
qcms_profile *
gfxPlatform::GetCMSOutputProfile()
{
return gCMSOutputProfile;
}

View File

@ -592,8 +592,6 @@ private:
*/
static void Init();
static void CreateCMSOutputProfile();
virtual qcms_profile* GetPlatformCMSOutputProfile();
nsRefPtr<gfxASurface> mScreenReferenceSurface;