author | Matt Woodrow <mwoodrow@mozilla.com> |
Wed, 16 Oct 2013 14:00:30 +1300 | |
changeset 150854 | 95427fe5f9b95b68cc7031c68d8e0dbd87592e5c |
parent 150853 | 32bb598c8a821eafa85cf27e91812dc54e8bd2fc |
child 150855 | c0e5db20b6556eed713a25e9ccd93489e5eb71ed |
push id | 25469 |
push user | cbook@mozilla.com |
push date | Wed, 16 Oct 2013 10:46:01 +0000 |
treeherder | autoland@afae5911a1e0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | seth |
bugs | 922942 |
milestone | 27.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/image/src/ClippedImage.cpp +++ b/image/src/ClippedImage.cpp @@ -230,30 +230,39 @@ ClippedImage::GetFrameInternal(const nsI float frameToDraw = InnerImage()->GetFrameIndex(aWhichFrame); if (!mCachedSurface || !mCachedSurface->Matches(aViewportSize, aSVGContext, frameToDraw, aFlags)) { // Create a surface to draw into. mozilla::RefPtr<mozilla::gfx::DrawTarget> target; - target = gfxPlatform::GetPlatform()-> - CreateOffscreenCanvasDrawTarget(gfx::IntSize(mClip.width, mClip.height), - gfx::FORMAT_B8G8R8A8); - nsRefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()-> - GetThebesSurfaceForDrawTarget(target); + nsRefPtr<gfxContext> ctx; + + if (gfxPlatform::GetPlatform()->SupportsAzureContent()) { + target = gfxPlatform::GetPlatform()-> + CreateOffscreenContentDrawTarget(gfx::IntSize(mClip.width, mClip.height), + gfx::FORMAT_B8G8R8A8); + ctx = new gfxContext(target); + } else { + target = gfxPlatform::GetPlatform()-> + CreateOffscreenCanvasDrawTarget(gfx::IntSize(mClip.width, mClip.height), + gfx::FORMAT_B8G8R8A8); + nsRefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()-> + GetThebesSurfaceForDrawTarget(target); + ctx = new gfxContext(surface); + } // Create our callback. nsRefPtr<gfxDrawingCallback> drawTileCallback = new DrawSingleTileCallback(this, mClip, aViewportSize, aSVGContext, aWhichFrame, aFlags); nsRefPtr<gfxDrawable> drawable = new gfxCallbackDrawable(drawTileCallback, mClip.Size()); // Actually draw. The callback will end up invoking DrawSingleTile. - nsRefPtr<gfxContext> ctx = new gfxContext(surface); gfxRect imageRect(0, 0, mClip.width, mClip.height); gfxUtils::DrawPixelSnapped(ctx, drawable, gfxMatrix(), imageRect, imageRect, imageRect, imageRect, gfxImageFormatARGB32, GraphicsFilter::FILTER_FAST); // Cache the resulting surface. mCachedSurface = new ClippedImageCachedSurface(target,