|
|
|
Lines 221-236
ThebesLayerD3D9::RenderThebesLayer(Readb
|
Link Here
|
|---|
|
| 221 |
} |
221 |
} |
| 222 |
|
222 |
|
| 223 |
nsTArray<ReadbackProcessor::Update> readbackUpdates; |
223 |
nsTArray<ReadbackProcessor::Update> readbackUpdates; |
| 224 |
nsIntRegion readbackRegion; |
224 |
nsIntRegion readbackRegion; |
| 225 |
if (aReadback && UsedForReadback()) { |
225 |
if (aReadback && UsedForReadback()) { |
| 226 |
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion); |
226 |
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion); |
| 227 |
} |
227 |
} |
| 228 |
|
228 |
|
|
|
229 |
// Avoid artifacts when doing multipass rendering with a resampling transform, |
| 230 |
// by ensuring we render the whole layer texture in one go instead of |
| 231 |
// rectangle-by-rectangle. |
| 232 |
if (mode == SURFACE_COMPONENT_ALPHA) { |
| 233 |
const gfx3DMatrix& transform = GetEffectiveTransform(); |
| 234 |
gfxMatrix transform2d; |
| 235 |
if (!transform.Is2D(&transform2d) || |
| 236 |
transform2d.HasNonIntegerTranslation()) { |
| 237 |
mVisibleRegion = mTextureRect; |
| 238 |
} |
| 239 |
} |
| 240 |
|
| 229 |
// Because updates to D3D9 ThebesLayers are rendered with the CPU, we don't |
241 |
// Because updates to D3D9 ThebesLayers are rendered with the CPU, we don't |
| 230 |
// have to do readback from D3D9 surfaces. Instead we make sure that any area |
242 |
// have to do readback from D3D9 surfaces. Instead we make sure that any area |
| 231 |
// needed for readback is included in the drawRegion we ask layout to render. |
243 |
// needed for readback is included in the drawRegion we ask layout to render. |
| 232 |
// Then the readback areas we need can be copied out of the temporary |
244 |
// Then the readback areas we need can be copied out of the temporary |
| 233 |
// destinationSurface in DrawRegion. |
245 |
// destinationSurface in DrawRegion. |
| 234 |
nsIntRegion drawRegion; |
246 |
nsIntRegion drawRegion; |
| 235 |
drawRegion.Sub(mVisibleRegion, mValidRegion); |
247 |
drawRegion.Sub(mVisibleRegion, mValidRegion); |
| 236 |
drawRegion.Or(drawRegion, readbackRegion); |
248 |
drawRegion.Or(drawRegion, readbackRegion); |