Open Bug 933577 Opened 11 years ago Updated 2 years ago

Optimize DrawTargetSkia::MaskSurface

Categories

(Core :: Graphics, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: gal, Unassigned)

References

Details

Attachments

(3 files)

+++ This bug was initially created as a clone of Bug #933567 +++

mattwoodrow:

I think the best way to implement MaskSurface will be to use the secret features of drawBitmap().

drawBitmap normally draws the passed bitmap as a source, unless the bitmap is a8, in which case it will use the bitmap as a mask and use the SkPaint to decide the source.

Most of the time we should already have a8 bitmap as the mask surface, but we can call SkBitmap::extractAlpha() if we get some other sort of source.

Then the implementation should be more or less identical to FillRect() except passing mask, aOffset.x, aOffset.y instead of aRect.
Assignee: nobody → gal
Depends on: 933584
Attachment #825723 - Flags: review?(matt.woodrow)
Attachment #825724 - Flags: review?(matt.woodrow)
Attachment #825725 - Flags: review?(matt.woodrow)
Comment on attachment 825723 [details] [diff] [review]
Part 1: Factor out PaintSurface

Review of attachment 825723 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/2d/DrawTargetSkia.cpp
@@ +328,5 @@
>  
>    SkRect sourceBoundingRect = RectToSkRect(boundingSource);
>    SkIRect sourceBoundingIRect = RectToSkIRect(boundingSource);
>  
> +  const SkBitmap& bitmap = static_cast<SourceSurfaceSkia*>(static_cast<SourceSurface*>(surface))->GetBitmap();

The inner static_cast should just be surface.get()
Attachment #825723 - Flags: review?(matt.woodrow) → review+
Attachment #825724 - Flags: review?(matt.woodrow) → review+
Comment on attachment 825725 [details] [diff] [review]
Part 3: Optimize MaskSurface

Review of attachment 825725 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, as long as it works!
Attachment #825725 - Flags: review?(matt.woodrow) → review+

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: gal → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: