Small code and comment cleanups as well as clarifications.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26432 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -157,8 +157,12 @@ Painter::SetDrawState(const DrawState* data, int32 xOffset, int32 yOffset)
|
|||||||
// NOTE: The custom clipping in "data" is ignored, because it has already
|
// NOTE: The custom clipping in "data" is ignored, because it has already
|
||||||
// been taken into account elsewhere
|
// been taken into account elsewhere
|
||||||
|
|
||||||
// TODO: optimize "context switch" for speed...
|
// NOTE: Usually this function is only used when the "current view"
|
||||||
// but for now...
|
// is switched in the ServerWindow and after the decorator has drawn
|
||||||
|
// and messed up the state. For other graphics state changes, the
|
||||||
|
// Painter methods are used directly, so this function is much less
|
||||||
|
// speed critical than it used to be.
|
||||||
|
|
||||||
SetPenSize(data->PenSize());
|
SetPenSize(data->PenSize());
|
||||||
|
|
||||||
SetFont(data);
|
SetFont(data);
|
||||||
@@ -167,19 +171,21 @@ Painter::SetDrawState(const DrawState* data, int32 xOffset, int32 yOffset)
|
|||||||
|
|
||||||
// any of these conditions means we need to use a different drawing
|
// any of these conditions means we need to use a different drawing
|
||||||
// mode instance
|
// mode instance
|
||||||
bool updateDrawingMode = !(data->GetPattern() == fPatternHandler.GetPattern()) ||
|
bool updateDrawingMode
|
||||||
data->GetDrawingMode() != fDrawingMode ||
|
= !(data->GetPattern() == fPatternHandler.GetPattern())
|
||||||
(data->GetDrawingMode() == B_OP_ALPHA && (data->AlphaSrcMode() != fAlphaSrcMode ||
|
|| data->GetDrawingMode() != fDrawingMode
|
||||||
data->AlphaFncMode() != fAlphaFncMode));
|
|| (data->GetDrawingMode() == B_OP_ALPHA
|
||||||
|
&& (data->AlphaSrcMode() != fAlphaSrcMode
|
||||||
|
|| data->AlphaFncMode() != fAlphaFncMode));
|
||||||
|
|
||||||
fDrawingMode = data->GetDrawingMode();
|
fDrawingMode = data->GetDrawingMode();
|
||||||
fAlphaSrcMode = data->AlphaSrcMode();
|
fAlphaSrcMode = data->AlphaSrcMode();
|
||||||
fAlphaFncMode = data->AlphaFncMode();
|
fAlphaFncMode = data->AlphaFncMode();
|
||||||
fPatternHandler.SetPattern(data->GetPattern());
|
fPatternHandler.SetPattern(data->GetPattern());
|
||||||
fPatternHandler.SetOffsets(xOffset, yOffset);
|
fPatternHandler.SetOffsets(xOffset, yOffset);
|
||||||
fLineCapMode = data->LineCapMode();
|
fLineCapMode = data->LineCapMode();
|
||||||
fLineJoinMode = data->LineJoinMode();
|
fLineJoinMode = data->LineJoinMode();
|
||||||
fMiterLimit = data->MiterLimit();
|
fMiterLimit = data->MiterLimit();
|
||||||
|
|
||||||
// adopt the color *after* the pattern is set
|
// adopt the color *after* the pattern is set
|
||||||
// to set the renderers to the correct color
|
// to set the renderers to the correct color
|
||||||
@@ -1180,7 +1186,7 @@ Painter::_UpdateDrawingMode(bool drawingText)
|
|||||||
// has been implemented for B_OP_COPY and a couple others (the
|
// has been implemented for B_OP_COPY and a couple others (the
|
||||||
// DrawingMode*Solid ones) as of now. The PixelFormat knows the
|
// DrawingMode*Solid ones) as of now. The PixelFormat knows the
|
||||||
// PatternHandler and makes its decision based on the pattern.
|
// PatternHandler and makes its decision based on the pattern.
|
||||||
// The last parameter to SetDrawingMode() is a flag if a special
|
// The last parameter to SetDrawingMode() is a special flag
|
||||||
// for when Painter is used to draw text. In this case, another
|
// for when Painter is used to draw text. In this case, another
|
||||||
// special version of B_OP_COPY is used that acts like R5 in that
|
// special version of B_OP_COPY is used that acts like R5 in that
|
||||||
// anti-aliased pixel are not rendered against the actual background
|
// anti-aliased pixel are not rendered against the actual background
|
||||||
|
|||||||
Reference in New Issue
Block a user