summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-15 12:28:17 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-01-15 12:28:17 (GMT)
commit001ebdf49623641048122189d81cdbfe70652a52 (patch)
tree9655f09f1a3553d4ab95c007906fab30fb743b08 /src/gui/painting
parent9ba9308a997bac90c30b766a48f44451e86e14d9 (diff)
downloadQt-001ebdf49623641048122189d81cdbfe70652a52.zip
Qt-001ebdf49623641048122189d81cdbfe70652a52.tar.gz
Qt-001ebdf49623641048122189d81cdbfe70652a52.tar.bz2
Clarify the docs slightly for QPainter::beginNativePainting().
Some complain that we don't reset every GL state in the GL engine in endNativePainting(). We simply can't do that as it would be a performance bump. The user is responsible for setting states they themselves change in a begin/endNativePainting() block, back to their default state.
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index a98ac10..a9dcea0 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1984,9 +1984,14 @@ QPaintEngine *QPainter::paintEngine() const
/*!
\since 4.6
- Flushes the painting pipeline and prepares for the user issuing
- commands directly to the underlying graphics context. Must be
- followed by a call to endNativePainting().
+ Flushes the painting pipeline and prepares for the user issuing commands
+ directly to the underlying graphics context. Must be followed by a call to
+ endNativePainting().
+
+ Note that only the states the underlying paint engine changes will be reset
+ to their respective default states. If, for example, the OpenGL polygon
+ mode is changed by the user inside a beginNativePaint()/endNativePainting()
+ block, it will not be reset to the default state by endNativePainting().
Here is an example that shows intermixing of painter commands
and raw OpenGL commands:
@@ -2010,9 +2015,9 @@ void QPainter::beginNativePainting()
/*!
\since 4.6
- Restores the painter after manually issuing native painting commands.
- Lets the painter restore any native state that it relies on before
- calling any other painter commands.
+ Restores the painter after manually issuing native painting commands. Lets
+ the painter restore any native state that it relies on before calling any
+ other painter commands.
\sa beginNativePainting()
*/