Backout 6c89d2b6ea4b (bug 793175) on suspicion of somehow causing Win7 opt permaorange in browser_updatessl.js and friends

This commit is contained in:
Ed Morley 2012-10-08 10:34:12 +01:00
Родитель 6d04357320
Коммит b23ad3f4c9
1 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -489,22 +489,9 @@ gfxPlatform::CreateDrawTargetForSurface(gfxASurface *aSurface, const IntSize& aS
cairo_user_data_key_t kSourceSurface; cairo_user_data_key_t kSourceSurface;
/** void SourceBufferDestroy(void *srcBuffer)
* Record the backend that was used to construct the SourceSurface.
* When getting the cached SourceSurface for a gfxASurface/DrawTarget pair,
* we check to make sure the DrawTarget's backend matches the backend
* for the cached SourceSurface, and only use it if they match. This
* can avoid expensive and unnecessary readbacks.
*/
struct SourceSurfaceUserData
{ {
RefPtr<SourceSurface> mSrcSurface; static_cast<SourceSurface*>(srcBuffer)->Release();
BackendType mBackendType;
};
void SourceBufferDestroy(void *srcSurfUD)
{
delete static_cast<SourceSurfaceUserData*>(srcSurfUD);
} }
void SourceSnapshotDetached(cairo_surface_t *nullSurf) void SourceSnapshotDetached(cairo_surface_t *nullSurf)
@ -521,10 +508,10 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
void *userData = aSurface->GetData(&kSourceSurface); void *userData = aSurface->GetData(&kSourceSurface);
if (userData) { if (userData) {
SourceSurfaceUserData *surf = static_cast<SourceSurfaceUserData*>(userData); SourceSurface *surf = static_cast<SourceSurface*>(userData);
if (surf->mSrcSurface->IsValid() && surf->mBackendType == aTarget->GetType()) { if (surf->IsValid()) {
return surf->mSrcSurface; return surf;
} }
// We can just continue here as when setting new user data the destroy // We can just continue here as when setting new user data the destroy
// function will be called for the old user data. // function will be called for the old user data.
@ -637,11 +624,7 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
} }
srcBuffer->AddRef(); srcBuffer->AddRef();
aSurface->SetData(&kSourceSurface, srcBuffer, SourceBufferDestroy);
SourceSurfaceUserData *srcSurfUD = new SourceSurfaceUserData;
srcSurfUD->mBackendType = aTarget->GetType();
srcSurfUD->mSrcSurface = srcBuffer;
aSurface->SetData(&kSourceSurface, srcSurfUD, SourceBufferDestroy);
return srcBuffer; return srcBuffer;
} }