Closed Bug 1275826 Opened 5 years ago Closed 5 years ago

Remove composition adjustment code, base on layer-index, in nsCSSRendering::PaintBackgroundWithSC

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: u459114, Assigned: u459114)

Details

Attachments

(2 files)

According to bug 1275451 comment 9, remove layer index check at [1]
Have that logic at caller-side(GenerateMaskSurface) only. 

[1] https://dxr.mozilla.org/mozilla-central/source/layout/base/nsCSSRendering.cpp#3091
Attachment #8788138 - Flags: review?(mstange)
Attachment #8788142 - Flags: review?(mstange)
Comment on attachment 8788138 [details]
Bug 1275826 - Part 1. Determine composition mode base on layer index and image type.

https://reviewboard.mozilla.org/r/76730/#review74836

::: layout/base/nsCSSRendering.cpp:3049
(Diff revision 2)
> +  const nsStyleImageLayers::Layer& layer = aLayers.mLayers[aLayerIndex];
> +  // While drawing all layers, get the compositon op from each image layer.
> +  if (aParams.paintFlags & nsCSSRendering::PAINTBG_MASK_IMAGE) {
> +    // Always using OP_OVER mode while drawing the bottom mask layer.
> +    return (aLayerIndex == (aLayers.mImageCount - 1))
> +           ? CompositionOp::OP_OVER
> +           : nsCSSRendering::GetGFXCompositeMode(layer.mComposite);
> +  } else {
> +    return nsCSSRendering::GetGFXBlendMode(layer.mBlendMode);
> +  }

No else after return, please.

I'd also replace "While drawing" with "When drawing", and I'd slightly prefer an if condition instead of the ternary operator inside the mask case.
Attachment #8788138 - Flags: review?(mstange) → review+
Comment on attachment 8788142 [details]
Bug 1275826 - Part 2. Remove a unsed parameter in PrepareImageLayer.

https://reviewboard.mozilla.org/r/76736/#review74838
Attachment #8788142 - Flags: review?(mstange) → review+
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/76c0440bbaf1
Part 1. Determine composition mode base on layer index and image type. r=mstange
https://hg.mozilla.org/integration/autoland/rev/8454daae5c1f
Part 2. Remove a unsed parameter in PrepareImageLayer. r=mstange
https://hg.mozilla.org/mozilla-central/rev/76c0440bbaf1
https://hg.mozilla.org/mozilla-central/rev/8454daae5c1f
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.