PERF - 层正与 NULL 不透明度掩码、1.0 不透明度和轴对齐矩形几何掩码一起使用。 推送/弹出剪辑 API 应实现相同的结果,同时提高性能。
占位符
- 
接口 
- 
接口的地址。 
| 错误级别 | 信息 | 
例子
当层仅包含一个基元(一个矩形)且D2D1_LAYER_PARAMETERS结构的字段设置为默认值时,以下代码使用 PushLayer 和 PopLayer。 有关 D2D1_LAYER_PARAMETERS 结构的默认值,请参阅 LayerParameter。
        ID2D1Layer *m_pLayer;
        hr = m_pRenderTarget->CreateLayer(D2D1::SizeF(100, 100), &m_pLayer);
        m_pRenderTarget->PushLayer(D2D1::LayerParameters(), m_pLayer);
        m_pRenderTarget->FillRectangle(D2D1::RectF(100, 50, 400, 160), m_pBlackBrush);
        m_pRenderTarget->PopLayer();
此示例生成以下调试消息:
DEBUG INFO - PERF - A layer is being used with a NULL opacity mask, 1.0 opacity, 
            and an axis aligned rectangular geometric mask.  
            The Push/Pop Clip API should achieve the same results with higher performance.
可能的原因
当 PushAxisAlignedClip 和 PopAxisAlignedClip 方法已足够时使用层。