b=782185 use extend_pad when compositing image layers even for Quartz and X11 r=roc

--HG--
extra : transplant_source : %F7%24N%7E%E0y%C4%2C%D4%9B%DB%83B_Ai6%A1%7E%91
This commit is contained in:
Karl Tomlinson 2012-08-14 23:47:49 +12:00
parent fc12fcc075
commit 10083eff12
2 changed files with 10 additions and 7 deletions

View File

@ -24,4 +24,4 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) =
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-5-step.html plugin-background-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-10-step.html plugin-background-ref.html
random-if(!haveTestPlugin) == plugin-transform-1.html plugin-transform-1-ref.html
fails-if(!haveTestPlugin) fails-if(http.platform=="X11"&&!layersGPUAccelerated) == plugin-transform-2.html plugin-transform-2-ref.html # bug 468496
fails-if(!haveTestPlugin) == plugin-transform-2.html plugin-transform-2-ref.html

View File

@ -9,6 +9,9 @@
#include "gfxUtils.h"
#include "gfxSharedImageSurface.h"
#include "mozilla/layers/ImageContainerChild.h"
#ifdef MOZ_X11
#include "gfxXlibSurface.h"
#endif
using namespace mozilla::gfx;
@ -130,17 +133,17 @@ BasicImageLayer::PaintContext(gfxPattern* aPattern,
// outside the bounds of the video image.
gfxPattern::GraphicsExtend extend = gfxPattern::EXTEND_PAD;
#ifdef MOZ_X11
// PAD is slow with cairo and old X11 servers, so prefer speed over
// correctness and use NONE.
if (aContext->IsCairo()) {
// PAD is slow with X11 and Quartz surfaces, so prefer speed over correctness
// and use NONE.
nsRefPtr<gfxASurface> target = aContext->CurrentSurface();
gfxASurface::gfxSurfaceType type = target->GetType();
if (type == gfxASurface::SurfaceTypeXlib ||
type == gfxASurface::SurfaceTypeXcb ||
type == gfxASurface::SurfaceTypeQuartz) {
if (target->GetType() == gfxASurface::SurfaceTypeXlib &&
static_cast<gfxXlibSurface*>(target.get())->IsPadSlow()) {
extend = gfxPattern::EXTEND_NONE;
}
}
#endif
aContext->NewPath();
// No need to snap here; our transform has already taken care of it.