Ticket #3790: Bug-722975-Make-system-cairo-work-again.patch

File Bug-722975-Make-system-cairo-work-again.patch, 1.6 KB (added by ken@…, 12 years ago)
  • TabularUnified gfx/thebes/gfxPlatform.cpp

    From: Uli Schlachter <psychon@znc.in>
    Date: Thu, 17 May 2012 10:51:11 +0200
    Subject: Bug 722975 - Make system cairo work again
    
    ---
     gfx/thebes/gfxPlatform.cpp |   16 ++++------------
     1 file changed, 4 insertions(+), 12 deletions(-)
    
    diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
    index de598fe..f9c21a3 100644
    a b void SourceBufferDestroy(void *srcSurfUD)  
    507507  delete static_cast<SourceSurfaceUserData*>(srcSurfUD);
    508508}
    509509
    510 void SourceSnapshotDetached(cairo_surface_t *nullSurf)
     510void SourceSnapshotDetached(void *nullSurf)
    511511{
    512   gfxImageSurface* origSurf =
    513     static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface));
    514 
     512  gfxImageSurface *origSurf = static_cast<gfxImageSurface*>(nullSurf);
    515513  origSurf->SetData(&kSourceSurface, NULL, NULL);
    516514}
    517515
    gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa  
    626624
    627625    }
    628626
    629     cairo_surface_t *nullSurf =
    630         cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
    631     cairo_surface_set_user_data(nullSurf,
    632                                 &kSourceSurface,
    633                                 imgSurface,
    634                                 NULL);
    635     cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached);
    636     cairo_surface_destroy(nullSurf);
     627    cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic",
     628                (const unsigned char *) "data", 4, SourceSnapshotDetached, imgSurface.get());
    637629  }
    638630
    639631  SourceSurfaceUserData *srcSurfUD = new SourceSurfaceUserData;