Bug 942672. When a gfxContext has a DrawTarget there's an extra device transform that we need to take account of here. r=mattwoodrow

--HG--
extra : rebase_source : 0b4c182ea6b1934b3136623539e4b8482de1481f
This commit is contained in:
Robert O'Callahan 2013-12-02 10:10:50 +13:00
Родитель 2a77718239
Коммит 3f4000a94e
4 изменённых файлов: 18 добавлений и 1 удалений

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

@ -531,10 +531,14 @@ gfxXlibNativeRenderer::Draw(gfxContext* ctx, nsIntSize size,
DrawingMethod method;
cairo_surface_t* cairoTarget = nullptr;
DrawTarget* drawTarget = nullptr;
gfxPoint deviceTranslation;
if (ctx->IsCairo()) {
cairoTarget = cairo_get_group_target(ctx->GetCairo());
deviceTranslation = ctx->CurrentMatrix().GetTranslation();
} else {
drawTarget = ctx->GetDrawTarget();
Matrix dtTransform = drawTarget->GetTransform();
deviceTranslation = gfxPoint(dtTransform._31, dtTransform._32);
cairoTarget = static_cast<cairo_surface_t*>
(drawTarget->GetNativeSurface(NATIVE_SURFACE_CAIRO_SURFACE));
}
@ -552,7 +556,7 @@ gfxXlibNativeRenderer::Draw(gfxContext* ctx, nsIntSize size,
if (method == eCopyBackground) {
NS_ASSERTION(cairoTarget, "eCopyBackground only used when there's a cairoTarget");
cairo_set_operator(tmpCtx, CAIRO_OPERATOR_SOURCE);
gfxPoint pt = -(offset + ctx->CurrentMatrix().GetTranslation());
gfxPoint pt = -(offset + deviceTranslation);
cairo_set_source_surface(tmpCtx, cairoTarget, pt.x, pt.y);
// The copy from the tempXlibSurface to the target context should
// use operator SOURCE, but that would need a mask to bound the

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

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<html>
<body style="background:white">
<div style="opacity:0.5; background:white; height:200px;"><button>Hello</button></div>
</body>
</html>

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

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<html>
<body style="background:white">
<div style="opacity:0.5; height:200px;"><button>Hello</button></div>
</body>
</html>

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

@ -1785,3 +1785,4 @@ fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
== 931853-quirks.html 931853-quirks-ref.html
== 936670-1.svg 936670-1-ref.svg
== 941940-1.html 941940-1-ref.html
== 942672-1.html 942672-1-ref.html