[CID 1403450] dead_error_condition: The condition !drawBackgroundImage cannot be true.

NEW
Unassigned

Status

()

Core
Layout: Web Painting
--
trivial
7 months ago
7 months ago

People

(Reporter: mats, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 months ago
http://searchfox.org/mozilla-central/rev/15edcfd962be2c8cfdd0b8a96102150703bd4ac5/layout/painting/nsCSSRendering.cpp#2602,2606,2639

   cond_const: Condition drawBackgroundImage, taking true branch. Now the value of drawBackgroundImage is equal to 1.
2602  if (!drawBackgroundImage) {
2603    if (!isCanvasFrame) {
2604      DrawBackgroundColor(clipState, ctx, appUnitsPerPixel);
2605    }
2606    return DrawResult::SUCCESS;
2607  }
2608
2609  if (layers.mImageCount < 1) {
2610    // Return if there are no background layers, all work from this point
2611    // onwards happens iteratively on these.
2612    return DrawResult::SUCCESS;
2613  }
2614
2615  MOZ_ASSERT((aParams.layer < 0) ||
2616             (layers.mImageCount > uint32_t(aParams.layer)));
2617  bool drawAllLayers = (aParams.layer < 0);
2618
2619  // Ensure we get invalidated for loads of the image.  We need to do
2620  // this here because this might be the only code that knows about the
2621  // association of the style data with the frame.
2622  if (aBackgroundSC != aParams.frame->StyleContext()) {
2623    uint32_t startLayer = drawAllLayers ? layers.mImageCount - 1
2624                                        : aParams.layer;
2625    uint32_t count = drawAllLayers ? layers.mImageCount : 1;
2626    NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT_WITH_RANGE(i, layers, startLayer,
2627                                                         count) {
2628      aParams.frame->AssociateImage(layers.mLayers[i].mImage,
2629                                    &aParams.presCtx);
2630    }
2631  }
2632
2633  // The background color is rendered over the entire dirty area,
2634  // even if the image isn't.
2635  if (drawBackgroundColor && !isCanvasFrame) {
2636    DrawBackgroundColor(clipState, ctx, appUnitsPerPixel);
2637  }
2638
    const: At condition drawBackgroundImage, the value of drawBackgroundImage must be equal to 1.
    dead_error_condition: The condition !drawBackgroundImage cannot be true.
2639  if (!drawBackgroundImage) {
    CID 1403450 (#1 of 1): Logically dead code (DEADCODE)dead_error_line: Execution cannot reach this statement: return mozilla::image::Draw....
2640    return DrawResult::SUCCESS; // No need to draw layer image, we can early
2641                                // return now.
2642  }
You need to log in before you can comment on or make changes to this bug.