Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR の目的
描画処理を高速化してCPU負荷を減らすのが目的です。
カテゴリ
PR の背景
従来実装では
CGraphics
クラスの構築時にクリッピング領域の取得操作が毎回行われており、その処理にいくらか時間を浪費していました。各種GDIオブジェクトの保存と復帰処理の実装がいくらか煩雑な記述になっていました。このPRでは SaveDC と RestoreDC を使う事で保存復帰処理を単純化しました。
追記:while ループ内で呼び出す
CEditView::DrawLogicLine
メソッド内でCGraphics
型のインスタンスの生成と破棄を 行うのはコストが高いので、ループの外に用意して使いまわすようにしました。PR のメリット
描画処理が少し速くなります、体感で分かるかというと微妙かもです…。
CGraphics
クラスの実装がシンプルになります。PR のデメリット (トレードオフとかあれば)
特にないはずです。
PR の影響範囲
描画処理で
CGraphics
を使用している箇所関連チケット
強いて挙げるなら #699