Windows 7 DirectWrite FPS减速

Windows 7 DirectWrite FPS减速,windows-7,directx,frame-rate,direct2d,directwrite,Windows 7,Directx,Frame Rate,Direct2d,Directwrite,经过很长一段时间(比如一个月),我能够通过Direct3D11、Direct3D10、Direct2D和DirectWrite的互操作性在我的应用程序上呈现文本字体。现在我已经找到了解决方案,我注意到在绘制一些文本时,FPS(每秒帧速率)的速度明显变慢了,有什么建议吗 编辑: 分析应用程序花费我很多时间的函数是d2dRender->DrawText(…);其中d2dRender是ID2dRenderTarget指针我仅在对其进行修改并仅绘制渲染纹理后才解决了绘制文本的问题,如: if (myTe

经过很长一段时间(比如一个月),我能够通过Direct3D11、Direct3D10、Direct2D和DirectWrite的互操作性在我的应用程序上呈现文本字体。现在我已经找到了解决方案,我注意到在绘制一些文本时,FPS(每秒帧速率)的速度明显变慢了,有什么建议吗

编辑:


分析应用程序花费我很多时间的函数是d2dRender->DrawText(…);其中d2dRender是ID2dRenderTarget指针

我仅在对其进行修改并仅绘制渲染纹理后才解决了绘制文本的问题,如:

if (myTextObject->IsChanged)
{
    d2dRenderTarget->DrawText(...); // and what else we need to draw on the surface
}

// Draw my Texture here (surface)

性能配置另外,如果文本在两个帧之间保持不变,您还可以缓存IDWriteTextLayout对象(从CreateTextLayout)并调用DrawTextLayout,从而避免一些重新部署成本。