Bug 1099335: Base decision to use a complex clip on whether a DT supports regoin clipping. r=jrmuizel

DrawTargets that support region clipping are able to clip to regions effectively. Other DrawTargets go through expensive complex clip paths. When invalidating regions we have code that draws in multiple steps when using Direct2D to avoid this expense, we should base the decision to do this simply on whether the DrawTarget supports fast region clipping.
This commit is contained in:
Bas Schouten 2014-11-16 19:17:40 +00:00
parent 709421a42d
commit d4181f7c5f
4 changed files with 6 additions and 1 deletions

View File

@ -1003,6 +1003,7 @@ public:
virtual bool IsDualDrawTarget() const { return false; }
virtual bool IsTiledDrawTarget() const { return false; }
virtual bool SupportsRegionClipping() const { return true; }
void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void*)) {
mUserData.Add(key, userData, destroy);

View File

@ -131,6 +131,8 @@ public:
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType);
virtual bool SupportsRegionClipping() const { return false; }
virtual void *GetNativeSurface(NativeSurfaceType aType);
bool Init(const IntSize &aSize, SurfaceFormat aFormat);

View File

@ -122,6 +122,8 @@ public:
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType);
virtual bool SupportsRegionClipping() const { return false; }
virtual void *GetNativeSurface(NativeSurfaceType aType) { return nullptr; }
bool Init(const IntSize &aSize, SurfaceFormat aFormat);

View File

@ -4407,7 +4407,7 @@ static bool ShouldDrawRectsSeparately(gfxContext* aContext, DrawRegionClip aClip
}
DrawTarget *dt = aContext->GetDrawTarget();
return dt->GetBackendType() == BackendType::DIRECT2D;
return !dt->SupportsRegionClipping();
}
static void DrawForcedBackgroundColor(gfxContext* aContext, Layer* aLayer, nscolor aBackgroundColor)