[t:/]$ 지식_

Qt::WA_PaintOnScreen

2010/02/18

QT 최적화 관련.

위젯 생성자에서 다음과 같이 호출한다.

setAttribute(Qt::WA_PaintOnScreen, true);

임베디드 환경에서 잘 쓰면 상당한 속도 향상을 얻을 수 있다.

보통 이미지 처리라면 이렇다.

써피스 또는 버퍼 생성 -> 버퍼끼리 복사하고 쿵짝 -> 프레임버퍼로 복사

위 플래그를 셋팅하고 처리하면 이렇게 된다.

써피스 또는 버퍼 생성 -> 프레임버퍼 때려쓰며 작업

결과 : 당연히 memcpy 가 극소화 된다.

문제는 이러하다.

화면에 그려지는 것이 보인다 (깜빡임 문제등)
이미지 객체의 중첩, 클리핑 문제등이 완전히 무시된다.

따라서 쓸 수 있는 것은 한정된다.

알파블렌딩등 이미지 작업이 없어야 하며 (그려지는 것이 보이면 안 되므로)
작은 그림이어야 하고 (CPU 및 버스 속도가 충분히 빠르다면 좀 커도 괜찮음)
덮어씌여지지 않는 최상단 레이어 그림이어야 한다. (안 망가지게)

Qt::WA_PaintOnScreen

Indicates that the widget wants to draw directly onto the screen. Widgets with this attribute set do not participate in composition management, i.e. they cannot be semi-transparent or shine through semi-transparent overlapping widgets. $2 This flag is only supported on X11 and it disables double buffering. On Qt for Embedded Linux, the flag only works when set on a top-level widget and it relies on support from the active screen driver. This flag is set or cleared by the widget's author. To render outside of Qt's paint system, e.g., if you require native painting primitives, you need to reimplement QWidget::paintEngine() to return 0 and set this flag.





공유하기













[t:/] is not "technology - root". dawnsea, rss