Bug 907011 - Add support for Azure in ThebesLayerD3D9. r=Bas

This commit is contained in:
Matt Woodrow 2013-08-23 16:51:27 +12:00
parent d6b9b9b872
commit 65fcce9289

View File

@ -19,10 +19,13 @@
#include "gfxUtils.h"
#include "ReadbackProcessor.h"
#include "ReadbackLayer.h"
#include "mozilla/gfx/2D.h"
namespace mozilla {
namespace layers {
using namespace gfx;
ThebesLayerD3D9::ThebesLayerD3D9(LayerManagerD3D9 *aManager)
: ThebesLayer(aManager, nullptr)
, LayerD3D9(aManager)
@ -468,7 +471,18 @@ ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
if (!destinationSurface)
return;
nsRefPtr<gfxContext> context = new gfxContext(destinationSurface);
nsRefPtr<gfxContext> context;
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_CAIRO)) {
RefPtr<DrawTarget> dt =
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(destinationSurface,
IntSize(destinationSurface->GetSize().width,
destinationSurface->GetSize().height));
context = new gfxContext(dt);
} else {
context = new gfxContext(destinationSurface);
}
context->Translate(gfxPoint(-bounds.x, -bounds.y));
LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
cbInfo.Callback(this, context, aRegion, nsIntRegion(), cbInfo.CallbackData);